Skip to content

Commit

Permalink
btfdiff: Do type expansion to cover "private" types and enumerations
Browse files Browse the repository at this point in the history
Enumerations are note being printed together with unions and structs,
but they are expanded with 'pahole -E', so using type expansion allows
us to test those as well.

And also helps checking if type expansion from BTF matches the one done
from DWARF. The additional time it takes is negligible and this is is
after all a test script.

Without -E:

  $ time btfdiff vmlinux

  real	0m6.222s
  user	0m13.129s
  sys	0m2.601s
  $

With:

  $ time btfdiff vmlinux

  real	0m6.306s
  user	0m13.230s
  sys	0m2.720s
  $

Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Feb 19, 2024
1 parent 9661c58 commit 786ed0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions btfdiff
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ btf_output=$(mktemp /tmp/btfdiff.btf.XXXXXX)
dwarf_output=$(mktemp /tmp/btfdiff.dwarf.XXXXXX)
pahole_bin=${PAHOLE-"pahole"}

${pahole_bin} -F dwarf \
${pahole_bin} -E -F dwarf \
--flat_arrays \
--sort \
--jobs \
Expand All @@ -34,7 +34,7 @@ ${pahole_bin} -F dwarf \
--show_private_classes $dwarf_input > $dwarf_output &
dwarf=$!

${pahole_bin} -F btf \
${pahole_bin} -E -F btf \
--sort \
--suppress_aligned_attribute \
--suppress_packed \
Expand Down

0 comments on commit 786ed0a

Please sign in to comment.