]> sourceware.org Git - systemtap.git/commitdiff
safety: add paranoid call to synchronize_sched() during shutdown process
authorFrank Ch. Eigler <fche@elastic.org>
Wed, 26 Nov 2008 18:59:53 +0000 (13:59 -0500)
committerFrank Ch. Eigler <fche@elastic.org>
Wed, 26 Nov 2008 18:59:53 +0000 (13:59 -0500)
ChangeLog
buildrun.cxx
runtime/ChangeLog
runtime/autoconf-synchronize-sched.c [new file with mode: 0644]
translate.cxx

index fd3860e60295fc99a66fd1245f7339c9c71b9f4d..8572035bfc65a6f6bfbe20d6df04b24b01153f99 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-26  Frank Ch. Eigler  <fche@elastic.org>
+
+       * translate.cxx (emit_module_exit): Call synchronize_sched during
+       module shutdown if it's available.
+       * buildrun.cxx (compile_pass): Test for it.
+
 2008-11-25  Frank Ch. Eigler  <fche@elastic.org>
 
        PR 7046.
index c23a4747983a261feb4df21c8a71e47bbd2520c5..9eeab4bafb1c70636fa9e9e8bb94046263569262 100644 (file)
@@ -112,6 +112,8 @@ compile_pass (systemtap_session& s)
   o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-uaccess.c, -DSTAPCONF_LINUX_UACCESS_H,)" << endl;
   o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-oneachcpu-retry.c, -DSTAPCONF_ONEACHCPU_RETRY,)" << endl;
   o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-dpath-path.c, -DSTAPCONF_DPATH_PATH,)" << endl;
+  o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-synchronize-sched.c, -DSTAPCONF_SYNCHRONIZE_SCHED,)" << endl;
+
 #if 0
   /* NB: For now, the performance hit of probe_kernel_read/write (vs. our
    * homegrown safe-access functions) is deemed undesireable, so we'll skip
index 91a932c471e36a0852ad173a78a953a15b187c75..f3c5f2e3cbfce11e7b0fbff68a37542484e26c07 100644 (file)
@@ -1,3 +1,7 @@
+2008-11-26  Frank Ch. Eigler  <fche@elastic.org>
+
+       * autoconf-synchronize-sched.c: New file.
+
 2008-11-25  Frank Ch. Eigler  <fche@elastic.org>
 
        PR 7046.
diff --git a/runtime/autoconf-synchronize-sched.c b/runtime/autoconf-synchronize-sched.c
new file mode 100644 (file)
index 0000000..0291092
--- /dev/null
@@ -0,0 +1,6 @@
+#include <linux/sched.h>
+
+void foo (void)
+{
+  synchronize_sched ();
+}
index 1cf7361e8b244d435c07d7206729ff4470831718..41a424ed6a66eb4ba1634cc87ab440e16d88699b 100644 (file)
@@ -1287,6 +1287,11 @@ c_unparser::emit_module_exit ()
   o->newline () << "yield ();"; // aka schedule() and then some 
   o->newline(-2) << "} while (holdon);";
 
+  // 
+  o->newline() << "#ifdef STAPCONF_SYNCHRONIZE_SCHED";
+  o->newline() << "synchronize_sched();";
+  o->newline() << "#endif";
+
   // XXX: might like to have an escape hatch, in case some probe is
   // genuinely stuck somehow
 
@@ -4860,6 +4865,7 @@ translate_pass (systemtap_session& s)
       s.op->newline() << "#include \"stat.c\"";
       s.op->newline() << "#include <linux/string.h>";
       s.op->newline() << "#include <linux/timer.h>";
+      s.op->newline() << "#include <linux/sched.h>";
       s.op->newline() << "#include <linux/delay.h>";
       s.op->newline() << "#include <linux/profile.h>";
       s.op->newline() << "#include <linux/random.h>";
This page took 0.049189 seconds and 5 git commands to generate.