linux/tools/perf/tests/shell
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
..
attr perf test attr: Add missing int_mist.uop_dropping event to test-stat files 2025-09-19 12:41:50 -03:00
base_probe perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
base_report perf test perftool_testsuite: Use absolute paths 2025-10-01 09:44:05 -03:00
common perf test perftool_testsuite: Use absolute paths 2025-10-01 09:44:05 -03:00
coresight perf test: Add Arm CoreSight callchain test 2026-07-03 16:52:00 -07:00
lib perf test: Clean up mypy and pylint issues in shell test libraries 2026-09-26 20:49:28 +02:00
addr2line_inlines.sh perf test addr2line_inlines: Ensure inline information shows on LBR leaves 2026-02-06 18:11:31 -03:00
amd-ibs-swfilt.sh perf test ibs: Skip privilege test on Zen6 and newer platforms 2026-05-22 21:31:16 -03:00
annotate_weight.sh perf tools: Add test for weight annotation 2026-09-04 18:21:00 -03:00
annotate.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
attr.sh
buildid.sh perf tests buildid: Add purge and remove testing 2025-12-03 11:07:46 -08:00
c2c.sh perf tests c2c: Add function view stdio coverage 2026-09-25 15:27:17 +02:00
daemon.sh
data_file_offset_diagnostics.sh perf test: Add file offset diagnostic test for corrupted perf.data 2026-06-03 16:31:04 -03:00
data_type_profiling.sh perf test: Skip data_type_profiling when the PMU cannot record memory events 2026-09-17 12:22:07 -03:00
data_validation.sh perf test: Add truncated perf.data robustness test 2026-05-29 11:44:35 -03:00
diff.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
drm_pmu.sh perf tests: Add a DRM PMU test 2025-06-25 11:12:35 -07:00
evlist.sh perf test: Fix test perf evlist for z/VM s390x 2026-01-26 18:21:20 -03:00
ftrace.sh perf test: Fix nanosleep check in the ftrace test 2026-05-11 14:15:49 -03:00
header.sh perf header: Fix pipe mode header dumping 2025-07-03 11:22:17 -07:00
inject_aslr.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
inject-callchain.sh perf test: Add DWARF callchain conversion test 2026-01-20 17:18:24 -03:00
jitdump-python.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
kallsyms.sh perf tests kallsyms: Add basic kallsyms test 2025-12-03 11:07:47 -08:00
kvm.sh perf test: Extend perf kvm tests to check default event 2026-07-03 13:40:24 -07:00
kwork.sh perf tests kwork: Add basic kwork coverage tests 2026-04-02 19:44:45 -07:00
list.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
lock_contention.sh perf tests: Restore -p flag to lock contention test 2026-07-09 17:44:22 -07:00
perf_sched_stats.sh perf test: Skip sched stats test for !root 2026-04-05 23:27:51 -07:00
perf-report-hierarchy.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
perftool-testsuite_probe.sh perf test: Skip perf probe tests when running as non-root 2025-03-05 09:17:01 -08:00
perftool-testsuite_report.sh perf test: Tag parallel failing shell tests with "(exclusive)" 2024-10-28 09:32:58 -07:00
pipe_test.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
probe_vfs_getname.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
python-use.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
record_bpf_filter.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
record_lbr.sh perf tests: Add robust record retry helper and use subsecond workloads 2026-06-30 17:09:13 -07:00
record_offcpu.sh perf tests: Speed up off-cpu profiling tests 2026-06-30 17:09:14 -07:00
record_sideband.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
record_weak_term.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
record.sh perf test: Fix record tests on hybrid machines 2026-09-25 12:50:28 +02:00
record+probe_libc_inet_pton.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
record+script_probe_vfs_getname.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
record+zstd_comp_decomp_multi_record.sh perf record: Fix multiple PERF_RECORD_COMPRESSED2 records per push 2026-07-13 13:25:17 -07:00
record+zstd_comp_decomp.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
report_hybrid_merge.sh perf test: Expand tests for --hybrid-merge 2026-09-18 17:38:26 -03:00
sched.sh perf sched latency: Add histogram and time interval options 2026-08-07 10:56:23 -07:00
script_dlfilter.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
script_perl.sh perf test script: Add perl script testing support 2026-02-12 17:45:23 -03:00
script_python.sh perf test script: Add python script testing support 2026-02-12 17:45:23 -03:00
script.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat_all_metricgroups.sh perf test: Do not skip when some metric-group tests succeed 2026-01-13 17:21:56 -03:00
stat_all_metrics.sh perf tests: Speed up metrics checking shell tests 2026-06-30 17:09:14 -07:00
stat_all_pfm.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat_all_pmu.sh perf test stat_all_pmu.sh: Correctly check 'perf stat' result 2025-03-14 10:41:34 -07:00
stat_bpf_counters_cgrp.sh perf test: Update test for --for-each-cgroup option 2026-07-16 10:35:23 -07:00
stat_bpf_counters.sh perf tests: Fix flakiness in BPF counters test on hybrid systems 2026-06-30 17:09:14 -07:00
stat_metrics_cgrp.sh perf test stat metrics cgroup: Strip possible slash from cgroup name 2026-09-25 17:42:21 +02:00
stat_metrics_values.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
stat.sh perf test: perf stat tests fails on s390 2026-09-08 17:54:53 -03:00
stat+csv_output.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
stat+csv_summary.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat+event_uniquifying.sh perf test: Avoid uncore_imc/clockticks in uniquification test 2025-09-19 16:50:21 -03:00
stat+json_output.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
stat+shadow_stat.sh perf test stat: Update shadow test to use metrics 2025-11-11 16:48:35 -08:00
stat+std_output.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
test_arm_callgraph_fp.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
test_arm_spe_fork.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_arm_spe.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_bpf_metadata.sh perf test: Checking BPF metadata collection fails on version string 2025-09-04 16:37:19 -07:00
test_brstack.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
test_data_symbol.sh perf mem record: Use the IBS swfilt filter when available 2026-09-25 18:14:26 +02:00
test_dwarf_unwind_multithreaded.sh perf unwind-libdw: Fix unwinding of multi-threaded processes 2026-07-31 15:31:20 -07:00
test_event_analyzing_sample_python.sh perf python: Port event_analyzing_sample to perf module 2026-09-26 20:49:29 +02:00
test_event_open_fallback.sh perf test: Avoid call to missing cleanup function 2026-09-08 18:13:52 -03:00
test_flamegraph_python.sh perf python: Port flamegraph to perf module 2026-09-26 20:49:28 +02:00
test_gecko_python.sh perf python: Port gecko to perf module 2026-09-26 20:49:28 +02:00
test_intel_pt.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
test_java_symbol.sh perf test java symbol: Additional libperf-jvmti.so path check 2026-01-06 19:06:00 -03:00
test_mem_phys_addr_python.sh perf python: Port mem-phys-addr to perf module 2026-09-26 20:49:28 +02:00
test_perf_data_converter_ctf.sh perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer 2026-06-04 17:34:52 -03:00
test_perf_data_converter_json.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
test_stackcollapse_python.sh perf python: Port stackcollapse to perf module 2026-09-26 20:49:28 +02:00
test_stat_cpi_python.sh perf python: Port stat-cpi to perf module 2026-09-26 20:49:28 +02:00
test_stat_intel_tpebs.sh perf test: Extra verbosity and hypervisor skip for tpebs test 2025-02-03 19:45:50 -08:00
test_task_analyzer.sh perf tests: Write test files to tmpdir 2026-04-01 14:50:53 -07:00
test_test_junit_output.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
test_uprobe_from_different_cu.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
timechart.sh perf test: Update perf timechart test 2026-06-30 17:04:51 -07:00
top.sh perf test: Expand tests for --hybrid-merge 2026-09-18 17:38:26 -03:00
trace_btf_enum.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
trace_btf_general.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
trace_exit_race.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
trace_ksym_beautifier.sh perf tests: Add shell test for kernel symbol beautifier 2026-09-04 18:14:52 -03:00
trace_record_replay.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
trace_summary.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00
trace+probe_vfs_getname.sh perf test: Remove redundant shellcheck source paths 2026-09-25 00:55:45 +02:00