linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixed a pathing issue with objdump and grep
@ 2017-05-03 12:12 Adam Stylinski
  2017-05-05 12:57 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Stylinski @ 2017-05-03 12:12 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel

The path fed to the argument for objdump used in the perf-annotate
feature didn't escape spaces. The subsequent argument to grep for
the name of the DSO containing symbols also assumed no spaces existed
in the pathname, so grep also parsed these as extra positional
arguments.

Signed-off-by: Adam E Stylinski <adam.stylinski@etegent.com>
---
 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 7aa57225cbf7..fc5a96d584f2 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1441,7 +1441,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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fixed a pathing issue with objdump and grep
  2017-05-03 12:12 [PATCH] Fixed a pathing issue with objdump and grep Adam Stylinski
@ 2017-05-05 12:57 ` Arnaldo Carvalho de Melo
  2017-05-05 13:22   ` Ravi Bangoria
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-05-05 12:57 UTC (permalink / raw)
  To: Adam Stylinski
  Cc: Ravi Bangoria, Alexander Shishkin, Christian Borntraeger,
	Peter Zijlstra, Taeung Song, linux-kernel

Em Wed, May 03, 2017 at 12:12:23PM +0000, Adam Stylinski escreveu:
> The path fed to the argument for objdump used in the perf-annotate
> feature didn't escape spaces. The subsequent argument to grep for
> the name of the DSO containing symbols also assumed no spaces existed
> in the pathname, so grep also parsed these as extra positional
> arguments.

This one didn't apply to tip/perf/urgent, so I tried another patch
addressing the same issue, from Ravi Bangoria, and it applied, ok?

Please take a look at:

 http://lkml.kernel.org/r/20170505101417.2117-1-ravi.bangoria@linux.vnet.ibm.com

- Arnaldo
 
> Signed-off-by: Adam E Stylinski <adam.stylinski@etegent.com>
> ---
>  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 7aa57225cbf7..fc5a96d584f2 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -1441,7 +1441,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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fixed a pathing issue with objdump and grep
  2017-05-05 12:57 ` Arnaldo Carvalho de Melo
@ 2017-05-05 13:22   ` Ravi Bangoria
  2017-05-05 13:30     ` Ravi Bangoria
  0 siblings, 1 reply; 4+ messages in thread
From: Ravi Bangoria @ 2017-05-05 13:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Adam Stylinski
  Cc: Alexander Shishkin, Christian Borntraeger, Peter Zijlstra,
	Taeung Song, linux-kernel, Ravi Bangoria



On Friday 05 May 2017 06:27 PM, Arnaldo Carvalho de Melo wrote:
> Em Wed, May 03, 2017 at 12:12:23PM +0000, Adam Stylinski escreveu:
>> The path fed to the argument for objdump used in the perf-annotate
>> feature didn't escape spaces. The subsequent argument to grep for
>> the name of the DSO containing symbols also assumed no spaces existed
>> in the pathname, so grep also parsed these as extra positional
>> arguments.
> This one didn't apply to tip/perf/urgent, so I tried another patch
> addressing the same issue, from Ravi Bangoria, and it applied, ok?

Oh, I was not aware about this patch. Coincidently, I sent the same fix. :)

Ravi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fixed a pathing issue with objdump and grep
  2017-05-05 13:22   ` Ravi Bangoria
@ 2017-05-05 13:30     ` Ravi Bangoria
  0 siblings, 0 replies; 4+ messages in thread
From: Ravi Bangoria @ 2017-05-05 13:30 UTC (permalink / raw)
  To: Adam Stylinski
  Cc: Arnaldo Carvalho de Melo, Alexander Shishkin,
	Christian Borntraeger, Peter Zijlstra, Taeung Song, linux-kernel,
	Ravi Bangoria



On Friday 05 May 2017 06:52 PM, Ravi Bangoria wrote:
>
> On Friday 05 May 2017 06:27 PM, Arnaldo Carvalho de Melo wrote:
>> Em Wed, May 03, 2017 at 12:12:23PM +0000, Adam Stylinski escreveu:
>>> The path fed to the argument for objdump used in the perf-annotate
>>> feature didn't escape spaces. The subsequent argument to grep for
>>> the name of the DSO containing symbols also assumed no spaces existed
>>> in the pathname, so grep also parsed these as extra positional
>>> arguments.
>> This one didn't apply to tip/perf/urgent, so I tried another patch
>> addressing the same issue, from Ravi Bangoria, and it applied, ok?
> Oh, I was not aware about this patch. Coincidently, I sent the same fix. :)

BTW, Adam, Looks like you have older code. The same line was recently
changed by Taeung Song in commit e7cb9de211ebb29. I don't see that
change in your code.

Ravi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-05 13:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 12:12 [PATCH] Fixed a pathing issue with objdump and grep Adam Stylinski
2017-05-05 12:57 ` Arnaldo Carvalho de Melo
2017-05-05 13:22   ` Ravi Bangoria
2017-05-05 13:30     ` Ravi Bangoria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).