From: Masami Hiramatsu Date: Fri, 2 Apr 2010 16:50:45 +0000 (-0400) Subject: perf probe: Fix not to return non-matched file X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=c9e385826d4f1ca5a72005ab8503598f791a8dc0;p=deliverable%2Flinux.git perf probe: Fix not to return non-matched file Fix cu_find_realpath() not to return the last file path if that is not matched to input pattern. Signed-off-by: Masami Hiramatsu Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Frederic Weisbecker Cc: systemtap Cc: DLE LKML-Reference: <20100402165045.23551.47780.stgit@localhost6.localdomain6> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index db52ec2e84de..b44132ead95a 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; }