btf_encoder: Move btf_elf__verbose/btf_elf__force setup

With introduction of collect_symbols function, we moved the percpu
variables code before btf_elf__verbose/btf_elf__force setup, so they
don't have any effect in that code anymore.

Also btf_elf__verbose is used in code that prepares ftrace filter for
functions generations, also called within collect_symbols function.

Moving btf_elf__verbose/btf_elf__force setup early in the cu__encode_btf
function, so we can get verbose messages and see the effect of the force
option.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org
Cc: dwarves@vger.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Jiri Olsa 2020-11-16 20:33:48 +01:00 committed by Arnaldo Carvalho de Melo
parent 8156bec8ae
commit d06048c530
1 changed files with 3 additions and 2 deletions

View File

@ -541,6 +541,9 @@ int cu__encode_btf(struct cu *cu, int verbose, bool force,
struct tag *pos;
int err = 0;
btf_elf__verbose = verbose;
btf_elf__force = force;
if (btfe && strcmp(btfe->filename, cu->filename)) {
err = btf_encoder__encode();
if (err)
@ -568,8 +571,6 @@ int cu__encode_btf(struct cu *cu, int verbose, bool force,
printf("File %s:\n", btfe->filename);
}
btf_elf__verbose = verbose;
btf_elf__force = force;
type_id_off = btf__get_nr_types(btfe->btf);
if (!has_index_type) {