Re: Not to suppress NET kernel messages

From: Randy.Dunlap
Date: Sat Aug 21 2004 - 21:22:23 EST


On Sun, 22 Aug 2004 05:10:36 +0200 Josan Kadett wrote:

| I think the messages are rate limited by some code in network subsytem that
| disallows a message from being sent to console for more than once. I am
| trying to add some source debugging functions with printk, and I just wish
| to disable this protection.

Yes, net/core/utils.c, net_ratelimit() function is used to determine
if messages should be printed or suppressed. It returns 1 if the
message should be printed, 0 to suppress a message. Usage is like this:

if (net_ratelimit()) /* print if non-0 */
printk(KERN_DEBUG "printing some message\n");

If you want to print all messages (!) and you aren't worried about
DoS or overflowing logs etc., just change the net_ratelimit() function
to return 1 always... and stand back. Warning, caveat emptor, user beware,
etc. Void where prohibited.

--
~Randy
-
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/