diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-01-07 06:32:10 +0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-01-10 06:20:07 +0400 |
commit | 13a1e4aef53b2a7684ddee374e749999ba103b4a (patch) | |
tree | 74acb760b6d12d4faaae4c4c76a146855e8352a5 /include/trace | |
parent | e8dc637152d2921447b012f58c51e0342304af33 (diff) | |
download | linux-13a1e4aef53b2a7684ddee374e749999ba103b4a.tar.xz |
tracing: Consolidate event trigger code
The event trigger code that checks for callback triggers before and
after recording of an event has lots of flags checks. This code is
duplicated throughout the ftrace events, kprobes and system calls.
They all do the exact same checks against the event flags.
Added helper functions ftrace_trigger_soft_disabled(),
event_trigger_unlock_commit() and event_trigger_unlock_commit_regs()
that consolidated the code and these are used instead.
Link: http://lkml.kernel.org/r/20140106222703.5e7dbba2@gandalf.local.home
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/ftrace.h | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 0962968b8b37..1a8b28db3775 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h @@ -546,8 +546,6 @@ ftrace_raw_event_##call(void *__data, proto) \ struct ftrace_event_file *ftrace_file = __data; \ struct ftrace_event_call *event_call = ftrace_file->event_call; \ struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ - unsigned long eflags = ftrace_file->flags; \ - enum event_trigger_type __tt = ETT_NONE; \ struct ring_buffer_event *event; \ struct ftrace_raw_##call *entry; \ struct ring_buffer *buffer; \ @@ -555,12 +553,8 @@ ftrace_raw_event_##call(void *__data, proto) \ int __data_size; \ int pc; \ \ - if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) { \ - if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE) \ - event_triggers_call(ftrace_file, NULL); \ - if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED) \ - return; \ - } \ + if (ftrace_trigger_soft_disabled(ftrace_file)) \ + return; \ \ local_save_flags(irq_flags); \ pc = preempt_count(); \ @@ -579,17 +573,8 @@ ftrace_raw_event_##call(void *__data, proto) \ \ { assign; } \ \ - if (eflags & FTRACE_EVENT_FL_TRIGGER_COND) \ - __tt = event_triggers_call(ftrace_file, entry); \ - \ - if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, \ - &ftrace_file->flags)) \ - ring_buffer_discard_commit(buffer, event); \ - else if (!filter_check_discard(ftrace_file, entry, buffer, event)) \ - trace_buffer_unlock_commit(buffer, event, irq_flags, pc); \ - \ - if (__tt) \ - event_triggers_post_call(ftrace_file, __tt); \ + event_trigger_unlock_commit(ftrace_file, buffer, event, entry, \ + irq_flags, pc); \ } /* * The ftrace_test_probe is compiled out, it is only here as a build time check |