Hi
On Mon, Aug 9, 2010 at 8:47 PM, Michael Hope michael.hope@linaro.org wrote:
I'd like to record the running of a typical program such as Firefox, GCC, or ffmpeg and capture the calls and arguments to functions like strcpy() and memcpy(). The idea is to generate a usage profile so we can tell what standard library functions and what variants (i.e. aligned/unaligned, small copy/large copy) to attack first.
The linux perf tool may also help you: https://perf.wiki.kernel.org/index.php/Main_Page
Think of it as "Oprofile 2" (though no doubt someone would flame me for that). It's a sampling profiler, so it won't count function calls AFAIK. But you can identify hotsports, both in libraries and the kernel as well as the target application.
Note - some patches to the perf tools is needed if you want to get correct profiling information from prebuilt Ubuntu packages; there's also one minor ARM-specific fix - see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/608775
You will also need the debug images for any libraries you want profiling information for. Debug package names not completely predictable, but are usually either: * <binary-package-name>-dbg (from the standard archives), or * <binary-package-name>-dbgsym (from http://ddebs.ubuntu.com/) - see https://wiki.edubuntu.org/DebuggingProgramCrash
Common packages are more likely to have an explicitly-generated debug package (*-dbg); *-dbgsym are generated automatically for most other packages.
Cheers ---Dave