开发者

getrusage function on embedded linux

开发者 https://www.devze.com 2023-03-22 02:09 出处:网络
I have one bench marking applicati开发者_运维百科on in which I am evaluating a C++ framework.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号