tracing: Restore custom event creation selector
PATCH 1/1 tracing: Restore custom event creation selector
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.
--- include/trace/define_custom_trace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/trace/define_custom_trace.h +2 -2
@@ -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
Signature · 1 line
2.43.0
[email protected]
AI reviewThank 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 --
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 <[email protected]>
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.
include/trace/define_custom_trace.h line 77
Quoted 13 lines
include/trace/define_custom_trace.h +2
-2@@ -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.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1