getrusage function on embedded linux
I have one bench marking applicati开发者_运维百科on in which I am evaluating a C++ framework.
I am looking for the time and memory consumption. On linux, to get the memory occupied by the current program, I am using getrusage function. It works perfectly on my machine.
Problems arise when I cross compile this application into an arm architecture and run my code on my embedded device (also running linux), the memory function returns 0. Application runs just fine on the embedded device, its just that the memory function is returning me 0.
Any idea what could be the possible solution to this?
Linux versions prior to 2.6.31.14 do not support the ru_maxrss
field of struct rusage
. Linux versions starting with 2.6.32 do. I suppose that you are running an earlier version in your embedded system than you are on your desktop.
精彩评论