From: Rich Johnston <rjohnston@sgi.com>
To: xfs@oss.sgi.com
Cc: bpm@sgi.com, elder@kernel.org,
Raghavendra D Prabhu <rprabhu@wnohang.net>
Subject: [v3 Repost] xfs: Add ratelimited printk for different alert levels
Date: Wed, 27 Mar 2013 09:26:49 -0500 [thread overview]
Message-ID: <515339F7.8000505@sgi.com> (raw)
In-Reply-To: <ca71153845539b0c76ba3e3aab9611ad6c5cf72b.1348641483.git.rprabhu@wnohang.net>
Ratelimited printk will be useful in printing xfs messages which are otherwise
not required to be printed always due to their high rate (to prevent kernel ring
buffer from overflowing), while at the same time required to be printed.
Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
---
Sorry this has not been committed and it's been a few months so I am
reposting this patch. If I don't hear any objections by 10 am CST on
29 March 2013 I will commit this patch.
fs/xfs/xfs_linux.h | 1 +
fs/xfs/xfs_message.h | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+)
Index: linux/fs/xfs/xfs_linux.h
===================================================================
--- linux.orig/fs/xfs/xfs_linux.h 2013-03-22 09:19:54.000000000 -0500
+++ linux/fs/xfs/xfs_linux.h 2013-03-27 12:55:33.000000000 -0500
@@ -72,6 +72,7 @@
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/list_sort.h>
+#include <linux/ratelimit.h>
#include <asm/page.h>
#include <asm/div64.h>
Index: linux/fs/xfs/xfs_message.h
===================================================================
--- linux.orig/fs/xfs/xfs_message.h 2013-03-22 09:19:54.000000000 -0500
+++ linux/fs/xfs/xfs_message.h 2013-03-27 12:55:33.000000000 -0500
@@ -30,6 +30,32 @@
}
#endif
+#define xfs_printk_ratelimited(func, dev, fmt, ...) \
+do { \
+ static DEFINE_RATELIMIT_STATE(_rs, \
+ DEFAULT_RATELIMIT_INTERVAL, \
+ DEFAULT_RATELIMIT_BURST); \
+ if (__ratelimit(&_rs)) \
+ func(dev, fmt, ##__VA_ARGS__); \
+} while (0)
+
+#define xfs_emerg_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_emerg, dev, fmt, ##__VA_ARGS__)
+#define xfs_alert_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_alert, dev, fmt, ##__VA_ARGS__)
+#define xfs_crit_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_crit, dev, fmt, ##__VA_ARGS__)
+#define xfs_err_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_err, dev, fmt, ##__VA_ARGS__)
+#define xfs_warn_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_warn, dev, fmt, ##__VA_ARGS__)
+#define xfs_notice_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_notice, dev, fmt, ##__VA_ARGS__)
+#define xfs_info_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_info, dev, fmt, ##__VA_ARGS__)
+#define xfs_debug_ratelimited(dev, fmt, ...) \
+ xfs_printk_ratelimited(xfs_debug, dev, fmt, ##__VA_ARGS__)
+
extern void assfail(char *expr, char *f, int l);
extern void xfs_hex_dump(void *p, int length);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-03-27 18:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-26 6:56 [PATCH v3 0/3] Print when ENOSPC due to lack of inodes raghu.prabhu13
[not found] ` <cover.1348641483.git.rprabhu@wnohang.net>
2012-09-26 6:56 ` [PATCH v3 1/3] xfs: Add ratelimited printk for different alert levels raghu.prabhu13
2012-09-26 6:56 ` [v3 Repost] " Raghavendra D Prabhu
2012-10-26 13:15 ` [v3,1/3] " Rich Johnston
2012-10-28 22:05 ` [PATCH v3 1/3] " Dave Chinner
2013-03-27 14:26 ` Rich Johnston [this message]
2013-04-05 18:32 ` [v3 Repost] " Ben Myers
2012-09-26 6:56 ` [PATCH v3 2/3] xfs: Print error when xfs_ialloc_ag_select fails to find continuous free space raghu.prabhu13
2012-10-26 13:15 ` [v3, " Rich Johnston
2012-10-28 22:10 ` [PATCH v3 " Dave Chinner
2012-09-26 6:56 ` [PATCH v3 3/3] xfs: Print error when unable to allocate inodes or out of free inodes raghu.prabhu13
2012-10-26 13:15 ` [v3, " Rich Johnston
2012-10-28 23:21 ` [PATCH v3 " Dave Chinner
2012-10-24 20:56 ` [PATCH v3 0/3] Print when ENOSPC due to lack of inodes Raghavendra Prabhu
2012-10-25 15:23 ` Rich Johnston
2012-10-26 13:18 ` Rich Johnston
2012-10-28 22:05 ` Dave Chinner
2012-10-30 14:59 ` Ben Myers
2012-11-28 2:52 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=515339F7.8000505@sgi.com \
--to=rjohnston@sgi.com \
--cc=bpm@sgi.com \
--cc=elder@kernel.org \
--cc=rprabhu@wnohang.net \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox