perf annotate: Pass filename to objdump via execl
authorIvan Krylov <krylov.r00t@gmail.com>
Sun, 14 Oct 2018 08:18:03 +0000 (11:18 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 4 Jan 2019 15:54:49 +0000 (12:54 -0300)
commit442b4eb3af44906fcbb526d98c314b27f8c9acf3
tree7733b87f0816c18fe1b08cf3d03b814c0044e759
parenta3366db06bb656cef2e03f30f780d93059bcc594
perf annotate: Pass filename to objdump via execl

The symbol__disassemble() function uses shell to launch objdump and
filter its output via grep. Passing filenames by interpolating them into
the command line via "%s" may lead to problems if said filenames contain
special characters.

Instead, pass the filename as a command line argument where it is not
subject to any kind of interpretation, then use quoted shell
interpolation to build the strings we need safely.

Signed-off-by: Ivan Krylov <krylov.r00t@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20181014111803.5d83b806@Tarkus
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c