diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-10-31 21:09:35 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-12-05 13:28:45 -0500 |
commit | 27b14b56af081ec7edeefb3a38b2c9577cc5ef48 (patch) | |
tree | 841e01c8d64fdf08b88c8a76de3272b4630ed145 | |
parent | cb59974742aea24adf6637eb0c4b8e7b48bca6fb (diff) |
tracing: Restore system filter behavior
Though not all events have field 'prev_pid', it was allowed to do this:
# echo 'prev_pid == 100' > events/sched/filter
but commit 75b8e98263fdb0bfbdeba60d4db463259f1fe8a2 (tracing/filter: Swap
entire filter of events) broke it without any reason.
Link: http://lkml.kernel.org/r/4EAF46CF.8040408@cn.fujitsu.com
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | include/linux/ftrace_event.h | 2 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 96efa6794ea5..c3da42dd22ba 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -172,6 +172,7 @@ enum { | |||
172 | TRACE_EVENT_FL_FILTERED_BIT, | 172 | TRACE_EVENT_FL_FILTERED_BIT, |
173 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | 173 | TRACE_EVENT_FL_RECORDED_CMD_BIT, |
174 | TRACE_EVENT_FL_CAP_ANY_BIT, | 174 | TRACE_EVENT_FL_CAP_ANY_BIT, |
175 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, | ||
175 | }; | 176 | }; |
176 | 177 | ||
177 | enum { | 178 | enum { |
@@ -179,6 +180,7 @@ enum { | |||
179 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 180 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
180 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | 181 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), |
181 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | 182 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), |
183 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), | ||
182 | }; | 184 | }; |
183 | 185 | ||
184 | struct ftrace_event_call { | 186 | struct ftrace_event_call { |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index d6e7926dcd26..95dc31efd6dd 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -1649,7 +1649,9 @@ static int replace_system_preds(struct event_subsystem *system, | |||
1649 | */ | 1649 | */ |
1650 | err = replace_preds(call, NULL, ps, filter_string, true); | 1650 | err = replace_preds(call, NULL, ps, filter_string, true); |
1651 | if (err) | 1651 | if (err) |
1652 | goto fail; | 1652 | call->flags |= TRACE_EVENT_FL_NO_SET_FILTER; |
1653 | else | ||
1654 | call->flags &= ~TRACE_EVENT_FL_NO_SET_FILTER; | ||
1653 | } | 1655 | } |
1654 | 1656 | ||
1655 | list_for_each_entry(call, &ftrace_events, list) { | 1657 | list_for_each_entry(call, &ftrace_events, list) { |
@@ -1658,6 +1660,9 @@ static int replace_system_preds(struct event_subsystem *system, | |||
1658 | if (strcmp(call->class->system, system->name) != 0) | 1660 | if (strcmp(call->class->system, system->name) != 0) |
1659 | continue; | 1661 | continue; |
1660 | 1662 | ||
1663 | if (call->flags & TRACE_EVENT_FL_NO_SET_FILTER) | ||
1664 | continue; | ||
1665 | |||
1661 | filter_item = kzalloc(sizeof(*filter_item), GFP_KERNEL); | 1666 | filter_item = kzalloc(sizeof(*filter_item), GFP_KERNEL); |
1662 | if (!filter_item) | 1667 | if (!filter_item) |
1663 | goto fail_mem; | 1668 | goto fail_mem; |