Capturing usage information
yao.qi at linaro.org
Tue Aug 10 04:49:29 BST 2010
Michael Hope 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.
There is a 2006 GCC Summit paper "Low-Level Performance Analysis",
written by Steven Munroe and Peter Steinmetz. They introduced how do
they improve the performance of some methods, like memcmp() on POWER
processor. This paper is similar to what we are doing, and hope it is
> Does anyone know of existing research with this information, or
> existing tools that could capture it?
Looks like you need a Binary Instrumentation tool for method tracing.
Pin/Valgrind are good DBI platforms, and not hard to write a
plugin/extension to them for our needs. However, I am not sure Pin is
well-supported on ARM, and I also concern about overhead of valgrind for
> My fallback is to use a LD_PRELOAD trick to replace the interesting
> functions with tracing versions.
Yeah, LD_PRELOAD is not bad if we can't find any other tools to do
 Pin Tool. http://www.pintool.org/
 Valgrind. valgrind.org
More information about the Linaro-dev