[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220516225640.3102269-14-jim.cromie@gmail.com>
Date: Mon, 16 May 2022 16:56:26 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org
Cc: gregkh@...uxfoundation.org, daniel.vetter@...ll.ch,
seanpaul@...omium.org, robdclark@...il.com, rostedt@...dmis.org,
mathieu.desnoyers@...icios.com, quic_saipraka@...cinc.com,
will@...nel.org, catalin.marinas@....com,
quic_psodagud@...cinc.com, maz@...nel.org, arnd@...db.de,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, mingo@...hat.com,
jim.cromie@...il.com
Subject: [PATCH v2 13/27] dyndbg: add __pr_debug_cls(class, fmt, ...)
For selftest purposes, add __pr_debug_cls(class, fmt, ...)
I didn't think we'd need to define this, since DRM effectively has it
already. But test_dynamic_debug needs it in order to demonstrate all
the moving parts.
Note the __ prefix; its not intended for general use, and doesn't
include any builtin-constant checks that could pertain. I'd prefer to
see a use-case where copying the drm.debug model isn't better.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
include/linux/dynamic_debug.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index e9e6d0f503f3..abf43e28d8d3 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -216,6 +216,10 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
_DPRINTK_CLASS_DFLT, \
fmt, func, ##__VA_ARGS__)
+#define dynamic_pr_debug_cls(cls, fmt, ...) \
+ _dynamic_func_call_cls(cls, fmt, __dynamic_pr_debug, \
+ pr_fmt(fmt), ##__VA_ARGS__)
+
#define dynamic_pr_debug(fmt, ...) \
_dynamic_func_call(fmt, __dynamic_pr_debug, \
pr_fmt(fmt), ##__VA_ARGS__)
@@ -246,6 +250,9 @@ struct kernel_param;
int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp);
int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp);
+#define __pr_debug_cls(cls, fmt, ...) \
+ dynamic_pr_debug_cls(cls, fmt, ##__VA_ARGS__)
+
#else /* !CONFIG_DYNAMIC_DEBUG_CORE */
#include <linux/string.h>
--
2.35.3
Powered by blists - more mailing lists