linux/tools/perf
Ian Rogers eeb70645a8 perf python: Port event_analyzing_sample to perf module
Port event_analyzing_sample.py to a standalone script in
tools/perf/python/ using the perf module and standard library sqlite3
module.

Improvements compared to the legacy script:
- Encapsulate database state in a _DB container instead of mutating
  module-level globals, and ensure temporary SQLite database files are
  cleaned up on exit.
- Add argparse CLI options (-i/--input and -d/--db) while preserving
  PerfEvent, PebsEvent, and PebsNHM binary raw_buf unpacking and
  symbol/DSO histogram reporting.
- Remove Python 2 compatibility code and add type annotations.

Add a shell test (test_event_analyzing_sample_python.sh) to verify the
standalone script.

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:29 +02:00
..
arch perf mem record: Use the IBS swfilt filter when available 2026-09-25 18:14:26 +02:00
bench perf bench numa: Add NULL check after calloc() 2026-09-25 17:02:31 +02:00
check-header_ignore_hunks/lib
dlfilters
Documentation perf mem record: Request PERF_SAMPLE_CPU by default 2026-09-25 18:14:22 +02:00
include/perf
jvmti perf tools: Use calloc() where applicable 2026-04-08 19:21:05 -07:00
pmu-events perf build: Make pylint build test opt-out (NO_PYLINT=1) 2026-09-26 20:49:28 +02:00
python perf python: Port event_analyzing_sample to perf module 2026-09-26 20:49:29 +02:00
scripts tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
tests perf python: Port event_analyzing_sample to perf module 2026-09-26 20:49:29 +02:00
trace perf python: Update syscall helpers and expose arch_strerrno 2026-09-26 20:49:27 +02:00
ui perf tools: Fix typos in comments 2026-09-25 15:11:36 +02:00
util perf build: Make pylint build test opt-out (NO_PYLINT=1) 2026-09-26 20:49:28 +02:00
.clang-format perf tool: Align structs in arrays in .clang-format 2026-09-09 17:03:35 -03:00
.gitignore perf pmu-events: Split big_c_string storage into standalone compilation unit 2026-05-20 17:46:45 -03:00
bpf_skel.mak perf build: Compile BPF skeletons with -mcpu=v3 2026-06-04 10:58:32 -03:00
Build perf build: Make pylint build test opt-out (NO_PYLINT=1) 2026-09-26 20:49:28 +02:00
builtin-annotate.c perf annotate: Default to --itrace=i1i for data type profiling 2026-09-21 08:41:55 +02:00
builtin-bench.c perf bench: Constify tables 2026-04-08 19:21:05 -07:00
builtin-buildid-cache.c perf symbol: Fix ENOENT case for filename__read_build_id 2025-12-17 07:30:51 -08:00
builtin-buildid-list.c perf buildid-list: Fix empty output for AUX data 2026-09-25 00:55:44 +02:00
builtin-c2c.c perf c2c: Add stdio support for the function view 2026-09-25 15:25:07 +02:00
builtin-check.c perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer 2026-06-04 17:34:52 -03:00
builtin-config.c perf tool: Tidy up util/cache.h header file users 2026-09-08 17:50:28 -03:00
builtin-daemon.c perf tools: Replace basename() calls with perf_basename() 2026-04-08 19:21:05 -07:00
builtin-data.c perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer 2026-06-04 17:34:52 -03:00
builtin-diff.c perf tools: Guard test_bit from out-of-bounds sample CPU 2026-06-04 17:34:52 -03:00
builtin-evlist.c
builtin-ftrace.c perf ftrace latency: Do not read trace files when BPF is used 2026-09-08 18:04:33 -03:00
builtin-help.c perf tool: Tidy up util/cache.h header file users 2026-09-08 17:50:28 -03:00
builtin-inject.c perf machine: Add session back pointer to fix out of bounds read 2026-09-25 14:08:40 +02:00
builtin-kallsyms.c
builtin-kmem.c perf trace-event: Report tracepoint format errors with NULL and errno 2026-09-25 14:57:39 +02:00
builtin-kvm.c perf hist: Remove keysym.h include from hist.h 2026-09-08 17:50:37 -03:00
builtin-kwork.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-list.c perf list: Avoid repeated strlen() when escaping JSON strings 2026-09-13 18:44:37 -03:00
builtin-lock.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-mem.c perf mem record: Request PERF_SAMPLE_CPU by default 2026-09-25 18:14:22 +02:00
builtin-probe.c perf tools: Add layout support for --symfs option 2026-03-10 23:13:30 -07:00
builtin-record.c perf record: Fix unhandled POLLHUP on non_perf_event descriptors 2026-09-17 12:27:34 -03:00
builtin-report.c perf config: Add core.hybrid-merge to configure event merging 2026-09-18 17:37:45 -03:00
builtin-sched.c perf sched: Make output_name variable static 2026-09-25 15:12:43 +02:00
builtin-script.c perf tools: Show memory region in perf-script subcommand 2026-09-24 19:29:45 +02:00
builtin-stat.c perf stat: Avoid uninitialized memory read on error 2026-09-09 08:10:17 -03:00
builtin-timechart.c perf timechart: Fix memory leaks in draw_wakeups() 2026-06-30 17:04:51 -07:00
builtin-top.c perf config: Add core.hybrid-merge to configure event merging 2026-09-18 17:37:45 -03:00
builtin-trace.c perf tools: Fix typos in comments 2026-09-25 15:11:36 +02:00
builtin-version.c
builtin.h perf tool: Move usage strings and functions to perf.c 2026-09-08 17:50:32 -03:00
check-headers.sh perf beauty: Move copy of fadvise.h from tools/include/ to tools/perf/trace/beauty/include/ 2026-03-31 20:23:06 -07:00
CREDITS
design.txt
Makefile perf tests: Improvements to build-test performance 2026-09-09 17:00:36 -03:00
Makefile.config perf tools: Bump the minimum Python version to 3.9 2026-09-26 05:21:58 -03:00
Makefile.perf perf Makefile: Install standalone Python scripts during transition 2026-09-26 20:49:28 +02:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf trace-event: Free the global trace_event when a command ends 2026-09-25 14:58:03 +02:00
perf.h