aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/ftrace.h
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-01-06 21:32:10 -0500
committerSteven Rostedt <rostedt@goodmis.org>2014-01-09 21:20:07 -0500
commit13a1e4aef53b2a7684ddee374e749999ba103b4a (patch)
tree74acb760b6d12d4faaae4c4c76a146855e8352a5 /include/trace/ftrace.h
parente8dc637152d2921447b012f58c51e0342304af33 (diff)
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/ftrace.h')
-rw-r--r--include/trace/ftrace.h23
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) \
546 struct ftrace_event_file *ftrace_file = __data; \ 546 struct ftrace_event_file *ftrace_file = __data; \
547 struct ftrace_event_call *event_call = ftrace_file->event_call; \ 547 struct ftrace_event_call *event_call = ftrace_file->event_call; \
548 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 548 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
549 unsigned long eflags = ftrace_file->flags; \
550 enum event_trigger_type __tt = ETT_NONE; \
551 struct ring_buffer_event *event; \ 549 struct ring_buffer_event *event; \
552 struct ftrace_raw_##call *entry; \ 550 struct ftrace_raw_##call *entry; \
553 struct ring_buffer *buffer; \ 551 struct ring_buffer *buffer; \
@@ -555,12 +553,8 @@ ftrace_raw_event_##call(void *__data, proto) \
555 int __data_size; \ 553 int __data_size; \
556 int pc; \ 554 int pc; \
557 \ 555 \
558 if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) { \ 556 if (ftrace_trigger_soft_disabled(ftrace_file)) \
559 if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE) \ 557 return; \
560 event_triggers_call(ftrace_file, NULL); \
561 if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED) \
562 return; \
563 } \
564 \ 558 \
565 local_save_flags(irq_flags); \ 559 local_save_flags(irq_flags); \
566 pc = preempt_count(); \ 560 pc = preempt_count(); \
@@ -579,17 +573,8 @@ ftrace_raw_event_##call(void *__data, proto) \
579 \ 573 \
580 { assign; } \ 574 { assign; } \
581 \ 575 \
582 if (eflags & FTRACE_EVENT_FL_TRIGGER_COND) \ 576 event_trigger_unlock_commit(ftrace_file, buffer, event, entry, \
583 __tt = event_triggers_call(ftrace_file, entry); \ 577 irq_flags, pc); \
584 \
585 if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, \
586 &ftrace_file->flags)) \
587 ring_buffer_discard_commit(buffer, event); \
588 else if (!filter_check_discard(ftrace_file, entry, buffer, event)) \
589 trace_buffer_unlock_commit(buffer, event, irq_flags, pc); \
590 \
591 if (__tt) \
592 event_triggers_post_call(ftrace_file, __tt); \
593} 578}
594/* 579/*
595 * The ftrace_test_probe is compiled out, it is only here as a build time check 580 * The ftrace_test_probe is compiled out, it is only here as a build time check