This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH -tip 2/4] [BUGFIX] perf probe: Fix not to return non-matched file
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Ingo Molnar <mingo at elte dot hu>, lkml<linux-kernel at vger dot kernel dot org>
- Cc: Paul Mackerras <paulus at samba dot org>, Arnaldo Carvalho de Melo <acme at redhat dot com>, Peter Zijlstra <peterz at infradead dot org>, Mike Galbraith <efault at gmx dot de>, Frederic Weisbecker <fweisbec at gmail dot com>, systemtap<systemtap at sources dot redhat dot com>, DLE<dle-develop at lists dot sourceforge dot net>
- Date: Fri, 02 Apr 2010 12:50:45 -0400
- Subject: [PATCH -tip 2/4] [BUGFIX] perf probe: Fix not to return non-matched file
- References: <20100402165031.23551.14034.stgit@localhost6.localdomain6>
Fix cu_find_realpath() not to return the last file path
if that is not matched to input pattern.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
---
tools/perf/util/probe-finder.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index db52ec2..b44132e 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -183,6 +183,8 @@ static const char *cu_find_realpath(Dwarf_Die *cu_die, const char *fname)
if (strtailcmp(src, fname) == 0)
break;
}
+ if (i == nfiles)
+ return NULL;
return src;
}
--
Masami Hiramatsu
e-mail: mhiramat@redhat.com