ratelimit: Make suppressed output messages more useful
authorChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 23 Oct 2009 12:58:11 +0000 (14:58 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 23 Oct 2009 15:26:37 +0000 (17:26 +0200)
commit5c828713358cb9df8aa174371edcbbb62203a490
treec8aeafba911cb428b5dc46a9e252c337b7c51d17
parent3fff4c42bd0a89869a0eb1e7874cc06ffa4aa0f5
ratelimit: Make suppressed output messages more useful

Today I got:

  [39648.224782] Registered led device: iwl-phy0::TX
  [40676.545099] __ratelimit: 246 callbacks suppressed
  [40676.545103] abcdef[23675]: segfault at 0 ...

as you can see the ratelimit message contains a function prefix.
Since this is always __ratelimit, this wont help much.

This patch changes __ratelimit and printk_ratelimit to print the
function name that calls ratelimit.

This will pinpoint the responsible function, as long as not several
different places call ratelimit with the same ratelimit state at
the same time. In that case we catch only one random function that
calls ratelimit after the wait period.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Dave Young <hidave.darkstar@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
CC: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <200910231458.11832.borntraeger@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/kernel.h
include/linux/ratelimit.h
kernel/printk.c
lib/ratelimit.c