diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2010-01-14 10:53:21 +0800 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-01-14 22:38:05 -0500 |
commit | 285caad415f459f336247932b4db95a571357a02 (patch) | |
tree | b4372c5336dee9919f26c61a4808ef08993a43a6 /kernel/trace | |
parent | 751e9983ee276cb150e8812b1d995f6035a63878 (diff) | |
download | linux-285caad415f459f336247932b4db95a571357a02.tar.gz linux-285caad415f459f336247932b4db95a571357a02.tar.bz2 linux-285caad415f459f336247932b4db95a571357a02.zip |
tracing/filters: Fix MATCH_FRONT_ONLY filter matching
MATCH_FRONT_ONLY actually is a full matching:
# ./perf record -R -f -a -e lock:lock_acquire \
--filter 'name ~rcu_*' sleep 1
# ./perf trace
(no output)
We should pass the length of the pattern string to strncmp().
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4B4E8721.5090301@cn.fujitsu.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_events_filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 50504cb228de..11c3973e6552 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -261,7 +261,7 @@ static int regex_match_full(char *str, struct regex *r, int len) static int regex_match_front(char *str, struct regex *r, int len) { - if (strncmp(str, r->pattern, len) == 0) + if (strncmp(str, r->pattern, r->len) == 0) return 1; return 0; } |