linux/tools/perf
Ian Rogers eaab2eb09d perf pmu-events: Parallelize JSON and metric pre-computation in jevents.py
Currently, jevents.py parses hundreds of JSON event and metric files
sequentially across all CPU architectures during Kbuild startup,
taking ~3.5 seconds of single-core execution time.

Refactor jevents.py to pre-populate its internal JSON AST cache in
parallel across all available CPU cores using
ProcessPoolExecutor. First gather all the paths with ftw and
collect_json, then spawn _parallel_read_json_events that starts
workers to just read the json events. Define the worker process
initializer _init_worker so that _arch_std_events is available under
spawn multiprocessing semantics.

This accelerates the JSON parsing phase by over 10x (from ~3.0s down
to ~290ms), reducing overall jevents.py execution time by 3.5x (from
~3.56s down to ~1.03s).

Tested-by: James Clark <james.clark@linaro.org>
Assisted-by: Gemini:gemini-3.1-pro-preview
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2026-07-23 22:59:42 -07:00
..
arch perf test amd ibs: avoid using executable heap 2026-07-04 09:24:02 -07:00
bench perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
check-header_ignore_hunks/lib
dlfilters
Documentation perf stat: Add --hide-zero-events option to suppress zero-count events 2026-07-19 21:49:30 -07:00
include/perf
jvmti
pmu-events perf pmu-events: Parallelize JSON and metric pre-computation in jevents.py 2026-07-23 22:59:42 -07:00
python perf python: Add LiveSession helper 2026-06-30 10:17:19 -07:00
scripts perf cs-etm: Filter synthesized branch samples 2026-07-03 16:51:59 -07:00
tests perf stat: Add --hide-zero-events option to suppress zero-count events 2026-07-19 21:49:30 -07:00
trace perf tools changes for v7.2: 2026-06-23 11:34:49 -07:00
ui perf ui hists: Fix NULL pointer array gap in add_script_opt() 2026-07-17 22:34:06 -07:00
util perf python: Clean up and restructure setup.py 2026-07-23 22:49:39 -07:00
.clang-format perf clang-format: Prioritize Python.h and expand other categories 2026-07-10 17:34:54 -07:00
.gitignore
bpf_skel.mak
Build
builtin-annotate.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf c2c: Fix hist entry and format list leaks in c2c_he_free() 2026-06-17 09:21:03 -03:00
builtin-check.c
builtin-config.c
builtin-daemon.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf cap: Remove used_root parameter and simplify capability checks 2026-07-23 22:46:33 -07:00
builtin-help.c
builtin-inject.c perf python: Use evsel in sample in pyrf_event 2026-06-30 10:17:12 -07:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c perf kvm: Fix a memory leak in the usage string 2026-07-03 13:40:24 -07:00
builtin-kwork.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-list.c
builtin-lock.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-mem.c
builtin-probe.c
builtin-record.c perf record: Fix multiple PERF_RECORD_COMPRESSED2 records per push 2026-07-13 13:25:17 -07:00
builtin-report.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-sched.c perf sched: Free subcommand string after perf sched stats 2026-07-15 16:50:11 -07:00
builtin-script.c perf parse-events: Restrict core PMU bypass to --cputype option 2026-06-30 17:09:13 -07:00
builtin-stat.c perf stat: Add --hide-zero-events option to suppress zero-count events 2026-07-19 21:49:30 -07:00
builtin-timechart.c perf timechart: Fix memory leaks in draw_wakeups() 2026-06-30 17:04:51 -07:00
builtin-top.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-trace.c perf python: Use evsel in sample in pyrf_event 2026-06-30 10:17:12 -07:00
builtin-version.c
builtin.h
check-headers.sh
CREDITS
design.txt
Makefile
Makefile.config perf s390: Fix TEXTREL in Python extension by compiling as PIC 2026-06-10 17:03:53 -03:00
Makefile.perf perf build: Do not pass -static to dlfilters 2026-07-13 13:19:08 -07:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c
perf.h