Re: [PATCH 1/2] perf tools: Ensure --symfs ends with '/'

From: Arnaldo Carvalho de Melo
Date: Tue Jul 29 2014 - 11:13:04 EST


Em Tue, Jul 29, 2014 at 10:26:57PM +0900, Minchan Kim escreveu:
> On Tue, Jul 29, 2014 at 09:33:05AM -0300, Arnaldo Carvalho de Melo wrote:
> > Can you please try the patch below instead?
>
> Tested. It works.
> And I'd like to say that [2/2] in patchset is handy to me.

Ok, here it is, refreshed, will apply with Namhyung as author as the
change should be functionally equivalent to what he did.

Please check that it works as expected,

Thanks,

- Arnaldo

---

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index c3549d5955ea..223a7ffe0d93 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1862,13 +1862,21 @@ int symbol__init(void)
symbol_conf.sym_list_str, "symbol") < 0)
goto out_free_comm_list;

+ if (symbol_conf.symfs[0] != '\0') {
+ symfs = realpath(symbol_conf.symfs, NULL);
+ if (symfs == NULL) {
+ pr_debug("Cannot apply symfs: %s: %s\n",
+ symbol_conf.symfs, strerror(errno));
+ return -1;
+ }
+ } else {
+ symfs = symbol_conf.symfs;
+ }
+
/*
* A path to symbols of "/" is identical to ""
* reset here for simplicity.
*/
- symfs = realpath(symbol_conf.symfs, NULL);
- if (symfs == NULL)
- symfs = symbol_conf.symfs;
if (strcmp(symfs, "/") == 0)
symbol_conf.symfs = "";
if (symfs != symbol_conf.symfs)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/