diff options
author | Josh Stone <jistone@redhat.com> | 2009-03-16 18:13:07 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-03-16 18:13:07 -0700 |
commit | 86758d5f2b838d5769c7ace15269a4ebc422f94a (patch) | |
tree | 3375d4bf158454b71db41a5cc2ccfaa7a5752110 | |
parent | 5d369d06fa39e4769fb3364ba29f588f3d995c24 (diff) | |
download | systemtap-steved-86758d5f2b838d5769c7ace15269a4ebc422f94a.tar.gz systemtap-steved-86758d5f2b838d5769c7ace15269a4ebc422f94a.tar.xz systemtap-steved-86758d5f2b838d5769c7ace15269a4ebc422f94a.zip |
Fix regression in tracepoint unregistration
Commit 96b030fe reorganized the tracepoint registration calls by
creating generic wrappers that return int. However, the older
tracepoint implementation (as found in RHEL5.3) returned void for unreg,
so this was failing pass-4.
Since we can't handle unregistration failures anyway, this change just
makes the generic unregister function return void instead. As noted in
the newly-added comment, it should be safe for us to ignore unreg
failures.
-rw-r--r-- | tapsets.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 6efcb3af..2f940b29 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -9770,8 +9770,13 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline(1) << "return register_trace_" << p->tracepoint_name << "(enter_tracepoint_probe_" << i << ");"; s.op->newline(-1) << "}"; - s.op->newline() << "static int unregister_tracepoint_probe_" << i << "(void) {"; - s.op->newline(1) << "return unregister_trace_" << p->tracepoint_name + + // NB: we're not prepared to deal with unreg failures. However, failures + // can only occur if the tracepoint doesn't exist (yet?), or if we + // weren't even registered. The former should be OKed by the initial + // registration call, and the latter is safe to ignore. + s.op->newline() << "static void unregister_tracepoint_probe_" << i << "(void) {"; + s.op->newline(1) << "(void) unregister_trace_" << p->tracepoint_name << "(enter_tracepoint_probe_" << i << ");"; s.op->newline(-1) << "}"; s.op->newline(); @@ -9780,7 +9785,7 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) // emit an array of registration functions for easy init/shutdown s.op->newline() << "static struct stap_tracepoint_probe {"; s.op->newline(1) << "int (*reg)(void);"; - s.op->newline(0) << "int (*unreg)(void);"; + s.op->newline(0) << "void (*unreg)(void);"; s.op->newline(-1) << "} stap_tracepoint_probes[] = {"; s.op->indent(1); for (unsigned i = 0; i < probes.size(); ++i) |