summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--buildrun.cxx2
-rw-r--r--runtime/ChangeLog4
-rw-r--r--runtime/autoconf-synchronize-sched.c6
-rw-r--r--translate.cxx6
5 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fd3860e6..8572035b 100644
--- 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.
diff --git a/buildrun.cxx b/buildrun.cxx
index c23a4747..9eeab4ba 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -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
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 91a932c4..f3c5f2e3 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -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
index 00000000..0291092e
--- /dev/null
+++ b/runtime/autoconf-synchronize-sched.c
@@ -0,0 +1,6 @@
+#include <linux/sched.h>
+
+void foo (void)
+{
+ synchronize_sched ();
+}
diff --git a/translate.cxx b/translate.cxx
index 1cf7361e..41a424ed 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -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>";