[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1406251908-8195-2-git-send-email-namhyung@kernel.org>
Date: Fri, 25 Jul 2014 10:31:48 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Namhyung Kim <namhyung.kim@....com>,
Namhyung Kim <namhyung@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Jiri Olsa <jolsa@...hat.com>, David Ahern <dsahern@...il.com>,
Minchan Kim <minchan@...nel.org>
Subject: [PATCH 2/2] perf tools: Check validity of --symfs value
If a symfs is given by user, it needs to be checked before applying.
Currently, it just uses it even if realpath() failed.
I guess it's because it needed to handle empty symfs which is the
default value. But now it's only called when it's not empty so it'd
be better to check before using it and warn users if failed.
Cc: Minchan Kim <minchan@...nel.org>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/util/symbol.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 90723a12e947..95186185c1d5 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1864,8 +1864,11 @@ int symbol__init(void)
if (*symbol_conf.symfs) {
symfs = realpath(symbol_conf.symfs, NULL);
- if (symfs == NULL)
- symfs = (char *)symbol_conf.symfs;
+ if (symfs == NULL) {
+ pr_err("cannot apply symfs: %s: %s\n",
+ symbol_conf.symfs, strerror(errno));
+ return -1;
+ }
/*
* A path to symbols of "/" is identical to ""
--
2.0.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists