Skip to content

Commit

Permalink
timer: Print function name for timer callbacks modifying preemption c…
Browse files Browse the repository at this point in the history
…ount

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>
  • Loading branch information
Uwe Kleine-König authored and Thomas Gleixner committed Mar 12, 2010
1 parent 64ce4c2 commit 06f71b9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 06f71b9

Please sign in to comment.