Re: [PATCH v3 perf,bpf 10/11] perf, bpf: enable annotation of bpf program

From: Jiri Olsa
Date: Sun Feb 17 2019 - 18:06:11 EST


On Fri, Feb 15, 2019 at 01:53:53PM -0800, Song Liu wrote:
> This patch enables the annotation of bpf program.
>
> A new dso type DSO_BINARY_TYPE__BPF_PROG_INFO is introduced to for BPF
> programs. In symbol__disassemble(), DSO_BINARY_TYPE__BPF_PROG_INFO dso
> calls into a new function symbol__disassemble_bpf(), where annotation
> line information is filled based bpf_prog_info and btf saved in given
> perf_env.
>
> symbol__disassemble_bpf() uses libbfd to disassemble bpf programs.
>
> Signed-off-by: Song Liu <songliubraving@xxxxxx>
> ---
> tools/perf/Makefile.config | 6 +-
> tools/perf/util/annotate.c | 149 +++++++++++++++++++++++++++++++++++-
> tools/perf/util/bpf-event.c | 48 ++++++++++++
> tools/perf/util/bpf-event.h | 4 +
> tools/perf/util/dso.c | 1 +
> tools/perf/util/dso.h | 33 +++++---
> tools/perf/util/symbol.c | 1 +
> 7 files changed, 229 insertions(+), 13 deletions(-)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index b441c88cafa1..ab223239f1fb 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -701,7 +701,7 @@ else
> endif
>
> ifeq ($(feature-libbfd), 1)
> - EXTLIBS += -lbfd
> + EXTLIBS += -lbfd -lopcodes

hum, what's this -lopcodes lib? please add it in a separate
patch and explain why it's added and how it affects others
it looks like it could break some distros without that lib

jirka