@@ -37,6 +37,15 @@ __printf(3, 4) __cold
void durable_name_printk(const char *level, const struct device *dev,
const char *fmt, ...);
+#define durable_name_printk_ratelimited(level, dev, fmt, ...) \
+do { \
+ static DEFINE_RATELIMIT_STATE(_rs, \
+ DEFAULT_RATELIMIT_INTERVAL, \
+ DEFAULT_RATELIMIT_BURST); \
+ if (__ratelimit(&_rs)) \
+ durable_name_printk(level, dev, fmt, ##__VA_ARGS__); \
+} while (0)
+
__printf(2, 3) __cold
void _dev_emerg(const struct device *dev, const char *fmt, ...);
__printf(2, 3) __cold
Create a rate limited macro for durable_name_printk so that we can use this for printk_ratelimited usage in the block layers and add the durable name key/value to the log message. Signed-off-by: Tony Asleson <tasleson@redhat.com> --- include/linux/dev_printk.h | 9 +++++++++ 1 file changed, 9 insertions(+)