From c2ffad100c432176c537aca673b796a7605cad1c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Jul 2008 12:40:45 -0700 Subject: Fix on_each_cpu() call for kernels >2.6.26. This is a generalization of the patch from James Bottomley: http://sources.redhat.com/ml/systemtap/2008-q3/msg00220.html The on_each_cpu() change was merged *after* the 2.6.26 release, so I'm using an autoconf test instead of James' version check. --- ChangeLog | 3 ++- buildrun.cxx | 1 + runtime/ChangeLog | 1 + runtime/autoconf-oneachcpu-retry.c | 7 +++++++ runtime/time.c | 4 ++++ 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 runtime/autoconf-oneachcpu-retry.c diff --git a/ChangeLog b/ChangeLog index e8f58408..11ef1787 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2008-07-24 Josh Stone - * buildrun.cxx (compile_pass): Remove STAPCONF_MODULE_NSECTIONS + * buildrun.cxx (compile_pass): Remove STAPCONF_MODULE_NSECTIONS, + and add STAPCONF_ONEACHCPU_RETRY 2008-07-23 Frank Ch. Eigler diff --git a/buildrun.cxx b/buildrun.cxx index 9aa13ef4..c2ebdce5 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -97,6 +97,7 @@ compile_pass (systemtap_session& s) o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-unregister-kprobes.c, -DSTAPCONF_UNREGISTER_KPROBES,)" << endl; o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-real-parent.c, -DSTAPCONF_REAL_PARENT,)" << endl; 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; #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 9e4c3ec6..a8d73ffd 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,6 +1,7 @@ 2008-07-24 Josh Stone * runtime/autoconf-module-nsections.c: removed + * runtime/autoconf-oneachcpu-retry.c: added 2008-07-21 David Smith diff --git a/runtime/autoconf-oneachcpu-retry.c b/runtime/autoconf-oneachcpu-retry.c new file mode 100644 index 00000000..304d9842 --- /dev/null +++ b/runtime/autoconf-oneachcpu-retry.c @@ -0,0 +1,7 @@ +#include + +void ____autoconf_func(void) +{ + /* Older on_each_cpu() calls had a "retry" parameter */ + (void)on_each_cpu(NULL, NULL, 0, 0); +} diff --git a/runtime/time.c b/runtime/time.c index 8a0b6fad..6b01cebe 100644 --- a/runtime/time.c +++ b/runtime/time.c @@ -237,7 +237,11 @@ _stp_init_time(void) return -1; stp_timer_reregister = 1; +#ifdef STAPCONF_ONEACHCPU_RETRY ret = on_each_cpu(__stp_init_time, NULL, 0, 1); +#else + ret = on_each_cpu(__stp_init_time, NULL, 1); +#endif #ifdef CONFIG_CPU_FREQ if (!ret && !__stp_constant_freq()) { -- cgit