diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2016-04-27 11:09:42 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-04-29 16:14:08 -0400 |
commit | 9cbb1506ab2db987c160e7fc50665bf47b5b6fa1 (patch) | |
tree | 550d3084156dd2dc80b32c386ada77fbdd108227 | |
parent | 65da9a0a3bf2202c2432f42d41eb908f2fa30579 (diff) |
tracing: Fold filter_check_discard() into its only user
The function filter_check_discard() is small and only called by one user,
its code can be folded into that one caller and make the code a bit less
comlplex.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/trace.c | 13 | ||||
-rw-r--r-- | kernel/trace/trace.h | 13 |
2 files changed, 6 insertions, 20 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 02f5a5f51d49..1ba54e241c8d 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -306,19 +306,6 @@ void trace_array_put(struct trace_array *this_tr) | |||
306 | mutex_unlock(&trace_types_lock); | 306 | mutex_unlock(&trace_types_lock); |
307 | } | 307 | } |
308 | 308 | ||
309 | int filter_check_discard(struct trace_event_file *file, void *rec, | ||
310 | struct ring_buffer *buffer, | ||
311 | struct ring_buffer_event *event) | ||
312 | { | ||
313 | if (unlikely(file->flags & EVENT_FILE_FL_FILTERED) && | ||
314 | !filter_match_preds(file->filter, rec)) { | ||
315 | ring_buffer_discard_commit(buffer, event); | ||
316 | return 1; | ||
317 | } | ||
318 | |||
319 | return 0; | ||
320 | } | ||
321 | |||
322 | int call_filter_check_discard(struct trace_event_call *call, void *rec, | 309 | int call_filter_check_discard(struct trace_event_call *call, void *rec, |
323 | struct ring_buffer *buffer, | 310 | struct ring_buffer *buffer, |
324 | struct ring_buffer_event *event) | 311 | struct ring_buffer_event *event) |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index ee8691c66bfe..0862e7559548 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -1065,9 +1065,6 @@ struct trace_subsystem_dir { | |||
1065 | int nr_events; | 1065 | int nr_events; |
1066 | }; | 1066 | }; |
1067 | 1067 | ||
1068 | extern int filter_check_discard(struct trace_event_file *file, void *rec, | ||
1069 | struct ring_buffer *buffer, | ||
1070 | struct ring_buffer_event *event); | ||
1071 | extern int call_filter_check_discard(struct trace_event_call *call, void *rec, | 1068 | extern int call_filter_check_discard(struct trace_event_call *call, void *rec, |
1072 | struct ring_buffer *buffer, | 1069 | struct ring_buffer *buffer, |
1073 | struct ring_buffer_event *event); | 1070 | struct ring_buffer_event *event); |
@@ -1096,12 +1093,14 @@ __event_trigger_test_discard(struct trace_event_file *file, | |||
1096 | if (eflags & EVENT_FILE_FL_TRIGGER_COND) | 1093 | if (eflags & EVENT_FILE_FL_TRIGGER_COND) |
1097 | *tt = event_triggers_call(file, entry); | 1094 | *tt = event_triggers_call(file, entry); |
1098 | 1095 | ||
1099 | if (test_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &file->flags)) | 1096 | if (test_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &file->flags) || |
1097 | (unlikely(file->flags & EVENT_FILE_FL_FILTERED) && | ||
1098 | !filter_match_preds(file->filter, entry))) { | ||
1100 | ring_buffer_discard_commit(buffer, event); | 1099 | ring_buffer_discard_commit(buffer, event); |
1101 | else if (!filter_check_discard(file, entry, buffer, event)) | 1100 | return true; |
1102 | return false; | 1101 | } |
1103 | 1102 | ||
1104 | return true; | 1103 | return false; |
1105 | } | 1104 | } |
1106 | 1105 | ||
1107 | /** | 1106 | /** |