Hacker News new | ask | show | jobs
by ttuominen 4845 days ago
For CPU profiling, the Android Open Source Project includes both oprofile and Linux perf tools in the source tree. You would need to compile your own kernel and Android to include them. Some options need to be set in the kernel config to enable support for processor hardware events for profiling. Additionally, you need to compile the profiled code in ARM mode instead of Thumb for perf tools to be able to unwind the stack traces. Oprofile might work without kernel hardware support, I'm not sure.

I don't know about shader profiling. GDB is apparently supported for debugging, haven't used it: http://www.kandroid.org/online-pdk/guide/debugging_gdb.html

EDIT: By the way, depending on the accuracy you require, you might want to take a look at this poor man's profiler that Mike Dunlavey has been advocating: http://stackoverflow.com/questions/375913/what-can-i-use-to-... It doesn't require compiling the operating system, you can just send a kill signal to your process multiple times and examine the stack traces from the logs. It may or may not be enough for your needs.