Skip to content

Commit

Permalink
tracing: Add __used annotation to event variable
Browse files Browse the repository at this point in the history
The TRACE_EVENT() macros automate creation of trace events. To automate
initialization, the set up variables are loaded in a special section
that is read on boot up. GCC is not aware that these static variables
are used and will complain about them if we do not inform GCC that
they are indeed used.

One of the declarations of the event element was missing a __used
annotation. This patch adds it.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 25, 2010
1 parent 87f44bb commit 49c1774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

#undef DEFINE_EVENT
#define DEFINE_EVENT(template, name, proto, args) \
static struct ftrace_event_call \
static struct ftrace_event_call __used \
__attribute__((__aligned__(4))) event_##name

#undef DEFINE_EVENT_PRINT
Expand Down

0 comments on commit 49c1774

Please sign in to comment.