Commit abb43f69 authored by Mathieu Desnoyers's avatar Mathieu Desnoyers Committed by 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: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 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 = { \
.class = &event_class_ftrace_##call, \
{ \
.name = #call, \ .name = #call, \
}, \
.event.type = etype, \ .event.type = etype, \
.class = &event_class_ftrace_##call, \
.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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment