From a1e6a310ad84aeb0cbd467bf40187a81f3ffaf12 Mon Sep 17 00:00:00 2001 From: Giuliano Procida Date: Thu, 23 May 2024 09:47:16 +0100 Subject: [PATCH] ANDROID: pahole -J -j1 for reproducible BTF Versions of pahole from 1.22 support multi-threaded operation with separate CUs being processed independently. This results in non-deterministic and effectively non-reproducible output for kernel objects. Later versions of pahole aim to support determinism by retiring CUs in order. We regain determinism by restricting parallelism to 1 at the cost of some performance. The default parallelism of `pahole -J` is the number of online processors * 1.1. Experiments on a workstation with 36 cores reveal that performance is actually worse for `vmlinux` at `-j` (8.9s) than at `-j3` (7.8s) and the optimum is around `-j9` (4.9s). No parallelism is slowest (18.8s), but still acceptable for GKI. Bug: 342094847 Change-Id: Ibd72ac638faa1826f6655b336cc7001591ea70f1 Signed-off-by: Giuliano Procida --- scripts/Makefile.btf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf index 82377e470aed..9aa11a6896fc 100644 --- a/scripts/Makefile.btf +++ b/scripts/Makefile.btf @@ -10,7 +10,7 @@ endif pahole-flags-$(call test-ge, $(pahole-ver), 121) += --btf_gen_floats -pahole-flags-$(call test-ge, $(pahole-ver), 122) += -j +pahole-flags-$(call test-ge, $(pahole-ver), 122) += -j1 pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust