All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] perf annotate: Add elfutils libasm disassembler support
@ 2026-06-09  7:07 Ian Rogers
  2026-06-09  7:07 ` [PATCH v2 1/7] tools build: Add feature check for elfutils libasm Ian Rogers
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Ian Rogers @ 2026-06-09  7:07 UTC (permalink / raw)
  To: Serhei Makarov, mark, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Jiri Olsa, Ian Rogers,
	Adrian Hunter, James Clark, Nick Terrell, David Sterba,
	Nathan Chancellor, Tomas Glozar, Blake Jones, Dmitrii Dolgov,
	Alexandre Chartre, Costa Shulyupin, Yuzhuo Jing, Michael Jeanson,
	Leo Yan, Tianyou Li, Zecheng Li, Rong Bao, linux-kernel,
	linux-perf-users, bpf

This series adds a new `libasm` disassembly backend to `perf annotate`,
leveraging the `elfutils` libasm library. This allows perf to use the
widely available elfutils for disassembly alongside capstone, libLLVM, and objdump.

v2 changes:
- Patch 1: Added a note to the commit message acknowledging that older elfutils static builds lacking `-lebl` dependencies in pkg-config are explicitly unsupported, while intentionally retaining the feature check and API dependencies.
- Patch 2: Fixed `NO_LIBELF=1` build breakages by implicitly disabling `libasm` and removing the unconditional `#warning` in favor of silent fallbacks or standard warnings.
- Patch 3: Fixed `libasm` block boundary tracking and corrected callback error/return values, preventing memory leaks and infinite loops in the disassembly extraction loop.
- Patch 5: Fixed script robustness in `tests/shell/annotate.sh` by ensuring cleanup functions run reliably, `set -e` doesn't abort prematurely on grep failures, and configs are properly restored.
- Patch 6: Refactored `jit_write_elf` to accept the `e_machine` parameter directly instead of post-patching the generated ELF file with `libelf`. The target architecture is now extracted dynamically and passed into `jit_write_elf`, simplifying the interaction with BPF and making it fully compatible with all disassemblers.
- Patch 7: Fixed a TOCTOU race condition when creating the symlink in `tests/shell/annotate.sh` by placing `perf.data` inside an isolated temporary directory.
- General: The cover letter now lists capstone, libLLVM, and objdump as the existing disassemblers instead of just objdump.

Ian Rogers (7):
  tools build: Add feature check for elfutils libasm
  perf build: Add build support and capability for elfutils libasm
  perf annotate: Implement elfutils libasm disassembler backend
  perf annotate: Add --disassembler command-line option
  perf test: Enhance annotate test coverage and isolate config
  perf annotate: Support BPF JIT disassembly via genelf
  perf test: Add BPF JIT annotation test coverage for all disassemblers

 tools/build/Makefile.feature       |   2 +
 tools/build/feature/Makefile       |   9 ++
 tools/build/feature/test-libasm.c  |  19 +++
 tools/perf/Makefile.config         |  22 ++++
 tools/perf/builtin-annotate.c      |  10 ++
 tools/perf/builtin-check.c         |   1 +
 tools/perf/tests/genelf.c          |   2 +-
 tools/perf/tests/shell/annotate.sh | 133 +++++++++++++++++++++
 tools/perf/util/Build              |   1 +
 tools/perf/util/annotate.c         |   8 +-
 tools/perf/util/annotate.h         |   3 +
 tools/perf/util/disasm.c           | 114 +++++++++++++++++-
 tools/perf/util/disasm.h           |   1 +
 tools/perf/util/genelf.c           |   4 +-
 tools/perf/util/genelf.h           |   2 +-
 tools/perf/util/jitdump.c          |   2 +-
 tools/perf/util/libasm.c           | 184 +++++++++++++++++++++++++++++
 tools/perf/util/libasm.h           |  27 +++++
 18 files changed, 531 insertions(+), 13 deletions(-)
 create mode 100644 tools/build/feature/test-libasm.c
 create mode 100644 tools/perf/util/libasm.c
 create mode 100644 tools/perf/util/libasm.h

--
2.54.0.1064.gd145956f57-goog

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-06-09  7:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09  7:07 [PATCH v2 0/7] perf annotate: Add elfutils libasm disassembler support Ian Rogers
2026-06-09  7:07 ` [PATCH v2 1/7] tools build: Add feature check for elfutils libasm Ian Rogers
2026-06-09  7:21   ` sashiko-bot
2026-06-09  7:07 ` [PATCH v2 2/7] perf build: Add build support and capability " Ian Rogers
2026-06-09  7:19   ` sashiko-bot
2026-06-09  7:07 ` [PATCH v2 3/7] perf annotate: Implement elfutils libasm disassembler backend Ian Rogers
2026-06-09  7:07 ` [PATCH v2 4/7] perf annotate: Add --disassembler command-line option Ian Rogers
2026-06-09  7:07 ` [PATCH v2 5/7] perf test: Enhance annotate test coverage and isolate config Ian Rogers
2026-06-09  7:15   ` sashiko-bot
2026-06-09  7:07 ` [PATCH v2 6/7] perf annotate: Support BPF JIT disassembly via genelf Ian Rogers
2026-06-09  7:22   ` sashiko-bot
2026-06-09  7:07 ` [PATCH v2 7/7] perf test: Add BPF JIT annotation test coverage for all disassemblers Ian Rogers
2026-06-09  7:18   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.