History

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.com

Mathieu Desnoyers committed 12 years ago

Commit abb43f61 parent b725dfe3 files · +19 −7Browse files

Unified · Split

3 files
  1. include/linux/syscalls.h +6 −2
  2. include/trace/ftrace.h +9 −3
  3. kernel/trace/trace_export.c +4 −2
include/linux/syscalls.h+6−2
@@ -119,8 +119,10 @@ extern struct trace_event_functions exit_syscall_print_funcs; · 118 unmodified lines
119 static struct syscall_metadata __syscall_meta_##sname; \119 static struct syscall_metadata __syscall_meta_##sname; \
120 static struct ftrace_event_call __used \120 static struct ftrace_event_call __used \
121 event_enter_##sname = { \121 event_enter_##sname = { \
122 .name = "sys_enter"#sname, \
123 .class = &event_class_syscall_enter, \122 .class = &event_class_syscall_enter, \
123 { \
124 .name = "sys_enter"#sname, \
125 }, \
124 .event.funcs = &enter_syscall_print_funcs, \126 .event.funcs = &enter_syscall_print_funcs, \
125 .data = (void *)&__syscall_meta_##sname,\127 .data = (void *)&__syscall_meta_##sname,\
126 .flags = TRACE_EVENT_FL_CAP_ANY, \128 .flags = TRACE_EVENT_FL_CAP_ANY, \
@@ -133,8 +135,10 @@ extern struct trace_event_functions exit_syscall_print_funcs; · 6 unmodified lines
133 static struct syscall_metadata __syscall_meta_##sname; \135 static struct syscall_metadata __syscall_meta_##sname; \
134 static struct ftrace_event_call __used \136 static struct ftrace_event_call __used \
135 event_exit_##sname = { \137 event_exit_##sname = { \
136 .name = "sys_exit"#sname, \
137 .class = &event_class_syscall_exit, \138 .class = &event_class_syscall_exit, \
139 { \
140 .name = "sys_exit"#sname, \
141 }, \
138 .event.funcs = &exit_syscall_print_funcs, \142 .event.funcs = &exit_syscall_print_funcs, \
139 .data = (void *)&__syscall_meta_##sname,\143 .data = (void *)&__syscall_meta_##sname,\
140 .flags = TRACE_EVENT_FL_CAP_ANY, \144 .flags = TRACE_EVENT_FL_CAP_ANY, \
include/trace/ftrace.h+9−3
@@ -470,8 +470,10 @@ static inline notrace int ftrace_get_offsets_##call( \ · 469 unmodified lines
470 * };470 * };
471 *471 *
472 * static struct ftrace_event_call event_<call> = {472 * static struct ftrace_event_call event_<call> = {
473 * .tp = &__tracepoint_<call>,
474 * .class = event_class_<template>,473 * .class = event_class_<template>,
474 * {
475 * .tp = &__tracepoint_<call>,
476 * },
475 * .event = &ftrace_event_type_<call>,477 * .event = &ftrace_event_type_<call>,
476 * .print_fmt = print_fmt_<call>,478 * .print_fmt = print_fmt_<call>,
477 * .flags = TRACE_EVENT_FL_TRACEPOINT,479 * .flags = TRACE_EVENT_FL_TRACEPOINT,
@@ -606,8 +608,10 @@ static struct ftrace_event_class __used __refdata event_class_##call = { \ · 128 unmodified lines
606#define DEFINE_EVENT(template, call, proto, args) \608#define DEFINE_EVENT(template, call, proto, args) \
607 \609 \
608static struct ftrace_event_call __used event_##call = { \610static struct ftrace_event_call __used event_##call = { \
609 .tp = &__tracepoint_##call, \
610 .class = &event_class_##template, \611 .class = &event_class_##template, \
612 { \
613 .tp = &__tracepoint_##call, \
614 }, \
611 .event.funcs = &ftrace_event_type_funcs_##template, \615 .event.funcs = &ftrace_event_type_funcs_##template, \
612 .print_fmt = print_fmt_##template, \616 .print_fmt = print_fmt_##template, \
613 .flags = TRACE_EVENT_FL_TRACEPOINT, \617 .flags = TRACE_EVENT_FL_TRACEPOINT, \
@@ -621,8 +625,10 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call · 7 unmodified lines
621static const char print_fmt_##call[] = print; \625static const char print_fmt_##call[] = print; \
622 \626 \
623static struct ftrace_event_call __used event_##call = { \627static struct ftrace_event_call __used event_##call = { \
624 .tp = &__tracepoint_##call, \
625 .class = &event_class_##template, \628 .class = &event_class_##template, \
629 { \
630 .tp = &__tracepoint_##call, \
631 }, \
626 .event.funcs = &ftrace_event_type_funcs_##call, \632 .event.funcs = &ftrace_event_type_funcs_##call, \
627 .print_fmt = print_fmt_##call, \633 .print_fmt = print_fmt_##call, \
628 .flags = TRACE_EVENT_FL_TRACEPOINT, \634 .flags = TRACE_EVENT_FL_TRACEPOINT, \
kernel/trace/trace_export.c+4−2
@@ -173,9 +173,11 @@ struct ftrace_event_class __refdata event_class_ftrace_##call = { \ · 172 unmodified lines
173}; \173}; \
174 \174 \
175struct ftrace_event_call __used event_##call = { \175struct ftrace_event_call __used event_##call = { \
176 .name = #call, \
177 .event.type = etype, \
178 .class = &event_class_ftrace_##call, \176 .class = &event_class_ftrace_##call, \
177 { \
178 .name = #call, \
179 }, \
180 .event.type = etype, \
179 .print_fmt = print, \181 .print_fmt = print, \
180 .flags = TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \182 .flags = TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \
181}; \183}; \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t