diff options
Diffstat (limited to 'include/linux/trace_events.h')
-rw-r--r-- | include/linux/trace_events.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index ed27917cabc9..429fdfc3baf5 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h | |||
@@ -168,13 +168,12 @@ struct ring_buffer_event * | |||
168 | trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, | 168 | trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, |
169 | int type, unsigned long len, | 169 | int type, unsigned long len, |
170 | unsigned long flags, int pc); | 170 | unsigned long flags, int pc); |
171 | void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, | 171 | void trace_buffer_unlock_commit(struct trace_array *tr, |
172 | struct ring_buffer_event *event, | 172 | struct ring_buffer *buffer, |
173 | unsigned long flags, int pc); | ||
174 | void trace_buffer_unlock_commit(struct ring_buffer *buffer, | ||
175 | struct ring_buffer_event *event, | 173 | struct ring_buffer_event *event, |
176 | unsigned long flags, int pc); | 174 | unsigned long flags, int pc); |
177 | void trace_buffer_unlock_commit_regs(struct ring_buffer *buffer, | 175 | void trace_buffer_unlock_commit_regs(struct trace_array *tr, |
176 | struct ring_buffer *buffer, | ||
178 | struct ring_buffer_event *event, | 177 | struct ring_buffer_event *event, |
179 | unsigned long flags, int pc, | 178 | unsigned long flags, int pc, |
180 | struct pt_regs *regs); | 179 | struct pt_regs *regs); |
@@ -329,6 +328,7 @@ enum { | |||
329 | EVENT_FILE_FL_SOFT_DISABLED_BIT, | 328 | EVENT_FILE_FL_SOFT_DISABLED_BIT, |
330 | EVENT_FILE_FL_TRIGGER_MODE_BIT, | 329 | EVENT_FILE_FL_TRIGGER_MODE_BIT, |
331 | EVENT_FILE_FL_TRIGGER_COND_BIT, | 330 | EVENT_FILE_FL_TRIGGER_COND_BIT, |
331 | EVENT_FILE_FL_PID_FILTER_BIT, | ||
332 | }; | 332 | }; |
333 | 333 | ||
334 | /* | 334 | /* |
@@ -342,6 +342,7 @@ enum { | |||
342 | * tracepoint may be enabled) | 342 | * tracepoint may be enabled) |
343 | * TRIGGER_MODE - When set, invoke the triggers associated with the event | 343 | * TRIGGER_MODE - When set, invoke the triggers associated with the event |
344 | * TRIGGER_COND - When set, one or more triggers has an associated filter | 344 | * TRIGGER_COND - When set, one or more triggers has an associated filter |
345 | * PID_FILTER - When set, the event is filtered based on pid | ||
345 | */ | 346 | */ |
346 | enum { | 347 | enum { |
347 | EVENT_FILE_FL_ENABLED = (1 << EVENT_FILE_FL_ENABLED_BIT), | 348 | EVENT_FILE_FL_ENABLED = (1 << EVENT_FILE_FL_ENABLED_BIT), |
@@ -352,6 +353,7 @@ enum { | |||
352 | EVENT_FILE_FL_SOFT_DISABLED = (1 << EVENT_FILE_FL_SOFT_DISABLED_BIT), | 353 | EVENT_FILE_FL_SOFT_DISABLED = (1 << EVENT_FILE_FL_SOFT_DISABLED_BIT), |
353 | EVENT_FILE_FL_TRIGGER_MODE = (1 << EVENT_FILE_FL_TRIGGER_MODE_BIT), | 354 | EVENT_FILE_FL_TRIGGER_MODE = (1 << EVENT_FILE_FL_TRIGGER_MODE_BIT), |
354 | EVENT_FILE_FL_TRIGGER_COND = (1 << EVENT_FILE_FL_TRIGGER_COND_BIT), | 355 | EVENT_FILE_FL_TRIGGER_COND = (1 << EVENT_FILE_FL_TRIGGER_COND_BIT), |
356 | EVENT_FILE_FL_PID_FILTER = (1 << EVENT_FILE_FL_PID_FILTER_BIT), | ||
355 | }; | 357 | }; |
356 | 358 | ||
357 | struct trace_event_file { | 359 | struct trace_event_file { |
@@ -430,6 +432,8 @@ extern enum event_trigger_type event_triggers_call(struct trace_event_file *file | |||
430 | extern void event_triggers_post_call(struct trace_event_file *file, | 432 | extern void event_triggers_post_call(struct trace_event_file *file, |
431 | enum event_trigger_type tt); | 433 | enum event_trigger_type tt); |
432 | 434 | ||
435 | bool trace_event_ignore_this_pid(struct trace_event_file *trace_file); | ||
436 | |||
433 | /** | 437 | /** |
434 | * trace_trigger_soft_disabled - do triggers and test if soft disabled | 438 | * trace_trigger_soft_disabled - do triggers and test if soft disabled |
435 | * @file: The file pointer of the event to test | 439 | * @file: The file pointer of the event to test |
@@ -449,6 +453,8 @@ trace_trigger_soft_disabled(struct trace_event_file *file) | |||
449 | event_triggers_call(file, NULL); | 453 | event_triggers_call(file, NULL); |
450 | if (eflags & EVENT_FILE_FL_SOFT_DISABLED) | 454 | if (eflags & EVENT_FILE_FL_SOFT_DISABLED) |
451 | return true; | 455 | return true; |
456 | if (eflags & EVENT_FILE_FL_PID_FILTER) | ||
457 | return trace_event_ignore_this_pid(file); | ||
452 | } | 458 | } |
453 | return false; | 459 | return false; |
454 | } | 460 | } |
@@ -508,7 +514,7 @@ event_trigger_unlock_commit(struct trace_event_file *file, | |||
508 | enum event_trigger_type tt = ETT_NONE; | 514 | enum event_trigger_type tt = ETT_NONE; |
509 | 515 | ||
510 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) | 516 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) |
511 | trace_buffer_unlock_commit(buffer, event, irq_flags, pc); | 517 | trace_buffer_unlock_commit(file->tr, buffer, event, irq_flags, pc); |
512 | 518 | ||
513 | if (tt) | 519 | if (tt) |
514 | event_triggers_post_call(file, tt); | 520 | event_triggers_post_call(file, tt); |
@@ -540,7 +546,7 @@ event_trigger_unlock_commit_regs(struct trace_event_file *file, | |||
540 | enum event_trigger_type tt = ETT_NONE; | 546 | enum event_trigger_type tt = ETT_NONE; |
541 | 547 | ||
542 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) | 548 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) |
543 | trace_buffer_unlock_commit_regs(buffer, event, | 549 | trace_buffer_unlock_commit_regs(file->tr, buffer, event, |
544 | irq_flags, pc, regs); | 550 | irq_flags, pc, regs); |
545 | 551 | ||
546 | if (tt) | 552 | if (tt) |