linux/tools/perf/python
Ian Rogers f66944587d perf python: Add Intel PT call_return and itrace capability
Add support for Intel PT call_return events and itrace options to the
perf Python extension so standalone Python scripts can decode and
inspect low-level instruction traces.

Specifically:
- Add a call_return callback parameter and itrace option string to
  perf.session, treating explicit None (Py_None) callbacks as omitted.
- Expose the perf.call_return object with db_id, parent_id, insn_count,
  cyc_count, comm, pid, tid, call_time, return_time, branch_count,
  call_ref, return_ref, flags, and call_path (resolved as a
  perf.callchain ordered from outermost caller to callee, populating
  frame->map and frame->sym so call_path entries expose resolved symbol
  and DSO names).
- Export perf.CALL_RETURN_NO_CALL, perf.CALL_RETURN_NO_RETURN, and
  perf.CALL_RETURN_NON_CALL flag constants.
- Expose session.e_machine and session.is_64_bit properties, preferring
  recorded thread ELF machines (perf_session__e_machine) over perf_env
  so pipe-mode traces do not prematurely cache host bitness.
- Support optional vmlinux, kallsyms, and symfs symbol configuration
  parameters (and PERF_SYMBOL_VMLINUX, PERF_SYMBOL_KALLSYMS,
  PERF_SYMBOL_SYMFS environment fallbacks) in perf.session, resetting
  symbol_conf pointers and freeing vm_tm_corr_args, cpu_bitmap, and
  ptime_range in pyrf_session__delete().

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-09-26 20:49:27 +02:00
..
counting.py perf python: Improve perf script -l descriptions 2026-09-26 20:49:27 +02:00
ilist.py perf python: Clean up pylint warnings in ilist.py 2026-09-26 20:49:27 +02:00
perf_live.py perf python: Add LiveSession helper 2026-06-30 10:17:19 -07:00
perf.pyi perf python: Add Intel PT call_return and itrace capability 2026-09-26 20:49:27 +02:00
tracepoint.py perf python: Improve perf script -l descriptions 2026-09-26 20:49:27 +02:00
treport.py perf python: Clean up pylint warnings in treport.py 2026-09-26 20:49:27 +02:00
twatch.py perf python: Improve perf script -l descriptions 2026-09-26 20:49:27 +02:00