Skip to content

Refactor perf python module build

Ian Rogers linux-perf-users lkml 5 versions – Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest8 patches 1 replyApplied
  2. v47 patches 0 repliesSuperseded
  3. v38 patches 6 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v28 patches0 repliesSuperseded
v17 patches4 repliesSuperseded

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/8perf build: Add '*.a' to clean targetstools/perf/Makefile.perf+12 -50 replies
2/8perf ui: Make ui its own librarytools/perf/Build tools/perf/Makefile.perf tools/perf/ui/Build +2 more+31 -210 replies
3/8perf pmu-events: Make pmu-events a librarytools/perf/Makefile.perf+10 -60 replies
4/8perf test: Make tests its own librarytools/perf/Build tools/perf/Makefile.perf tools/perf/arch/Build +10 more+115 -1040 replies
5/8perf bench: Make bench its own librarytools/perf/Build tools/perf/Makefile.perf tools/perf/bench/Build+35 -260 replies
6/8perf util: Make util its own librarytools/perf/Build tools/perf/Makefile.perf tools/perf/arch/Build +33 more+316 -3050 replies
7/8perf python: Switch module to linking libraries from building sourcetools/perf/Makefile.config tools/perf/Makefile.perf tools/perf/util/python.c +1 more+110 -2080 replies
8/8perf python: Clean up build dependenciestools/perf/Makefile.perf tools/perf/util/python-ext-sources+1 -620 replies

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchJames Clark
1/8
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/8] Refactor perf python module build

Refactor the perf python module build to instead of building C files it links libraries. To support this make static libraries for tests, ui, util and pmu-events. Doing this allows fewer functions to be stubbed out, importantly parse_events is no longer stubbed out which will improve the ability to work with heterogeneous cores.

By not building .c files for the python module and for the build of perf, this should also help build times.

Patch 1 adds '*.a' cleanup to the clean target.

Patches 2 to 6 add static libraries for existing parts of the perf build.

Patch 7 adds the python build using libraries rather than C source files.

Patch 8 cleans up the python dependencies and removes the no longer needed python-ext-sources.

v5: Resend with missing patch 8.
v4: Rebase past conflict with commit eae7044b67a6 ("perf hist: Honor
symbol_conf.skip_empty") - fixes like this commit won't be necessary after these changes. Swap a tab for spaces for better consistency.
v3: Add missed xtensa directory for the util build. Remove adding the
arch directory to perf-y as it creates an empty object file that breaks with GCC and LTO.
v2: Add '*.a' cleanup to clean target. Add reviewed-by James Clark.

Ian Rogers (8):
perf build: Add '*.a' to clean targets
perf ui: Make ui its own library
perf pmu-events: Make pmu-events a library
perf test: Make tests its own library
perf bench: Make bench its own library
perf util: Make util its own library
perf python: Switch module to linking libraries from building source perf python: Clean up build dependencies

 tools/perf/Build                              |  14 +-
 tools/perf/Makefile.config                    |   5 +
 tools/perf/Makefile.perf                      |  83 +++-
 tools/perf/arch/Build                         |   5 +-
 tools/perf/arch/arm/Build                     |   4 +-
 tools/perf/arch/arm/tests/Build               |   8 +-
 tools/perf/arch/arm/util/Build                |  10 +-
 tools/perf/arch/arm64/Build                   |   4 +-
 tools/perf/arch/arm64/tests/Build             |   8 +-
 tools/perf/arch/arm64/util/Build              |  20 +-
 tools/perf/arch/csky/Build                    |   2 +-
 tools/perf/arch/csky/util/Build               |   6 +-
 tools/perf/arch/loongarch/Build               |   2 +-
 tools/perf/arch/loongarch/util/Build          |   8 +-
 tools/perf/arch/mips/Build                    |   2 +-
 tools/perf/arch/mips/util/Build               |   6 +-
 tools/perf/arch/powerpc/Build                 |   4 +-
 tools/perf/arch/powerpc/tests/Build           |   6 +-
 tools/perf/arch/powerpc/util/Build            |  24 +-
 tools/perf/arch/riscv/Build                   |   2 +-
 tools/perf/arch/riscv/util/Build              |   8 +-
 tools/perf/arch/s390/Build                    |   2 +-
 tools/perf/arch/s390/util/Build               |  16 +-
 tools/perf/arch/sh/Build                      |   2 +-
 tools/perf/arch/sh/util/Build                 |   2 +-
 tools/perf/arch/sparc/Build                   |   2 +-
 tools/perf/arch/sparc/util/Build              |   2 +-
 tools/perf/arch/x86/Build                     |   6 +-
 tools/perf/arch/x86/tests/Build               |  20 +-
 tools/perf/arch/x86/util/Build                |  42 +-
 tools/perf/arch/xtensa/Build                  |   2 +-
 tools/perf/bench/Build                        |  46 +-
 tools/perf/scripts/Build                      |   4 +-
 tools/perf/scripts/perl/Perf-Trace-Util/Build |   2 +-
 .../perf/scripts/python/Perf-Trace-Util/Build |   2 +-
 tools/perf/tests/Build                        | 140 +++----
 tools/perf/tests/workloads/Build              |  12 +-
 tools/perf/ui/Build                           |  18 +-
 tools/perf/ui/browsers/Build                  |  14 +-
 tools/perf/ui/tui/Build                       |   8 +-
 tools/perf/util/Build                         | 394 +++++++++---------
 tools/perf/util/arm-spe-decoder/Build         |   2 +-
 tools/perf/util/cs-etm-decoder/Build          |   2 +-
 tools/perf/util/hisi-ptt-decoder/Build        |   2 +-
 tools/perf/util/intel-pt-decoder/Build        |   2 +-
 tools/perf/util/perf-regs-arch/Build          |  18 +-
 tools/perf/util/python-ext-sources            |  53 ---
 tools/perf/util/python.c                      | 274 +++++-------
 tools/perf/util/scripting-engines/Build       |   4 +-
 tools/perf/util/setup.py                      |  33 +-
 50 files changed, 625 insertions(+), 732 deletions(-)
 delete mode 100644 tools/perf/util/python-ext-sources
Signature · 1 line
2.45.2.741.gdbec12cfda-goog