--- tapsets.cxx-dist 2008-12-16 12:43:34.000000000 +0100 +++ tapsets.cxx 2008-12-16 12:46:33.000000000 +0100 @@ -8520,6 +8520,12 @@ hrtimer_derived_probe_group::emit_module s.op->newline(-1) << "};"; s.op->newline(); + // autoconf: add get/set expires if missing (pre 2.6.28-rc1) + s.op->newline() << "#ifndef STAPCONF_HRTIMER_GETSET_EXPIRES"; + s.op->newline() << "#define hrtimer_get_expires(timer) ((timer)->expires)"; + s.op->newline() << "#define hrtimer_set_expires(timer, time) (void)((timer)->expires = (time))"; + s.op->newline() << "#endif"; + // autoconf: adapt to HRTIMER_REL -> HRTIMER_MODE_REL renaming near 2.6.21 s.op->newline() << "#ifdef STAPCONF_HRTIMER_REL"; s.op->newline() << "#define HRTIMER_MODE_REL HRTIMER_REL"; @@ -8538,9 +8544,9 @@ hrtimer_derived_probe_group::emit_module s.op->newline() << "if ((atomic_read (&session_state) == STAP_SESSION_STARTING) ||"; s.op->newline() << " (atomic_read (&session_state) == STAP_SESSION_RUNNING)) {"; // Compute next trigger time - s.op->newline(1) << "timer->expires = ktime_add (timer->expires,"; + s.op->newline(1) << "hrtimer_set_expires(timer, ktime_add (hrtimer_get_expires(timer),"; emit_interval (s.op); - s.op->line() << ");"; + s.op->line() << "));"; s.op->newline() << "rc = HRTIMER_RESTART;"; s.op->newline(-1) << "}"; s.op->newline() << "{"; --- runtime/autoconf-hrtimer-getset-expires.c-dist 2008-12-16 13:33:46.000000000 +0100 +++ runtime/autoconf-hrtimer-getset-expires.c 2008-12-16 13:33:59.000000000 +0100 @@ -0,0 +1,6 @@ +#include + +void ____autoconf_func(struct hrtimer *t) +{ + hrtimer_set_expires(t, hrtimer_get_expires(t)); +} --- runtime/runtime.h-dist 2008-12-16 12:44:39.000000000 +0100 +++ runtime/runtime.h 2008-12-16 12:44:52.000000000 +0100 @@ -39,6 +39,11 @@ #define STP_OLD_TRANSPORT #endif +/* HACK for 2.6.28 */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27) +#undef for_each_cpu +#endif + #ifndef for_each_cpu #define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) #endif --- buildrun.cxx-dist 2008-12-16 13:33:08.000000000 +0100 +++ buildrun.cxx 2008-12-16 13:33:24.000000000 +0100 @@ -100,6 +100,7 @@ compile_pass (systemtap_session& s) o << module_cflags << " += -Iinclude2/asm/mach-default" << endl; o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-hrtimer-rel.c, -DSTAPCONF_HRTIMER_REL,)" << endl; + o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-hrtimer-getset-expires.c, -DSTAPCONF_HRTIMER_GETSET_EXPIRES,)" << endl; o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-inode-private.c, -DSTAPCONF_INODE_PRIVATE,)" << endl; o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-constant-tsc.c, -DSTAPCONF_CONSTANT_TSC,)" << endl; o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-tsc-khz.c, -DSTAPCONF_TSC_KHZ,)" << endl;