Tracing Function Calls

The tracer supports recording argument and return values for specified functions. This feature is currently limited to offline mode only (Offline Traces and Analysis). The -record_function parameter lists which function names to trace. Requested names will be located per library and each instance traced separately. The number of arguments to record is specified for each name, using a bar character to separate them. An ampersand separates functions. Here is an example:

$ bin64/drrun -t drmemtrace -offline -record_function 'fib|1&calloc|2'

Within the trace, each function is identified by a numeric identifier. The list of recorded functions, each with its identifier, is placed into a file "funclist.log" in the trace directory, where the sample tool func_view uses it to provide a linear function call trace as well as summary statistics as shown above.

The -record_heap parameter requests recording of a pre-determined set of functions related to heap allocation. The -record_heap_value paramter controls the contents of this set.

The tracer also supports recording system call argument and return values (along with whether the call failed) via the option -record_syscall, which works similarly to -record_function with the system call number replacing the function name.