Skip to content

claudioscordino/ctracer

Repository files navigation

Simple C tracer

Preparatory investigation for developing a software tracer for ERIKA Enterprise.

The tracer is roughly based on the ftrace approach (i.e. __fentry__ or mcount functions of gcc, enabled through the -pg option).

Example of usage

Once compiled (type make) the ./main executable writes a trace.dat file containing symbols and timestamps:

./main

Then, the create_trace.py script can convert the trace replacing the addresses with the actual function name:

./create_trace.py ./main trace.dat

will create the trace.txt file.

Alternatively, the create_trace.py script can convert the trace to the BTF format, that can be viewed through Eclipse Trace Compass.

TODO

  • Hijack trampoline to be called when the function ends execution
  • Port to ERIKA Enterprise