aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2009-10-23 08:58:11 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-23 11:26:37 -0400
commit5c828713358cb9df8aa174371edcbbb62203a490 (patch)
treec8aeafba911cb428b5dc46a9e252c337b7c51d17 /kernel/printk.c
parent3fff4c42bd0a89869a0eb1e7874cc06ffa4aa0f5 (diff)
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>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index b997c893cdcf..8283dbe15af4 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1364,11 +1364,11 @@ late_initcall(disable_boot_consoles);
1364 */ 1364 */
1365DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10); 1365DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);
1366 1366
1367int printk_ratelimit(void) 1367int __printk_ratelimit(const char *func)
1368{ 1368{
1369 return __ratelimit(&printk_ratelimit_state); 1369 return ___ratelimit(&printk_ratelimit_state, func);
1370} 1370}
1371EXPORT_SYMBOL(printk_ratelimit); 1371EXPORT_SYMBOL(__printk_ratelimit);
1372 1372
1373/** 1373/**
1374 * printk_timed_ratelimit - caller-controlled printk ratelimiting 1374 * printk_timed_ratelimit - caller-controlled printk ratelimiting