提交 abb43f69 编写于 作者: M Mathieu Desnoyers 提交者: Steven Rostedt

tracing: Fix anonymous unions in struct ftrace_event_call

gcc <= 4.5.x has significant limitations with respect to initialization
of anonymous unions within structures. They need to be surrounded by
brackets, _and_ they need to be initialized in the same order in which
they appear in the structure declaration.

Link: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
Link: http://lkml.kernel.org/r/1397077568-3156-1-git-send-email-mathieu.desnoyers@efficios.comSigned-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 b725dfea
...@@ -119,8 +119,10 @@ extern struct trace_event_functions exit_syscall_print_funcs; ...@@ -119,8 +119,10 @@ extern struct trace_event_functions exit_syscall_print_funcs;
static struct syscall_metadata __syscall_meta_##sname; \ static struct syscall_metadata __syscall_meta_##sname; \
static struct ftrace_event_call __used \ static struct ftrace_event_call __used \
event_enter_##sname = { \ event_enter_##sname = { \
.name = "sys_enter"#sname, \
.class = &event_class_syscall_enter, \ .class = &event_class_syscall_enter, \
{ \
.name = "sys_enter"#sname, \
}, \
.event.funcs = &enter_syscall_print_funcs, \ .event.funcs = &enter_syscall_print_funcs, \
.data = (void *)&__syscall_meta_##sname,\ .data = (void *)&__syscall_meta_##sname,\
.flags = TRACE_EVENT_FL_CAP_ANY, \ .flags = TRACE_EVENT_FL_CAP_ANY, \
...@@ -133,8 +135,10 @@ extern struct trace_event_functions exit_syscall_print_funcs; ...@@ -133,8 +135,10 @@ extern struct trace_event_functions exit_syscall_print_funcs;
static struct syscall_metadata __syscall_meta_##sname; \ static struct syscall_metadata __syscall_meta_##sname; \
static struct ftrace_event_call __used \ static struct ftrace_event_call __used \
event_exit_##sname = { \ event_exit_##sname = { \
.name = "sys_exit"#sname, \
.class = &event_class_syscall_exit, \ .class = &event_class_syscall_exit, \
{ \
.name = "sys_exit"#sname, \
}, \
.event.funcs = &exit_syscall_print_funcs, \ .event.funcs = &exit_syscall_print_funcs, \
.data = (void *)&__syscall_meta_##sname,\ .data = (void *)&__syscall_meta_##sname,\
.flags = TRACE_EVENT_FL_CAP_ANY, \ .flags = TRACE_EVENT_FL_CAP_ANY, \
......
...@@ -470,8 +470,10 @@ static inline notrace int ftrace_get_offsets_##call( \ ...@@ -470,8 +470,10 @@ static inline notrace int ftrace_get_offsets_##call( \
* }; * };
* *
* static struct ftrace_event_call event_<call> = { * static struct ftrace_event_call event_<call> = {
* .tp = &__tracepoint_<call>,
* .class = event_class_<template>, * .class = event_class_<template>,
* {
* .tp = &__tracepoint_<call>,
* },
* .event = &ftrace_event_type_<call>, * .event = &ftrace_event_type_<call>,
* .print_fmt = print_fmt_<call>, * .print_fmt = print_fmt_<call>,
* .flags = TRACE_EVENT_FL_TRACEPOINT, * .flags = TRACE_EVENT_FL_TRACEPOINT,
...@@ -606,8 +608,10 @@ static struct ftrace_event_class __used __refdata event_class_##call = { \ ...@@ -606,8 +608,10 @@ static struct ftrace_event_class __used __refdata event_class_##call = { \
#define DEFINE_EVENT(template, call, proto, args) \ #define DEFINE_EVENT(template, call, proto, args) \
\ \
static struct ftrace_event_call __used event_##call = { \ static struct ftrace_event_call __used event_##call = { \
.tp = &__tracepoint_##call, \
.class = &event_class_##template, \ .class = &event_class_##template, \
{ \
.tp = &__tracepoint_##call, \
}, \
.event.funcs = &ftrace_event_type_funcs_##template, \ .event.funcs = &ftrace_event_type_funcs_##template, \
.print_fmt = print_fmt_##template, \ .print_fmt = print_fmt_##template, \
.flags = TRACE_EVENT_FL_TRACEPOINT, \ .flags = TRACE_EVENT_FL_TRACEPOINT, \
...@@ -621,8 +625,10 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call ...@@ -621,8 +625,10 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
static const char print_fmt_##call[] = print; \ static const char print_fmt_##call[] = print; \
\ \
static struct ftrace_event_call __used event_##call = { \ static struct ftrace_event_call __used event_##call = { \
.tp = &__tracepoint_##call, \
.class = &event_class_##template, \ .class = &event_class_##template, \
{ \
.tp = &__tracepoint_##call, \
}, \
.event.funcs = &ftrace_event_type_funcs_##call, \ .event.funcs = &ftrace_event_type_funcs_##call, \
.print_fmt = print_fmt_##call, \ .print_fmt = print_fmt_##call, \
.flags = TRACE_EVENT_FL_TRACEPOINT, \ .flags = TRACE_EVENT_FL_TRACEPOINT, \
......
...@@ -173,9 +173,11 @@ struct ftrace_event_class __refdata event_class_ftrace_##call = { \ ...@@ -173,9 +173,11 @@ struct ftrace_event_class __refdata event_class_ftrace_##call = { \
}; \ }; \
\ \
struct ftrace_event_call __used event_##call = { \ struct ftrace_event_call __used event_##call = { \
.name = #call, \
.event.type = etype, \
.class = &event_class_ftrace_##call, \ .class = &event_class_ftrace_##call, \
{ \
.name = #call, \
}, \
.event.type = etype, \
.print_fmt = print, \ .print_fmt = print, \
.flags = TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \ .flags = TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \
}; \ }; \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册