Bug 11739 - alibi flag
Summary: alibi flag
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-22 21:59 UTC by Frank Ch. Eigler
Modified: 2010-10-05 01:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2010-06-22 21:59:25 UTC
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.
Comment 1 Josh Stone 2010-09-01 21:14:51 UTC
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";
 }
Comment 2 Josh Stone 2010-10-05 01:10:17 UTC
Commit 653e6a9 adds STP_ALIBI with atomic hit-counts.