This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

conditional probes


I am planning on using the conditional probe mechanism for instruction tracing. Jim Keniston suggested that you might be the right person to ask about how the internals of conditional probes work.

Frank suggested the following a few months ago:

 probe process(PID_OR_NAME).itrace if (condition) { }
 probe process(PID_OR_NAME).function("NAME") { condition = 1 }
 probe process(PID_OR_NAME).function("NAME").return { condition = 0 }

So, the idea is that the instruction tracing handler that will get called by the utrace report_signal handler (when a single-step trap occurs) and the handler body will comprise: "if (condition) { .... }"


I'm not having any luck getting this to work and wanted to check to see if my understanding is correct.  By examining debug output I can tell that:
1) the task_finder callback gets called with register_p=1: it initializes my instruction tracing stuff, sets up a function pointer to the generated probe corresponding to "if(condition) { .... }"
2) the two probes to set and unset the condition variable get called
3) the utrace report_signal handler for the single-step trap gets called many times, as expected.  it calls the function pointer set up in 1) but it appears that I never get past the generated "if (condition)" code because I don't get any _stp_printf output.

I'm wondering if there is more setup required that I'm not doing, or if you can see something I'm missing/misunderstanding.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]