From bc9a523d505c604c187dd2e81be1e24ec877d1af Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 7 Mar 2009 12:11:45 -0500 Subject: Tweak tracepoint logic to run on tracepoint_synchronize_unregister()-less RHEL5 --- tapsets.cxx | 17 +++++++++++++---- translate.cxx | 5 +++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index defaf385..5ea3982d 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -9764,9 +9764,15 @@ tracepoint_derived_probe_group::emit_module_init (systemtap_session &s) << "(enter_tracepoint_probe_" << i << ");"; s.op->newline(-2) << "}"; } - s.op->newline() << "if (rc)"; - s.op->newline(1) << "tracepoint_synchronize_unregister();"; - s.op->indent(-1); + + // This would be technically proper (on those autoconf-detectable + // kernels that include this function in tracepoint.h), however we + // already make several calls to synchronze_sched() during our + // shutdown processes. + + // s.op->newline() << "if (rc)"; + // s.op->newline(1) << "tracepoint_synchronize_unregister();"; + // s.op->indent(-1); } @@ -9780,7 +9786,10 @@ tracepoint_derived_probe_group::emit_module_exit (systemtap_session& s) for (unsigned i = 0; i < probes.size(); ++i) s.op->newline() << "unregister_trace_" << probes[i]->tracepoint_name << "(enter_tracepoint_probe_" << i << ");"; - s.op->newline() << "tracepoint_synchronize_unregister();"; + + // Not necessary: see above. + + // s.op->newline() << "tracepoint_synchronize_unregister();"; } diff --git a/translate.cxx b/translate.cxx index 23a24100..c679e0f1 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1236,6 +1236,11 @@ c_unparser::emit_module_init () o->newline() << getvar (v).fini(); } + // For any partially registered/unregistered kernel facilities. + o->newline() << "#ifdef STAPCONF_SYNCHRONIZE_SCHED"; + o->newline() << "synchronize_sched();"; + o->newline() << "#endif"; + o->newline() << "return rc;"; o->newline(-1) << "}\n"; } -- cgit