For diagnosing problems where some kernel event-source facility like kprobes or uprobes is implicated in a problem, it is a bit tricky to reproduce the set of probes used by a systemtap script, without also dragging in a bunch of the runtime & generated handler code. It may be nice to have a compile-time macro option, say -DSTAP_ALIBI, which disables most of the code actually generated for probe handlers, turning the kprobes pre_handlers into empty functions. The resulting script would of course not run correctly, but should trigger the same set of probe events. (Timers may need special treatment due to the need to restart them, so can't be entirely empty handlers.) With such a flag used, it may be possible to implicate or exculpate the trickier parts of systemtap when investigating a crash.
Even the timers have their restart code outside the prologue->epilogue block, so I think this is as simple as: --- a/tapsets.cxx +++ b/tapsets.cxx @@ -79,6 +79,8 @@ void common_probe_entryfn_prologue (translator_output* o, string statestr, string probe, bool overload_processing) { + o->newline() << "#ifndef STP_ALIBI"; + o->newline() << "struct context* __restrict__ c;"; o->newline() << "#if !INTERRUPTIBLE"; o->newline() << "unsigned long flags;"; @@ -261,6 +263,8 @@ common_probe_entryfn_epilogue (translator_output* o, o->newline() << "#else"; o->newline() << "local_irq_restore (flags);"; o->newline() << "#endif"; + + o->newline() << "#endif // STP_ALIBI"; }
Commit 653e6a9 adds STP_ALIBI with atomic hit-counts.