mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] tracing: Fix DECLARE_TRACE_CONDITION
Date: Tue, 28 Jan 2025 12:30:47 +0100	[thread overview]
Message-ID: <2660636b8e9d14f905b161cdf499082952bd2030.camel@redhat.com> (raw)
In-Reply-To: <20250128111926.303093-1-gmonaco@redhat.com>

On Tue, 2025-01-28 at 12:19 +0100, Gabriele Monaco wrote:
> Commit 287050d39026 ("tracing: Add TRACE_EVENT_CONDITIONAL()") adds
> macros to define conditional trace events (TRACE_EVENT_CONDITIONAL)
> and
> tracepoints (DECLARE_TRACE_CONDITION), but sets up functionality for
> direct use only for the former.
> Any attempt to use DECLARE_TRACE_CONDITION fails the build.
> 
> Add preprocessor bits in define_trace.h to allow usage of
> DECLARE_TRACE_CONDITION just like DECLARE_TRACE.
> 
> Fixes: 287050d39026 ("tracing: Add TRACE_EVENT_CONDITIONAL()")
> Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
> ---

The macro is currently never used, I'm planning to use it in a future
patch.
Likewise also DECLARE_TRACE_SYSCALL is never used and would fail the
build if used. I'm not sure if the macro would be of use in this way,
since it's missing the reg and unreg parameters used in
DEFINE_TRACE_SYSCALL, one way not to fail the build is to treat it just like
DECLARE_TRACE (as DECLARE_TRACE_CONDITION).
I can prepare this as a patch if it's the intended behaviour:

diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index ed52d0506c69..497a5a2469dc 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -80,6 +80,10 @@
 #define DECLARE_TRACE_CONDITION(name, proto, args, cond)	\
 	DEFINE_TRACE(name, PARAMS(proto), PARAMS(args))
 
+#undef DECLARE_TRACE_SYSCALL
+#define DECLARE_TRACE_SYSCALL(name, proto, args, cond)	\
+	DEFINE_TRACE(name, PARAMS(proto), PARAMS(args))
+
 /* If requested, create helpers for calling these tracepoints from Rust. */
 #ifdef CREATE_RUST_TRACE_POINTS
 #undef DEFINE_RUST_DO_TRACE
@@ -114,6 +118,8 @@
 #define DECLARE_TRACE(name, proto, args)
 #undef DECLARE_TRACE_CONDITION
 #define DECLARE_TRACE_CONDITION(name, proto, args, cond)
+#undef DECLARE_TRACE_SYSCALL
+#define DECLARE_TRACE_SYSCALL(name, proto, args, cond)
 
 #ifdef TRACEPOINTS_ENABLED
 #include <trace/trace_events.h>
@@ -136,6 +142,7 @@
 #undef TRACE_HEADER_MULTI_READ
 #undef DECLARE_TRACE
 #undef DECLARE_TRACE_CONDITION
+#undef DECLARE_TRACE_SYSCALL
 
 /* Only undef what we defined in this file */
 #ifdef UNDEF_TRACE_INCLUDE_FILE


  reply	other threads:[~2025-01-28 11:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 11:19 Gabriele Monaco
2025-01-28 11:30 ` Gabriele Monaco [this message]
2025-01-29  1:01 ` Masami Hiramatsu

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=2660636b8e9d14f905b161cdf499082952bd2030.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®