Dwarves debugging tools
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Clark Williams <williams@redhat.com>,
	dwarves@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH v2 0/9] pahole: Support cross-CU type references and dwz alternate debug files
Date: Fri, 21 Aug 2026 18:34:59 -0300	[thread overview]
Message-ID: <20260821213510.22423-1-acme@kernel.org> (raw)

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Add support for cross-CU type references and dwz alternate debug
files so pahole can process binaries (e.g. a perf binary with rust
objects, or Firefox) that use DW_FORM_ref_addr inter-CU references or
dwz-compressed .dwz alternate debug files.

Cross-CU type references:

  Force-merge CUs that contain inter-CU references (DW_FORM_ref_addr)
  so type lookups resolve correctly.  Handle same-file partial units
  where types are shared across CUs via DW_TAG_imported_unit.  Fix
  cus__merging_cu failing to detect DW_FORM_ref_addr when
  DW_FORM_implicit_const causes dwarf_getabbrevattr() to fail.

dwz alternate debug file support:

  Handle DW_FORM_GNU_ref_alt references to dwz-compressed alternate
  debug files (.dwz).  Pre-processes all alternate partial units with
  separate hash tables and dedup tracking.

  Before (Firefox): 1774 "has no entry in cu" errors
  After:             processes cleanly with 0 errors

Also add an inter-CU type reference comparison test and
scripts/vmlinux_comparison.py for DWARF/BTF analysis across kernel
configs.

What changed from v1:

  v1 (12 patches) also carried the Rust enum discriminant support
  (DW_TAG_variant_part population, BTF union-member encoding and
  DW_FORM_block discriminant handling, plus tests/block_endian.sh).
  That work is being submitted as a separate series based on this one,
  so v2 drops those 3 patches and the block_endian.sh test.  The
  remaining 9 patches are the cross-CU reference and dwz alternate
  debug file support, now self-contained (tests/dwz_alt_file.sh and
  tests/inter_cu_refs.sh are included).

Best regards,

- Arnaldo

Assisted-by: opencode:hy3-free

Arnaldo Carvalho de Melo (9):
  dwarf_loader: Initial support for DW_TAG_variant_part
  dwarf_loader: Initial support for DW_TAG_subprogram in
    DW_TAG_enumeration
  dwarf_loader: Allow forcing the merge of CUs for solving inter CU tag
    references
  dwarf_loader: Support DW_TAG_imported_unit for same-file partial units
  dwarf_loader: Fix cus__merging_cu failing to detect DW_FORM_ref_addr
  tests: Add inter-CU type reference comparison test
  dwarf_loader: Add cu parameter to tag__set_spec() and
    dwarf_tag__set_attr_type()
  dwarf_loader: Support DW_FORM_GNU_ref_alt references to dwz alternate
    debug files
  scripts: Add vmlinux_comparison.py for DWARF/BTF analysis

 btf_encoder.c                 |  22 +-
 ctf_encoder.c                 |  26 +-
 dwarf_loader.c                | 829 ++++++++++++++++++++++++++++++----
 dwarves.c                     |  44 +-
 dwarves.h                     |  20 +-
 dwarves_emit.c                |  10 +-
 dwarves_fprintf.c             |  54 ++-
 man-pages/pahole.1            |  19 +-
 pahole.c                      |  28 +-
 scripts/vmlinux_comparison.py | 612 +++++++++++++++++++++++++
 tests/dwz_alt_file.sh         | 204 +++++++++
 tests/inter_cu_refs.sh        |  50 ++
 tests/prettify_perf.data.sh   |   4 +-
 13 files changed, 1801 insertions(+), 121 deletions(-)
 create mode 100755 scripts/vmlinux_comparison.py
 create mode 100755 tests/dwz_alt_file.sh
 create mode 100755 tests/inter_cu_refs.sh

-- 
2.55.0


             reply	other threads:[~2026-08-21 21:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 21:34 Arnaldo Carvalho de Melo [this message]
2026-08-21 21:35 ` [PATCH v2 1/9] dwarf_loader: Initial support for DW_TAG_variant_part Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 2/9] dwarf_loader: Initial support for DW_TAG_subprogram in DW_TAG_enumeration Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 3/9] dwarf_loader: Allow forcing the merge of CUs for solving inter CU tag references Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 4/9] dwarf_loader: Support DW_TAG_imported_unit for same-file partial units Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 5/9] dwarf_loader: Fix cus__merging_cu failing to detect DW_FORM_ref_addr Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 6/9] tests: Add inter-CU type reference comparison test Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 7/9] dwarf_loader: Add cu parameter to tag__set_spec() and dwarf_tag__set_attr_type() Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 8/9] dwarf_loader: Support DW_FORM_GNU_ref_alt references to dwz alternate debug files Arnaldo Carvalho de Melo
2026-08-21 21:35 ` [PATCH v2 9/9] scripts: Add vmlinux_comparison.py for DWARF/BTF analysis Arnaldo Carvalho de Melo
2026-08-26  0:52 ` [PATCH v2 0/9] pahole: Support cross-CU type references and dwz alternate debug files Arnaldo Carvalho de Melo
2026-08-26 11:43   ` Alan Maguire
2026-08-26 13:10     ` Arnaldo Carvalho de Melo
2026-08-28 14:05       ` Alan Maguire
2026-08-28 22:59         ` Arnaldo Carvalho de Melo
2026-08-29 20:21           ` RFT: coverage analysis and lots more regression tests in the 'next' branch. Was: " Arnaldo Carvalho de Melo
2026-08-30 17:08             ` Alan Maguire
2026-08-31  0:18               ` Arnaldo Carvalho de Melo
2026-08-31  0:48                 ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260821213510.22423-1-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=alan.maguire@oracle.com \
    --cc=dwarves@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox