register_timer_hook fails on realtime kernel withCONFIG_PROFILE_NMI

From: John Kacur
Date: Sun Aug 06 2006 - 02:03:03 EST

I wrote a "Very Simple Timer Notification Module", which calls
register_timer_hook to register a function to be called using the timer
interrupt. This is essentially what OProfile would do in timer interrupt
mode. The standard kernel allows you to do this even if
CONFIG_PROFILE_NMI is defined but the realtime kernel does not. With the
realtime kernel register_timer_hook succeeds but the timer hooks is
never called. From patch-2.6.17-rt8 the following modifies
+#define CLOCK_CAP_PROFILE 0x000008
+#define CLOCK_CAP_PROFILE 0x000000

So, it's simple enough to work around, by just making CLOCK_CAP_PROFILE
0x000008 regardless of whether CONFIG_PROFILE_NMI is defined or not, but
I would like to understand the intention of the authors here. Is there a
good reason to disallow the timer interrupt mode of profiling if
CONFIG_PROFILE_NMI is defined? (other than arguing that NMI profiling is

I have included vstnm.tar.bz2 in case it is of any help examinig the
problem. Just do:
tar xjf vstnm.tar.bz2
cd vstnm
make install
then use the script load_vstnm to load the module and unload_vstnm to
unload the module. If the timer_tick function is called it will print a
rate limited message to the console that it was called.

Thank you

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at