summaryrefslogtreecommitdiff
path: root/include/linux/netpoll.h
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2025-06-13 04:31:31 -0700
committerJakub Kicinski <kuba@kernel.org>2025-06-16 15:18:33 -0700
commitafb023329c07af7a9144901a1dad3a80d9e177b1 (patch)
tree2f846b2db82cedcd87ce7fc9c9b9268f43e1bbd7 /include/linux/netpoll.h
parent260948993a9f99428f801dcb40654205e74aaa47 (diff)
netpoll: expose netpoll logging macros in public header
Move np_info(), np_err(), and np_notice() macros from internal implementation to the public netpoll header file to make them available for use by netpoll consumers. These logging macros provide consistent formatting for netpoll-related messages by automatically prefixing log output with the netpoll instance name. The goal is to use the exact same format that is being displayed today, instead of creating something netconsole-specific. Signed-off-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20250613-rework-v3-2-0752bf2e6912@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r--include/linux/netpoll.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index a637e5115254..72086b8a3dec 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -42,6 +42,13 @@ struct netpoll {
struct work_struct refill_wq;
};
+#define np_info(np, fmt, ...) \
+ pr_info("%s: " fmt, np->name, ##__VA_ARGS__)
+#define np_err(np, fmt, ...) \
+ pr_err("%s: " fmt, np->name, ##__VA_ARGS__)
+#define np_notice(np, fmt, ...) \
+ pr_notice("%s: " fmt, np->name, ##__VA_ARGS__)
+
struct netpoll_info {
refcount_t refcnt;