From 62794910c3ec360552209063fc2b9295e3382ca3 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 26 Nov 2008 17:39:33 -0500 Subject: PR4886: enable assertive build-id checking for new kernels --- runtime/ChangeLog | 6 ++++++ runtime/sym.c | 13 +++++++++++-- translate.cxx | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/runtime/ChangeLog b/runtime/ChangeLog index f3c5f2e3..93ee18d2 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,9 @@ +2008-11-26 Frank Ch. Eigler + + PR 4886. + * sym.c (_stp_module_check): Perform assertive + build-id checking for kernel versions >= 2.6.27. + 2008-11-26 Frank Ch. Eigler * autoconf-synchronize-sched.c: New file. diff --git a/runtime/sym.c b/runtime/sym.c index d7b079d2..06ac14a5 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -205,14 +205,23 @@ static int _stp_module_check(void) /* XXX: consider using kread() instead of above. */ if (theory != practice) { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) + _stp_error ("%s: inconsistent %s build-id byte #%d " + "(0x%x [actual] vs. 0x%x [debuginfo])\n", + THIS_MODULE->name, m->name, j, + practice, theory); + return 1; + #else + /* This branch is a surrogate for + kernels affected by Fedora bug + #465873. */ printk(KERN_WARNING "%s: inconsistent %s build-id byte #%d " "(0x%x [actual] vs. 0x%x [debuginfo])\n", THIS_MODULE->name, m->name, j, practice, theory); break; /* Note just the first mismatch. */ - /* XXX: If it were not for Fedora bug #465873, - we could "return 1;" here to abort the script. */ + #endif } } } diff --git a/translate.cxx b/translate.cxx index 41a424ed..49a86160 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1124,7 +1124,7 @@ c_unparser::emit_module_init () o->newline() << "rc = -EINVAL;"; o->newline(-1) << "}"; - // XXX: perform buildid-based checking if able + // perform buildid-based checking if able o->newline() << "if (_stp_module_check()) rc = -EINVAL;"; o->newline(-1) << "}"; -- cgit From 224e23bef7a46c823c4b3d41efdf9dbf98853ed0 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 26 Nov 2008 17:42:45 -0500 Subject: safety: add another schedule_sched, ahead of the per-context release loop --- ChangeLog | 4 ++++ translate.cxx | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e8821811..fde0f158 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-11-26 Frank Ch. Eigler + + * translate.cxx (emit_module_exit): Add another synchronize_sched. + 2008-11-26 Frank Ch. Eigler * main.cxx (main): Advise users to try '--vp ...' after a pass error. diff --git a/translate.cxx b/translate.cxx index 49a86160..43299791 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1273,6 +1273,11 @@ c_unparser::emit_module_exit () // But some other probes may have launched too during unregistration. // Let's wait a while to make sure they're all done, done, done. + // cargo cult prologue + o->newline() << "#ifdef STAPCONF_SYNCHRONIZE_SCHED"; + o->newline() << "synchronize_sched();"; + o->newline() << "#endif"; + // NB: systemtap_module_exit is assumed to be called from ordinary // user context, say during module unload. Among other things, this // means we can sleep a while. @@ -1287,7 +1292,7 @@ c_unparser::emit_module_exit () o->newline () << "yield ();"; // aka schedule() and then some o->newline(-2) << "} while (holdon);"; - // + // cargo cult epilogue o->newline() << "#ifdef STAPCONF_SYNCHRONIZE_SCHED"; o->newline() << "synchronize_sched();"; o->newline() << "#endif"; -- cgit