mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
tracing/remotes: Add REMOTE_EVENT_CUSTOM_PRINTK() helper
The current REMOTE_EVENT() takes as a __printk argument a string format
and a list of arguments, such as RE_PRINTK("foo=%d bar=%d", foo, bar).
Add a REMOTE_EVENT_CUSTOM_PRINTK() where the __printk argument can be a
function. This intends to support the creation of a "printk" event for
the arm64 nVHE/pKVM hypervisor with a dynamic prototype and by extension
a dynamic print format.
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Link: https://patch.msgid.link/20261001143000.3371786-4-vdonnefort@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
This commit is contained in:
parent
955feee93e
commit
604aaeb395
|
|
@ -35,17 +35,26 @@ do { \
|
|||
|
||||
#define RE_PRINTK(__args...) __args
|
||||
|
||||
#define REMOTE_EVENT(__name, __id, __struct, __printk) \
|
||||
REMOTE_EVENT_FORMAT(__name, __struct); \
|
||||
#define REMOTE_EVENT_PRINT_FUNC(__name, __printk) \
|
||||
static void remote_event_print_##__name(void *evt, struct trace_seq *seq) \
|
||||
{ \
|
||||
struct remote_event_format_##__name __maybe_unused *__entry = evt; \
|
||||
trace_seq_puts(seq, #__name); \
|
||||
remote_printk(__printk); \
|
||||
__printk; \
|
||||
}
|
||||
|
||||
#define REMOTE_EVENT(__name, __id, __struct, __printk) \
|
||||
REMOTE_EVENT_FORMAT(__name, __struct); \
|
||||
REMOTE_EVENT_PRINT_FUNC(__name, remote_printk(__printk))
|
||||
|
||||
#define REMOTE_EVENT_CUSTOM_PRINTK(__name, __id, __struct, __printk) \
|
||||
REMOTE_EVENT_FORMAT(__name, __struct); \
|
||||
REMOTE_EVENT_PRINT_FUNC(__name, __printk)
|
||||
|
||||
#include REMOTE_EVENT_INCLUDE(REMOTE_EVENT_INCLUDE_FILE)
|
||||
|
||||
#undef REMOTE_EVENT
|
||||
#undef REMOTE_EVENT_CUSTOM_PRINTK
|
||||
#undef RE_PRINTK
|
||||
#undef re_field
|
||||
#define re_field(__type, __field) \
|
||||
|
|
@ -70,4 +79,8 @@ do { \
|
|||
.print_fmt = remote_event_print_fmt_##__name, \
|
||||
.print = remote_event_print_##__name, \
|
||||
}
|
||||
|
||||
#define REMOTE_EVENT_CUSTOM_PRINTK(__name, __id, __struct, __printk) \
|
||||
REMOTE_EVENT(__name, __id, RE_STRUCT(__struct), "\"Unknown\"")
|
||||
|
||||
#include REMOTE_EVENT_INCLUDE(REMOTE_EVENT_INCLUDE_FILE)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user