perf annotate: Don't return -1 for error when doing BPF disassembly
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 30 Sep 2019 19:04:21 +0000 (16:04 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 30 Sep 2019 20:30:06 +0000 (17:30 -0300)
commit11aad897f6d1a28eae3b7e5b293647c522d65819
tree033e594c5e32ee2287b81d42cb3e345b6ab13424
parent16ed3c1e91159e28b02f11f71ff4ce4cbc6f99e4
perf annotate: Don't return -1 for error when doing BPF disassembly

Return errno when open_memstream() fails and add two new speciall error
codes for when an invalid, non BPF file or one without BTF is passed to
symbol__disassemble_bpf(), so that its callers can rely on
symbol__strerror_disassemble() to convert that to a human readable error
message that can help figure out what is wrong, with hints even.

Cc: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Song Liu <songliubraving@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Cc: Will Deacon <will@kernel.org>
Link: https://lkml.kernel.org/n/tip-usevw9r2gcipfcrbpaueurw0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c
tools/perf/util/annotate.h