aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2024-02-17 12:13:41 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-02-17 12:13:41 -0300
commita25293a66b737263fd4545752077c098dd19ed26 (patch)
treee824205351cabc8ed303be564224ef1ecff53481
parente52cf114039af8f3df25a707235d382c96847104 (diff)
downloadpahole-a25293a66b737263fd4545752077c098dd19ed26.tar.gz
btfdiff: Parallelize loading BTF and DWARF
DWARF is already loaded in parallel, one thread per CPU, we did it for BTF encoding that is used when building the kernel. Now just start that in parallel for pretty printing from DWARF and then do it for BTF, then wait for DWARF to finish to continue and do the diff. Not a big deal with a 28 core i7 14700 Intel Rocket Lake refresh with 28 cores (a mix of efficiency and performance cores), but maybe with more and more cores this may end up making _some_ difference. The patch is so small, and since I tried it, keep it. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xbtfdiff6
1 files changed, 5 insertions, 1 deletions
diff --git a/btfdiff b/btfdiff
index 22121b0f..33e0717b 100755
--- a/btfdiff
+++ b/btfdiff
@@ -31,13 +31,17 @@ ${pahole_bin} -F dwarf \
--suppress_force_paddings \
--suppress_packed \
--lang_exclude rust \
- --show_private_classes $dwarf_input > $dwarf_output
+ --show_private_classes $dwarf_input > $dwarf_output &
+dwarf=$!
+
${pahole_bin} -F btf \
--sort \
--suppress_aligned_attribute \
--suppress_packed \
$btf_input > $btf_output
+wait $dwarf
+
diff -up $dwarf_output $btf_output
rm -f $btf_output $dwarf_output