All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gregory M. Turner" <gmt@be-evil.net>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org, "Gregory M. Turner" <gmt@be-evil.net>
Subject: [PATCH v2(sorta) 1/2] bluetooth: Add BT_{INFO,ERR,DBG}_RATELIMITED
Date: Mon, 23 Feb 2015 22:25:40 -0800	[thread overview]
Message-ID: <1424759141-17889-2-git-send-email-gmt@be-evil.net> (raw)
In-Reply-To: <1424759141-17889-1-git-send-email-gmt@be-evil.net>

Add ratelimited versions of the BT_{INFO,ERR,DBG} printk macros.

The assymetry with the existing _INFO and _ERR macros is because,
afaics, those are special-cased as an object-file-size optimization.
Duplicating that for the _RATELIMITED versions would clearly be a
deoptimization until they got a few more consumers (currently only a
single consumer is planned).

Signed-off-by: Gregory M. Turner <gmt@be-evil.net>
---
 include/net/bluetooth/bluetooth.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index e00455a..ec321f9 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -124,9 +124,12 @@ void bt_info(const char *fmt, ...);
 __printf(1, 2)
 void bt_err(const char *fmt, ...);
 
-#define BT_INFO(fmt, ...)	bt_info(fmt "\n", ##__VA_ARGS__)
-#define BT_ERR(fmt, ...)	bt_err(fmt "\n", ##__VA_ARGS__)
-#define BT_DBG(fmt, ...)	pr_debug(fmt "\n", ##__VA_ARGS__)
+#define BT_INFO(fmt, ...)		bt_info(fmt "\n", ##__VA_ARGS__)
+#define BT_INFO_RATELIMITED(fmt, ...)	pr_info_ratelimited(fmt "\n", ##__VA_ARGS__)
+#define BT_ERR(fmt, ...)		bt_err(fmt "\n", ##__VA_ARGS__)
+#define BT_ERR_RATELIMITED(fmt, ...)	pr_err_ratelimited(fmt "\n", ##__VA_ARGS__)
+#define BT_DBG(fmt, ...)		pr_debug(fmt "\n", ##__VA_ARGS__)
+#define BT_DBG_RATELIMITED(fmt, ...)	pr_debug_ratelimited(fmt "\n", ##__VA_ARGS__)
 
 /* Connection and socket states */
 enum {
-- 
2.3.0

  reply	other threads:[~2015-02-24  6:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24  6:25 [PATCH v2(sorta)] Unexpected-continuation-frame-printk flood avoidance Gregory M. Turner
2015-02-24  6:25 ` Gregory M. Turner [this message]
2015-03-03  1:07   ` [PATCH v2(sorta) 1/2] bluetooth: Add BT_{INFO,ERR,DBG}_RATELIMITED Marcel Holtmann
2015-03-14 19:01     ` Greg Turner
2015-03-19 18:54   ` [PATCH v3 1/1] bluetooth: l2cap_core: ratelimit continuation frame printk gmt
2015-02-24  6:25 ` [PATCH v2(sorta) 2/2] " Gregory M. Turner

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=1424759141-17889-2-git-send-email-gmt@be-evil.net \
    --to=gmt@be-evil.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.