.. | .. |
---|
29 | 29 | * function and thus become accesible via perf. |
---|
30 | 30 | */ |
---|
31 | 31 | #undef FTRACE_ENTRY_REG |
---|
32 | | -#define FTRACE_ENTRY_REG(name, struct_name, id, tstruct, print, \ |
---|
33 | | - filter, regfn) \ |
---|
34 | | - FTRACE_ENTRY(name, struct_name, id, PARAMS(tstruct), PARAMS(print), \ |
---|
35 | | - filter) |
---|
| 32 | +#define FTRACE_ENTRY_REG(name, struct_name, id, tstruct, print, regfn) \ |
---|
| 33 | + FTRACE_ENTRY(name, struct_name, id, PARAMS(tstruct), PARAMS(print)) |
---|
36 | 34 | |
---|
37 | 35 | /* not needed for this file */ |
---|
38 | 36 | #undef __field_struct |
---|
.. | .. |
---|
41 | 39 | #undef __field |
---|
42 | 40 | #define __field(type, item) type item; |
---|
43 | 41 | |
---|
| 42 | +#undef __field_fn |
---|
| 43 | +#define __field_fn(type, item) type item; |
---|
| 44 | + |
---|
44 | 45 | #undef __field_desc |
---|
45 | 46 | #define __field_desc(type, container, item) type item; |
---|
| 47 | + |
---|
| 48 | +#undef __field_packed |
---|
| 49 | +#define __field_packed(type, container, item) type item; |
---|
46 | 50 | |
---|
47 | 51 | #undef __array |
---|
48 | 52 | #define __array(type, item, size) type item[size]; |
---|
.. | .. |
---|
60 | 64 | #define F_printk(fmt, args...) fmt, args |
---|
61 | 65 | |
---|
62 | 66 | #undef FTRACE_ENTRY |
---|
63 | | -#define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \ |
---|
| 67 | +#define FTRACE_ENTRY(name, struct_name, id, tstruct, print) \ |
---|
64 | 68 | struct ____ftrace_##name { \ |
---|
65 | 69 | tstruct \ |
---|
66 | 70 | }; \ |
---|
.. | .. |
---|
73 | 77 | } |
---|
74 | 78 | |
---|
75 | 79 | #undef FTRACE_ENTRY_DUP |
---|
76 | | -#define FTRACE_ENTRY_DUP(name, struct_name, id, tstruct, print, filter) \ |
---|
77 | | - FTRACE_ENTRY(name, struct_name, id, PARAMS(tstruct), PARAMS(print), \ |
---|
78 | | - filter) |
---|
| 80 | +#define FTRACE_ENTRY_DUP(name, struct_name, id, tstruct, print) \ |
---|
| 81 | + FTRACE_ENTRY(name, struct_name, id, PARAMS(tstruct), PARAMS(print)) |
---|
79 | 82 | |
---|
80 | 83 | #include "trace_entries.h" |
---|
81 | 84 | |
---|
| 85 | +#undef __field_ext |
---|
| 86 | +#define __field_ext(_type, _item, _filter_type) { \ |
---|
| 87 | + .type = #_type, .name = #_item, \ |
---|
| 88 | + .size = sizeof(_type), .align = __alignof__(_type), \ |
---|
| 89 | + is_signed_type(_type), .filter_type = _filter_type }, |
---|
| 90 | + |
---|
| 91 | + |
---|
| 92 | +#undef __field_ext_packed |
---|
| 93 | +#define __field_ext_packed(_type, _item, _filter_type) { \ |
---|
| 94 | + .type = #_type, .name = #_item, \ |
---|
| 95 | + .size = sizeof(_type), .align = 1, \ |
---|
| 96 | + is_signed_type(_type), .filter_type = _filter_type }, |
---|
| 97 | + |
---|
82 | 98 | #undef __field |
---|
83 | | -#define __field(type, item) \ |
---|
84 | | - ret = trace_define_field(event_call, #type, #item, \ |
---|
85 | | - offsetof(typeof(field), item), \ |
---|
86 | | - sizeof(field.item), \ |
---|
87 | | - is_signed_type(type), filter_type); \ |
---|
88 | | - if (ret) \ |
---|
89 | | - return ret; |
---|
| 99 | +#define __field(_type, _item) __field_ext(_type, _item, FILTER_OTHER) |
---|
| 100 | + |
---|
| 101 | +#undef __field_fn |
---|
| 102 | +#define __field_fn(_type, _item) __field_ext(_type, _item, FILTER_TRACE_FN) |
---|
90 | 103 | |
---|
91 | 104 | #undef __field_desc |
---|
92 | | -#define __field_desc(type, container, item) \ |
---|
93 | | - ret = trace_define_field(event_call, #type, #item, \ |
---|
94 | | - offsetof(typeof(field), \ |
---|
95 | | - container.item), \ |
---|
96 | | - sizeof(field.container.item), \ |
---|
97 | | - is_signed_type(type), filter_type); \ |
---|
98 | | - if (ret) \ |
---|
99 | | - return ret; |
---|
| 105 | +#define __field_desc(_type, _container, _item) __field_ext(_type, _item, FILTER_OTHER) |
---|
| 106 | + |
---|
| 107 | +#undef __field_packed |
---|
| 108 | +#define __field_packed(_type, _container, _item) __field_ext_packed(_type, _item, FILTER_OTHER) |
---|
100 | 109 | |
---|
101 | 110 | #undef __array |
---|
102 | | -#define __array(type, item, len) \ |
---|
103 | | - do { \ |
---|
104 | | - char *type_str = #type"["__stringify(len)"]"; \ |
---|
105 | | - BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
---|
106 | | - ret = trace_define_field(event_call, type_str, #item, \ |
---|
107 | | - offsetof(typeof(field), item), \ |
---|
108 | | - sizeof(field.item), \ |
---|
109 | | - is_signed_type(type), filter_type); \ |
---|
110 | | - if (ret) \ |
---|
111 | | - return ret; \ |
---|
112 | | - } while (0); |
---|
| 111 | +#define __array(_type, _item, _len) { \ |
---|
| 112 | + .type = #_type"["__stringify(_len)"]", .name = #_item, \ |
---|
| 113 | + .size = sizeof(_type[_len]), .align = __alignof__(_type), \ |
---|
| 114 | + is_signed_type(_type), .filter_type = FILTER_OTHER }, |
---|
113 | 115 | |
---|
114 | 116 | #undef __array_desc |
---|
115 | | -#define __array_desc(type, container, item, len) \ |
---|
116 | | - BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
---|
117 | | - ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
---|
118 | | - offsetof(typeof(field), \ |
---|
119 | | - container.item), \ |
---|
120 | | - sizeof(field.container.item), \ |
---|
121 | | - is_signed_type(type), filter_type); \ |
---|
122 | | - if (ret) \ |
---|
123 | | - return ret; |
---|
| 117 | +#define __array_desc(_type, _container, _item, _len) __array(_type, _item, _len) |
---|
124 | 118 | |
---|
125 | 119 | #undef __dynamic_array |
---|
126 | | -#define __dynamic_array(type, item) \ |
---|
127 | | - ret = trace_define_field(event_call, #type "[]", #item, \ |
---|
128 | | - offsetof(typeof(field), item), \ |
---|
129 | | - 0, is_signed_type(type), filter_type);\ |
---|
130 | | - if (ret) \ |
---|
131 | | - return ret; |
---|
| 120 | +#define __dynamic_array(_type, _item) { \ |
---|
| 121 | + .type = #_type "[]", .name = #_item, \ |
---|
| 122 | + .size = 0, .align = __alignof__(_type), \ |
---|
| 123 | + is_signed_type(_type), .filter_type = FILTER_OTHER }, |
---|
132 | 124 | |
---|
133 | 125 | #undef FTRACE_ENTRY |
---|
134 | | -#define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \ |
---|
135 | | -static int __init \ |
---|
136 | | -ftrace_define_fields_##name(struct trace_event_call *event_call) \ |
---|
137 | | -{ \ |
---|
138 | | - struct struct_name field; \ |
---|
139 | | - int ret; \ |
---|
140 | | - int filter_type = filter; \ |
---|
141 | | - \ |
---|
142 | | - tstruct; \ |
---|
143 | | - \ |
---|
144 | | - return ret; \ |
---|
145 | | -} |
---|
| 126 | +#define FTRACE_ENTRY(name, struct_name, id, tstruct, print) \ |
---|
| 127 | +static struct trace_event_fields ftrace_event_fields_##name[] = { \ |
---|
| 128 | + tstruct \ |
---|
| 129 | + {} }; |
---|
146 | 130 | |
---|
147 | 131 | #include "trace_entries.h" |
---|
148 | 132 | |
---|
.. | .. |
---|
152 | 136 | #undef __field |
---|
153 | 137 | #define __field(type, item) |
---|
154 | 138 | |
---|
| 139 | +#undef __field_fn |
---|
| 140 | +#define __field_fn(type, item) |
---|
| 141 | + |
---|
155 | 142 | #undef __field_desc |
---|
156 | 143 | #define __field_desc(type, container, item) |
---|
| 144 | + |
---|
| 145 | +#undef __field_packed |
---|
| 146 | +#define __field_packed(type, container, item) |
---|
157 | 147 | |
---|
158 | 148 | #undef __array |
---|
159 | 149 | #define __array(type, item, len) |
---|
.. | .. |
---|
168 | 158 | #define F_printk(fmt, args...) __stringify(fmt) ", " __stringify(args) |
---|
169 | 159 | |
---|
170 | 160 | #undef FTRACE_ENTRY_REG |
---|
171 | | -#define FTRACE_ENTRY_REG(call, struct_name, etype, tstruct, print, filter,\ |
---|
172 | | - regfn) \ |
---|
173 | | - \ |
---|
174 | | -struct trace_event_class __refdata event_class_ftrace_##call = { \ |
---|
| 161 | +#define FTRACE_ENTRY_REG(call, struct_name, etype, tstruct, print, regfn) \ |
---|
| 162 | +static struct trace_event_class __refdata event_class_ftrace_##call = { \ |
---|
175 | 163 | .system = __stringify(TRACE_SYSTEM), \ |
---|
176 | | - .define_fields = ftrace_define_fields_##call, \ |
---|
| 164 | + .fields_array = ftrace_event_fields_##call, \ |
---|
177 | 165 | .fields = LIST_HEAD_INIT(event_class_ftrace_##call.fields),\ |
---|
178 | 166 | .reg = regfn, \ |
---|
179 | 167 | }; \ |
---|
.. | .. |
---|
187 | 175 | .print_fmt = print, \ |
---|
188 | 176 | .flags = TRACE_EVENT_FL_IGNORE_ENABLE, \ |
---|
189 | 177 | }; \ |
---|
190 | | -struct trace_event_call __used \ |
---|
191 | | -__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; |
---|
| 178 | +static struct trace_event_call __used \ |
---|
| 179 | +__section("_ftrace_events") *__event_##call = &event_##call; |
---|
192 | 180 | |
---|
193 | 181 | #undef FTRACE_ENTRY |
---|
194 | | -#define FTRACE_ENTRY(call, struct_name, etype, tstruct, print, filter) \ |
---|
| 182 | +#define FTRACE_ENTRY(call, struct_name, etype, tstruct, print) \ |
---|
195 | 183 | FTRACE_ENTRY_REG(call, struct_name, etype, \ |
---|
196 | | - PARAMS(tstruct), PARAMS(print), filter, NULL) |
---|
| 184 | + PARAMS(tstruct), PARAMS(print), NULL) |
---|
197 | 185 | |
---|
198 | 186 | bool ftrace_event_is_function(struct trace_event_call *call) |
---|
199 | 187 | { |
---|