linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] tracing: Allow tracer to add more than 32 options
Date: Sat, 18 Oct 2025 00:50:05 +0900	[thread overview]
Message-ID: <20251018005005.70d998dba256cd57a125d4c9@kernel.org> (raw)
In-Reply-To: <20251015172020.5966beaf@gandalf.local.home>

On Wed, 15 Oct 2025 17:20:20 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Tue, 30 Sep 2025 07:34:53 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> 
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -86,6 +86,11 @@ void __init disable_tracing_selftest(const char *reason)
> >  #define tracing_selftest_disabled	0
> >  #endif
> >  
> > +/* Define TRACE_ITER_* flags. */
> > +#undef C
> > +#define C(a, b) const u64 TRACE_ITER_##a = (1ULL << TRACE_ITER_##a##_BIT);
> > +TRACE_FLAGS
> > +
> 
> 
> 
> >  #undef C
> > -#define C(a, b) TRACE_ITER_##a = (1 << TRACE_ITER_##a##_BIT)
> > +#define C(a, b) extern const u64 TRACE_ITER_##a;
> >  
> > -enum trace_iterator_flags { TRACE_FLAGS };
> > +TRACE_FLAGS
> > +#undef C
> 
> Why all this work when this could have been simply fixed with a:
> 
> -enum trace_iterator_flags { TRACE_FLAGS };
> +enum64 trace_iterator_flags { TRACE_FLAGS };

With enum64, clang 18 caused this error.

In file included from /home/mhiramat/ksrc/linux/kernel/trace/ring_buffer.c:36:
/home/mhiramat/ksrc/linux/kernel/trace/trace.h:1427:1: error: unknown type name 'enum64'; did you mean 'enum'?
 1427 | enum64 trace_iterator_flags { TRACE_FLAGS };
      | ^~~~~~
      | enum

But below (C++11/C23 or clang/gcc extension) passed.

-enum trace_iterator_flags { TRACE_FLAGS };
+enum trace_iterator_flags : uint64_t { TRACE_FLAGS };


So let's use this.

Thanks,


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  parent reply	other threads:[~2025-10-17 15:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 22:34 [PATCH v3 0/2] tracing: Add an option to show symbols in _text+offset for function profiler Masami Hiramatsu (Google)
2025-09-29 22:34 ` [PATCH v3 1/2] tracing: Allow tracer to add more than 32 options Masami Hiramatsu (Google)
2025-10-15 21:20   ` Steven Rostedt
2025-10-17 15:01     ` Masami Hiramatsu
2025-10-19 17:46       ` Steven Rostedt
2025-10-17 15:50     ` Masami Hiramatsu [this message]
2025-09-29 22:35 ` [PATCH v3 2/2] tracing: Add an option to show symbols in _text+offset for function profiler Masami Hiramatsu (Google)

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=20251018005005.70d998dba256cd57a125d4c9@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --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;
as well as URLs for NNTP newsgroup(s).