All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vincent Donnefort" <vdonnefort@google.com>
Cc: "Oliver Upton" <oupton@kernel.org>,
	kvmarm@lists.linux.dev, "Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH v3 3/4] tracing/remotes: Add REMOTE_EVENT_CUSTOM_PRINTK() helper
Date: Wed, 30 Sep 2026 15:44:16 +0000	[thread overview]
Message-ID: <20260930154416.C7CC21F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260930153505.2144559-4-vdonnefort@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] tracing/remotes: invalid unquoted print fmt string breaks libtraceevent
--

commit c1fe85ccb9998d0f07df828f87f45a8f874da608
Author: Vincent Donnefort <vdonnefort@google.com>

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. 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.

> diff --git a/include/trace/define_remote_events.h b/include/trace/define_remote_events.h
> index 676e803dc144d..4f4d58e37b84b 100644
> --- a/include/trace/define_remote_events.h
> +++ b/include/trace/define_remote_events.h

[ ... ]

> @@ -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")

[Severity: Medium]
Does this unquoted print fmt string break libtraceevent parsing?

This macro assigns the literal "Unknown" directly to the event's print_fmt
field. The tracefs format file outputs this field directly, which results in
print fmt: Unknown instead of the expected print fmt: "Unknown".

The standard libtraceevent parser expects the format string to be enclosed
in double quotes. Encountering an unquoted string causes it to be misparsed
as a field variable (which does not exist) rather than a literal string,
preventing userspace tools like perf and trace-cmd from parsing the event
format correctly.

Should this be escaped as "\"Unknown\"" to preserve UAPI formatting
expectations?

> +
>  #include REMOTE_EVENT_INCLUDE(REMOTE_EVENT_INCLUDE_FILE)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260930153505.2144559-1-vdonnefort@google.com?part=3

  reply	other threads:[~2026-09-30 15:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 15:35 [PATCH v3 0/4] trace_hyp_printk() for pKVM/nVHE hypervisor Vincent Donnefort
2026-09-30 15:35 ` [PATCH v3 1/4] KVM: arm64: Allow early calls to pKVM host_share/unshare_hyp Vincent Donnefort
2026-09-30 15:35 ` [PATCH v3 2/4] KVM: arm64: Move kvm_define_hypevents.h to arch/arm64/kvm/ Vincent Donnefort
2026-09-30 15:35 ` [PATCH v3 3/4] tracing/remotes: Add REMOTE_EVENT_CUSTOM_PRINTK() helper Vincent Donnefort
2026-09-30 15:44   ` sashiko-bot [this message]
2026-09-30 15:35 ` [PATCH v3 4/4] KVM: arm64: Add hyp_printk event to nVHE/pKVM hyp Vincent Donnefort
2026-09-30 15:56   ` sashiko-bot
2026-10-01  7:05     ` Vincent Donnefort

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=20260930154416.C7CC21F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vdonnefort@google.com \
    /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.