Begin tracing program after some number of instructions have executed

25 views Asked by At

I want to enable tracing in my program after a certain number of instructions have been executed. I can trivially begin tracing at the start of my program but then only start recording after N instructions, but then I'll have the overhead associated with the instructions being instrumented already. I essentially want the program to run at full speed until I am ready to begin tracing.

I am using a pintool to trace the program. I thought perhaps I could use some performance monitoring functionality such as PEBS to accomplish this. Maybe I could wake up after every roughly 10k instructions to see if I have run more than N instructions?

Solutions with other binary instrumentation tools are welcome as well.

0

There are 0 answers