perf annotate: Use libsubcmd's run-command.h to fork objdump
authorIan Rogers <irogers@google.com>
Thu, 10 Oct 2019 18:36:46 +0000 (11:36 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 15 Oct 2019 11:39:01 +0000 (08:39 -0300)
commit4235949944d1bb244c85fd184cdc2f78e9df848b
tree2fc8450f7a72b813de3328e4724889cf6f94acf5
parent353dcaa2f979a04f9397306ae3165ccf9fc731df
perf annotate: Use libsubcmd's run-command.h to fork objdump

Reduce duplicated logic by using the subcmd library. Ensure when errors
occur they are reported to the caller. Before this patch, if no lines
are read the error status is 0.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: clang-built-linux@googlegroups.com
Link: http://lore.kernel.org/lkml/20191010183649.23768-3-irogers@google.com
Link: http://lore.kernel.org/lkml/20191015003418.62563-1-irogers@google.com
[ merged follow up fix for NULL termination as in the 2nd link above ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c