|
@@ -446,14 +446,16 @@ static inline notrace int ftrace_get_offsets_##call( \
|
|
* .reg = ftrace_event_reg,
|
|
* .reg = ftrace_event_reg,
|
|
* };
|
|
* };
|
|
*
|
|
*
|
|
- * static struct ftrace_event_call __used
|
|
|
|
- * __attribute__((__aligned__(4)))
|
|
|
|
- * __attribute__((section("_ftrace_events"))) event_<call> = {
|
|
|
|
|
|
+ * static struct ftrace_event_call event_<call> = {
|
|
* .name = "<call>",
|
|
* .name = "<call>",
|
|
* .class = event_class_<template>,
|
|
* .class = event_class_<template>,
|
|
* .event = &ftrace_event_type_<call>,
|
|
* .event = &ftrace_event_type_<call>,
|
|
* .print_fmt = print_fmt_<call>,
|
|
* .print_fmt = print_fmt_<call>,
|
|
* };
|
|
* };
|
|
|
|
+ * // its only safe to use pointers when doing linker tricks to
|
|
|
|
+ * // create an array.
|
|
|
|
+ * static struct ftrace_event_call __used
|
|
|
|
+ * __attribute__((section("_ftrace_events"))) *__event_<call> = &event_<call>;
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
|
|
|
|
@@ -579,28 +581,28 @@ static struct ftrace_event_class __used event_class_##call = { \
|
|
#undef DEFINE_EVENT
|
|
#undef DEFINE_EVENT
|
|
#define DEFINE_EVENT(template, call, proto, args) \
|
|
#define DEFINE_EVENT(template, call, proto, args) \
|
|
\
|
|
\
|
|
-static struct ftrace_event_call __used \
|
|
|
|
-__attribute__((__aligned__(4))) \
|
|
|
|
-__attribute__((section("_ftrace_events"))) event_##call = { \
|
|
|
|
|
|
+static struct ftrace_event_call __used event_##call = { \
|
|
.name = #call, \
|
|
.name = #call, \
|
|
.class = &event_class_##template, \
|
|
.class = &event_class_##template, \
|
|
.event.funcs = &ftrace_event_type_funcs_##template, \
|
|
.event.funcs = &ftrace_event_type_funcs_##template, \
|
|
.print_fmt = print_fmt_##template, \
|
|
.print_fmt = print_fmt_##template, \
|
|
-};
|
|
|
|
|
|
+}; \
|
|
|
|
+static struct ftrace_event_call __used \
|
|
|
|
+__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
|
|
|
|
|
|
#undef DEFINE_EVENT_PRINT
|
|
#undef DEFINE_EVENT_PRINT
|
|
#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
|
|
#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
|
|
\
|
|
\
|
|
static const char print_fmt_##call[] = print; \
|
|
static const char print_fmt_##call[] = print; \
|
|
\
|
|
\
|
|
-static struct ftrace_event_call __used \
|
|
|
|
-__attribute__((__aligned__(4))) \
|
|
|
|
-__attribute__((section("_ftrace_events"))) event_##call = { \
|
|
|
|
|
|
+static struct ftrace_event_call __used event_##call = { \
|
|
.name = #call, \
|
|
.name = #call, \
|
|
.class = &event_class_##template, \
|
|
.class = &event_class_##template, \
|
|
.event.funcs = &ftrace_event_type_funcs_##call, \
|
|
.event.funcs = &ftrace_event_type_funcs_##call, \
|
|
.print_fmt = print_fmt_##call, \
|
|
.print_fmt = print_fmt_##call, \
|
|
-}
|
|
|
|
|
|
+}; \
|
|
|
|
+static struct ftrace_event_call __used \
|
|
|
|
+__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
|
|
|
|
|
|
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
|
|
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
|
|
|
|
|