[PATCH] timer: print function name for timer callbacks modifying preemption count

From: Uwe Kleine-KÃnig
Date: Tue Feb 16 2010 - 10:43:51 EST


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.

Signed-off-by: Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx>
---
kernel/timer.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index c61a794..ef9a4db 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1027,10 +1027,10 @@ 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 "
+ printk(KERN_ERR "huh, entered %p (%pF)"
"with preempt_count %08x, exited"
" with %08x?\n",
- fn, preempt_count,
+ fn, fn, preempt_count,
preempt_count());
BUG();
}
--
1.6.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/