[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251015172020.5966beaf@gandalf.local.home>
Date: Wed, 15 Oct 2025 17:20:20 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] tracing: Allow tracer to add more than 32
options
On Tue, 30 Sep 2025 07:34:53 +0900
"Masami Hiramatsu (Google)" <mhiramat@...nel.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 };
?
Not to mention, using const u64 requires saving these numbers in an address
and referencing them, instead of doing it inlined in text. That is, using
u64 instead of enum64 is both slower and wastes more memory.
-- Steve
Powered by blists - more mailing lists