btf_encoder: detect BTF encoding errors and exit
Don't silently swallow BTF encoding errors and continue onto next CU. If any of CU fails to properly encode BTF, exit with an error message. Signed-off-by: Andrii Nakryiko <andriin@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:
parent
c35b7fa52c
commit
7bc2dd07d5
7
pahole.c
7
pahole.c
|
@ -2379,8 +2379,11 @@ static enum load_steal_kind pahole_stealer(struct cu *cu,
|
|||
goto filter_it;
|
||||
|
||||
if (btf_encode) {
|
||||
cu__encode_btf(cu, global_verbose, btf_encode_force,
|
||||
skip_encoding_btf_vars);
|
||||
if (cu__encode_btf(cu, global_verbose, btf_encode_force,
|
||||
skip_encoding_btf_vars)) {
|
||||
fprintf(stderr, "Encountered error while encoding BTF.\n");
|
||||
exit(1);
|
||||
}
|
||||
return LSK__KEEPIT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue