timer: Print function name for timer callbacks modifying preemption count
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 11 Mar 2010 22:04:46 +0000 (14:04 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 12 Mar 2010 21:40:42 +0000 (22:40 +0100)
A function scheduled with a timer must not exit with a different
preempt count than it was entered. To make helping users running into
the corresponding BUG() easier also print the name of the bad function
not only its address.

[ tglx: Sanitized printk ]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: johnstul@us.ibm.com
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/timer.c

index c61a7949387f93e69b1a4979eff1a03c7e7131b4..f82f4bfe2d882dfdeb18891e0d01b361d0eedb61 100644 (file)
@@ -1027,11 +1027,8 @@ static inline void __run_timers(struct tvec_base *base)
                                lock_map_release(&lockdep_map);
 
                                if (preempt_count != preempt_count()) {
-                                       printk(KERN_ERR "huh, entered %p "
-                                              "with preempt_count %08x, exited"
-                                              " with %08x?\n",
-                                              fn, preempt_count,
-                                              preempt_count());
+                                       printk(KERN_ERR "timer: %pF preempt leak: %08x -> %08x\n",
+                                              fn, preempt_count, preempt_count());
                                        BUG();
                                }
                        }