libbtf: Make can't get header message to appear only in verbose mode
This usually means we're trying each of the type loaders (DWARF, BTF, CTF) on some invalid file, so no need to show that message, use verbose mode to get it, so that we show that all loaders are being tried. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
fc2b317db0
commit
63e11400e8
1
libbtf.c
1
libbtf.c
|
@ -191,6 +191,7 @@ struct btf_elf *btf_elf__new(const char *filename, Elf *elf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gelf_getehdr(btfe->elf, &btfe->ehdr) == NULL) {
|
if (gelf_getehdr(btfe->elf, &btfe->ehdr) == NULL) {
|
||||||
|
if (btf_elf__verbose)
|
||||||
fprintf(stderr, "%s: cannot get elf header.\n", __func__);
|
fprintf(stderr, "%s: cannot get elf header.\n", __func__);
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue