All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing: Restore custom event creation selector
@ 2026-11-20 12:28 Avi Weiss
  2026-11-20 12:37 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Avi Weiss @ 2026-11-20 12:28 UTC (permalink / raw)
  To: rostedt, mhiramat
  Cc: mathieu.desnoyers, linux-trace-kernel, linux-kernel, Avi Weiss

The custom event generator undefines CREATE_CUSTOM_TRACE_EVENTS to avoid
recursion, but restores a different macro - CREATE_CUSTOM_TRACE_POINTS
when processing is complete. A second custom event header included under
the same selector is then skipped, leaving its generated update helper
undefined.

Likely a simple copy-paste error.

Restore CREATE_CUSTOM_TRACE_EVENTS after processing so subsequent custom
event headers can generate their definitions.

Fixes: 3a73333fb370f ("tracing: Add TRACE_CUSTOM_EVENT() macro")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 include/trace/define_custom_trace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/trace/define_custom_trace.h b/include/trace/define_custom_trace.h
index 5827a4c92c744..177c628f2d567 100644
--- a/include/trace/define_custom_trace.h
+++ b/include/trace/define_custom_trace.h
@@ -72,6 +72,6 @@
 #endif
 
 /* We may be processing more files */
-#define CREATE_CUSTOM_TRACE_POINTS
+#define CREATE_CUSTOM_TRACE_EVENTS
 
-#endif /* CREATE_CUSTOM_TRACE_POINTS */
+#endif /* CREATE_CUSTOM_TRACE_EVENTS */

base-commit: 65e4fd942f72a9dba0e4e257290c4fa1aa756854
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tracing: Restore custom event creation selector
  2026-11-20 12:28 [PATCH] tracing: Restore custom event creation selector Avi Weiss
@ 2026-11-20 12:37 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-20 12:37 UTC (permalink / raw)
  To: Avi Weiss; +Cc: linux-trace-kernel

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] tracing: duplicate str__custom__trace_system_name on second
  custom header
--

commit e451694c0169b91ce25bbac13cc9b1321c4dd71b
Author: Avi Weiss <thnkslprpt@gmail.com>

tracing: Restore custom event creation selector

This commit restores CREATE_CUSTOM_TRACE_EVENTS instead of
CREATE_CUSTOM_TRACE_POINTS at the end of include/trace/define_custom_trace.h
so subsequent custom event headers in the same translation unit are not
skipped.

> diff --git a/include/trace/define_custom_trace.h b/include/trace/define_custom_trace.h
> index 5827a4c92c744..177c628f2d567 100644
> --- a/include/trace/define_custom_trace.h
> +++ b/include/trace/define_custom_trace.h
> @@ -72,6 +72,6 @@
>  #endif
>  
>  /* We may be processing more files */
> -#define CREATE_CUSTOM_TRACE_POINTS
> +#define CREATE_CUSTOM_TRACE_EVENTS
>  
> -#endif /* CREATE_CUSTOM_TRACE_POINTS */
> +#endif /* CREATE_CUSTOM_TRACE_EVENTS */

[Severity: Medium]
Does including a second custom event header under CREATE_CUSTOM_TRACE_EVENTS
now fail to compile with a redefinition of str__custom__trace_system_name?

Each inclusion of include/trace/define_custom_trace.h includes
include/trace/trace_custom_events.h, which sets TRACE_SYSTEM to custom and
includes include/trace/stages/init.h:

include/trace/trace_custom_events.h:
#undef TRACE_SYSTEM
#define TRACE_SYSTEM custom

#ifndef TRACE_SYSTEM_VAR
#define TRACE_SYSTEM_VAR TRACE_SYSTEM
#endif

/* The init stage creates the system string and enum mappings */

#include "stages/init.h"

include/trace/stages/init.h then invokes TRACE_MAKE_SYSTEM_STR() to emit
static const char str__custom__trace_system_name[] = "custom"; on every
pass, because all custom event headers share the custom TRACE_SYSTEM and
the definition is not guarded against multiple inclusions in the same
translation unit.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120122837.1597798-2-thnkslprpt@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-20 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 12:28 [PATCH] tracing: Restore custom event creation selector Avi Weiss
2026-11-20 12:37 ` sashiko-bot

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.