Carm

Automatic ARM Instrumentation for C Source Code

~2006

This is a C library for automatic ARM instrumentation of C/(C++) code.

The C/C++ compiler of the GNU compiler collection (GCC) provides automatic insertion of instrumentation code by a flag called -finstrument-functions. Using this flag, the compiler inserts instrumentation code before and after each function which calls either __cyg_profile_func_enter() or __cyg_profile_func_leave() (see [1] for a nice article on the GNU profiling functions). The application program can implement this function for any purpose - for example performance instrumentation for bottleneck analysis.

Exactly this purposes is the goal of the standard API for Application Response Measurement (ARM, [2]). A lot of management tools provide agents for this API to collect those data from different sources.

Therefore the idea was to bridge between GNU profiling functions and the ARM API. This library contains implementations of the profiling functions which gather and preprocess the information and forward it to the ARM 4 API.

AUTOMATIC INSTRUMENTATION

Compile all files you want to insert instrumentation code with at least the following flags:

CFLAGS=-g -rdynamic -finstrument-functions

Link your binary with the following libraries:

LDFLAGS=-lcarm -ldl -lglib-2.0 -l<arm_agent_lib>

<arm_agent_lib> is an ARM agent library of your choice. In the ARM 4.0 SDK is an example library (libarm4logger.so) which simply logs all information to stdout. The ARM 4.0 SDK is bundled with this package.