From: Ian Rogers Date: Mon, 18 May 2026 15:46:27 +0000 (-0700) Subject: perf build: Decouple pmu-events from prepare umbrella target X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9453fa7726a225de8f80279e6085e164b3fc5a1;p=thirdparty%2Fkernel%2Fstable.git perf build: Decouple pmu-events from prepare umbrella target Currently, the $(LIBPMU_EVENTS_IN) sub-make depends on the massive "prepare" umbrella target. Because "prepare" depends on external libraries (libapi, libperf, etc.) as well as dozens of generated headers, make completely serializes the launch of the pmu-events sub-make behind some of those unrelated prerequisites. Since pmu-events is a large compilation unit, unblock its startup by binding it directly to only $(LIBPERF) instead of prepare. This allows background python generation scripts to overlap simultaneously with the rest of the build. Testing a parallel build (make -j28 clean all) shows improvements: Before: real 0m27.642s user 2m32.356s sys 0m26.683s After: real 0m22.254s user 2m32.810s sys 0m24.646s This reclaims over 5 full seconds of build latency (~19.5% overall reduction) by elevating average CPU concurrency from ~5.5 active cores up to ~8 active cores. Reviewed-by: Namhyung Kim Assisted-by: Gemini:gemini-3.1-pro-preview Signed-off-by: Ian Rogers Tested-by: James Clark Cc: Adrian Hunter Cc: Albert Ou Cc: Alexandre Chartre Cc: Alexandre Ghiti Cc: Andrii Nakryiko Cc: Ankur Arora Cc: Collin Funk Cc: Costa Shulyupin Cc: Daniel Borkmann Cc: Dapeng Mi Cc: David Sterba Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Eduard Zingerman Cc: Howard Chu Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kumar Kartikeya Dwivedi Cc: Leo Yan Cc: Markus Mayer Cc: Martin KaFai Lau Cc: Nathan Chancellor Cc: Nick Terrell Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ricky Ringler Cc: Song Liu Cc: Swapnil Sapkal Cc: Thomas Falcon Cc: Tomas Glozar Cc: Yonghong Song Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index c81797ceec42..c66af4c825fd 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -550,7 +550,7 @@ build := -f $(srctree)/tools/build/Makefile.build dir=. obj $(PERF_IN): prepare FORCE $(Q)$(MAKE) $(build)=perf -$(LIBPMU_EVENTS_IN): FORCE prepare +$(LIBPMU_EVENTS_IN): FORCE $(LIBPERF) $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events $(LIBPMU_EVENTS): $(LIBPMU_EVENTS_IN)