开发者

Profiling embedded application

开发者 https://www.devze.com 2023-01-08 12:13 出处:网络
I have an application that runs on an embedded processor (ARM), and I\'d like to profile the application to get开发者_StackOverflow社区 an idea of where it\'s using system resources, like CPU, memory,

I have an application that runs on an embedded processor (ARM), and I'd like to profile the application to get开发者_StackOverflow社区 an idea of where it's using system resources, like CPU, memory, IO, etc. The application is running on top of Linux, so I'm assuming there's a number of profiling applications available. Does anyone have any suggestions?

Thanks!

edit: I should also add the version of Linux we're using is somewhat old (2.6.18). Unfortunately I don't have a lot of control over that right now.


As bobah said, gprof and valgrind are useful. You might also want to try OProfile. If your application is in C++ (as indicated by the tags), you might want to consider disabling exceptions (if your compiler lets you) and avoiding dynamic casts, as mentioned above by sashang. See also Embedded C++.


if your Linux is not very limited then you may find gprof and valgrind useful


On a related note, the C++ working group did a technical report on the performance cost of various C++ language features. For example they analyze the cost of dynamic_casting one or 2 levels deep. The reports here http://www.open-std.org/jtc1/sc22/wg21/docs/TR18015.pdf and it might give you some insight into where the pain points in your embedded application might be.


gprof may disappoint you.

Assuming the program you are testing is big enough to be useful, then chances are the call tree could be pruned, so the best opportunities for optimization are function/method calls that you can remove or avoid. That link shows a good way to find them.

Many people approach this as sort of a hierarchical sleuthing process of measuring times. Or you can simply catch it in the act, which is what I do.

0

精彩评论

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