[PATCH dwarves 02/11] btf_encoder: detect BTF encoding errors and exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 pahole.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pahole.c b/pahole.c
index ee5f2f7f76b0..ed87529ce65d 100644
--- a/pahole.c
+++ b/pahole.c
@@ -2363,8 +2363,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;
 	}
 
-- 
2.24.1





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux