Skip to content

Commit faf9381

Browse files
committed
tracepoint: Do not warn for unused event that is exported
There are a few generic events that may only be used by modules. They are defined and then set with EXPORT_TRACEPOINT*(). Mark events that are exported as being used, even though they still waste memory in the kernel proper. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nicolas Schier <nicolas.schier@linux.dev> Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/20251022004453.089254920@kernel.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent e30f8e6 commit faf9381

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

include/linux/tracepoint.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
227227
* defined tracepoints are used. It is discarded after the build.
228228
*/
229229
# define TRACEPOINT_CHECK(name) \
230-
static const char __used __section("__tracepoint_check") __trace_check[] = \
231-
#name;
230+
static const char __used __section("__tracepoint_check") \
231+
__trace_check_##name[] = #name;
232232

233233
/*
234234
* Make sure the alignment of the structure in the __tracepoints section will
@@ -382,10 +382,12 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
382382
__DEFINE_TRACE_EXT(_name, NULL, PARAMS(_proto), PARAMS(_args));
383383

384384
#define EXPORT_TRACEPOINT_SYMBOL_GPL(name) \
385+
TRACEPOINT_CHECK(name) \
385386
EXPORT_SYMBOL_GPL(__tracepoint_##name); \
386387
EXPORT_SYMBOL_GPL(__traceiter_##name); \
387388
EXPORT_STATIC_CALL_GPL(tp_func_##name)
388389
#define EXPORT_TRACEPOINT_SYMBOL(name) \
390+
TRACEPOINT_CHECK(name) \
389391
EXPORT_SYMBOL(__tracepoint_##name); \
390392
EXPORT_SYMBOL(__traceiter_##name); \
391393
EXPORT_STATIC_CALL(tp_func_##name)

0 commit comments

Comments
 (0)