[PATCH] Fixed issue in perf annotate with unescaped spaces

From: Adam Stylinski
Date: Fri May 05 2017 - 10:59:01 EST


Perf annotate was calling both objdump and grep with arguments that
didn't escape spaces, causing perf annotate to fail on DSOs which
had spaces in their paths. This wraps those arguments in quotes.
---
 tools/perf/util/annotate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)




diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 683f8340460c..5359a42ebd6e 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1429,7 +1429,7 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na
    snprintf(command, sizeof(command),
         "%s %s%s --start-address=0x%016" PRIx64
         " --stop-address=0x%016" PRIx64
-        " -l -d %s %s -C %s 2>/dev/null|grep -v %s:|expand",
+        " -l -d %s %s -C \"%s\" 2>/dev/null|grep -v \"%s\":|expand",
         objdump_path ? objdump_path : "objdump",
         disassembler_style ? "-M " : "",
         disassembler_style ? disassembler_style : "",
-- 
2.12.2