diff options
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r-- | include/linux/ftrace_event.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 5eaa746735ff..9abbe630c456 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -202,6 +202,7 @@ enum { | |||
202 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, | 202 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, |
203 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, | 203 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, |
204 | TRACE_EVENT_FL_WAS_ENABLED_BIT, | 204 | TRACE_EVENT_FL_WAS_ENABLED_BIT, |
205 | TRACE_EVENT_FL_USE_CALL_FILTER_BIT, | ||
205 | }; | 206 | }; |
206 | 207 | ||
207 | /* | 208 | /* |
@@ -213,6 +214,7 @@ enum { | |||
213 | * WAS_ENABLED - Set and stays set when an event was ever enabled | 214 | * WAS_ENABLED - Set and stays set when an event was ever enabled |
214 | * (used for module unloading, if a module event is enabled, | 215 | * (used for module unloading, if a module event is enabled, |
215 | * it is best to clear the buffers that used it). | 216 | * it is best to clear the buffers that used it). |
217 | * USE_CALL_FILTER - For ftrace internal events, don't use file filter | ||
216 | */ | 218 | */ |
217 | enum { | 219 | enum { |
218 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 220 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
@@ -220,6 +222,7 @@ enum { | |||
220 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), | 222 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), |
221 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), | 223 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), |
222 | TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), | 224 | TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), |
225 | TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT), | ||
223 | }; | 226 | }; |
224 | 227 | ||
225 | struct ftrace_event_call { | 228 | struct ftrace_event_call { |
@@ -238,6 +241,7 @@ struct ftrace_event_call { | |||
238 | * bit 2: failed to apply filter | 241 | * bit 2: failed to apply filter |
239 | * bit 3: ftrace internal event (do not enable) | 242 | * bit 3: ftrace internal event (do not enable) |
240 | * bit 4: Event was enabled by module | 243 | * bit 4: Event was enabled by module |
244 | * bit 5: use call filter rather than file filter | ||
241 | */ | 245 | */ |
242 | int flags; /* static flags of different events */ | 246 | int flags; /* static flags of different events */ |
243 | 247 | ||
@@ -253,6 +257,8 @@ struct ftrace_subsystem_dir; | |||
253 | enum { | 257 | enum { |
254 | FTRACE_EVENT_FL_ENABLED_BIT, | 258 | FTRACE_EVENT_FL_ENABLED_BIT, |
255 | FTRACE_EVENT_FL_RECORDED_CMD_BIT, | 259 | FTRACE_EVENT_FL_RECORDED_CMD_BIT, |
260 | FTRACE_EVENT_FL_FILTERED_BIT, | ||
261 | FTRACE_EVENT_FL_NO_SET_FILTER_BIT, | ||
256 | FTRACE_EVENT_FL_SOFT_MODE_BIT, | 262 | FTRACE_EVENT_FL_SOFT_MODE_BIT, |
257 | FTRACE_EVENT_FL_SOFT_DISABLED_BIT, | 263 | FTRACE_EVENT_FL_SOFT_DISABLED_BIT, |
258 | }; | 264 | }; |
@@ -261,6 +267,8 @@ enum { | |||
261 | * Ftrace event file flags: | 267 | * Ftrace event file flags: |
262 | * ENABLED - The event is enabled | 268 | * ENABLED - The event is enabled |
263 | * RECORDED_CMD - The comms should be recorded at sched_switch | 269 | * RECORDED_CMD - The comms should be recorded at sched_switch |
270 | * FILTERED - The event has a filter attached | ||
271 | * NO_SET_FILTER - Set when filter has error and is to be ignored | ||
264 | * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED | 272 | * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED |
265 | * SOFT_DISABLED - When set, do not trace the event (even though its | 273 | * SOFT_DISABLED - When set, do not trace the event (even though its |
266 | * tracepoint may be enabled) | 274 | * tracepoint may be enabled) |
@@ -268,6 +276,8 @@ enum { | |||
268 | enum { | 276 | enum { |
269 | FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), | 277 | FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), |
270 | FTRACE_EVENT_FL_RECORDED_CMD = (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT), | 278 | FTRACE_EVENT_FL_RECORDED_CMD = (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT), |
279 | FTRACE_EVENT_FL_FILTERED = (1 << FTRACE_EVENT_FL_FILTERED_BIT), | ||
280 | FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), | ||
271 | FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), | 281 | FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), |
272 | FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), | 282 | FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), |
273 | }; | 283 | }; |
@@ -275,6 +285,7 @@ enum { | |||
275 | struct ftrace_event_file { | 285 | struct ftrace_event_file { |
276 | struct list_head list; | 286 | struct list_head list; |
277 | struct ftrace_event_call *event_call; | 287 | struct ftrace_event_call *event_call; |
288 | struct event_filter *filter; | ||
278 | struct dentry *dir; | 289 | struct dentry *dir; |
279 | struct trace_array *tr; | 290 | struct trace_array *tr; |
280 | struct ftrace_subsystem_dir *system; | 291 | struct ftrace_subsystem_dir *system; |
@@ -310,12 +321,16 @@ struct ftrace_event_file { | |||
310 | 321 | ||
311 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 322 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
312 | 323 | ||
313 | extern void destroy_preds(struct ftrace_event_call *call); | 324 | extern void destroy_preds(struct ftrace_event_file *file); |
325 | extern void destroy_call_preds(struct ftrace_event_call *call); | ||
314 | extern int filter_match_preds(struct event_filter *filter, void *rec); | 326 | extern int filter_match_preds(struct event_filter *filter, void *rec); |
315 | extern int filter_current_check_discard(struct ring_buffer *buffer, | 327 | |
316 | struct ftrace_event_call *call, | 328 | extern int filter_check_discard(struct ftrace_event_file *file, void *rec, |
317 | void *rec, | 329 | struct ring_buffer *buffer, |
318 | struct ring_buffer_event *event); | 330 | struct ring_buffer_event *event); |
331 | extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, | ||
332 | struct ring_buffer *buffer, | ||
333 | struct ring_buffer_event *event); | ||
319 | 334 | ||
320 | enum { | 335 | enum { |
321 | FILTER_OTHER = 0, | 336 | FILTER_OTHER = 0, |