Skip to content

Commit 1dd74da

Browse files
committed
perf bench: Make bench its own library
JIRA: https://issues.redhat.com/browse/RHEL-29795 upstream ======== commit 21cc3bc Author: Ian Rogers <irogers@google.com> Date: Tue Jun 25 14:41:14 2024 -0700 description =========== Make the benchmark code into a library so it may be linked against things like the python module to avoid compiling code twice. Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: James Clark <james.clark@arm.com> Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Kees Cook <keescook@chromium.org> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Nick Terrell <terrelln@fb.com> Cc: Gary Guo <gary@garyguo.net> Cc: Alex Gaynor <alex.gaynor@gmail.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Wedson Almeida Filho <wedsonaf@gmail.com> Cc: Ze Gao <zegao2021@gmail.com> Cc: Alice Ryhl <aliceryhl@google.com> Cc: Andrei Vagin <avagin@google.com> Cc: Yicong Yang <yangyicong@hisilicon.com> Cc: Jonathan Cameron <jonathan.cameron@huawei.com> Cc: Guo Ren <guoren@kernel.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Leo Yan <leo.yan@linux.dev> Cc: Oliver Upton <oliver.upton@linux.dev> Cc: John Garry <john.g.garry@oracle.com> Cc: Benno Lossin <benno.lossin@proton.me> Cc: Björn Roy Baron <bjorn3_gh@protonmail.com> Cc: Andreas Hindborg <a.hindborg@samsung.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240625214117.953777-6-irogers@google.com Conflicts: ========== We don't link the module sched-seccomp-notify.o, because we don't have this benchmark. We don't have this benchmark, because we don't have the corresponding scheduler feature. Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent f8aa60b commit 1dd74da

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

tools/perf/Build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
perf-y += builtin-bench.o
1+
perf-bench-y += builtin-bench.o
22
perf-y += builtin-annotate.o
33
perf-y += builtin-config.o
44
perf-y += builtin-diff.o
@@ -35,7 +35,7 @@ endif
3535

3636
perf-$(CONFIG_LIBELF) += builtin-probe.o
3737

38-
perf-y += bench/
38+
perf-bench-y += bench/
3939
perf-test-y += tests/
4040

4141
perf-y += perf.o

tools/perf/Makefile.perf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ endif
426426

427427
export PERL_PATH
428428

429+
LIBPERF_BENCH_IN := $(OUTPUT)perf-bench-in.o
430+
LIBPERF_BENCH := $(OUTPUT)libperf-bench.a
431+
429432
LIBPERF_TEST_IN := $(OUTPUT)perf-test-in.o
430433
LIBPERF_TEST := $(OUTPUT)libperf-test.a
431434

@@ -439,7 +442,7 @@ PERFLIBS = $(LIBAPI) $(LIBPERF) $(LIBSUBCMD) $(LIBSYMBOL)
439442
ifdef LIBBPF_STATIC
440443
PERFLIBS += $(LIBBPF)
441444
endif
442-
PERFLIBS += $(LIBPERF_TEST) $(LIBPERF_UI) $(LIBPMU_EVENTS)
445+
PERFLIBS += $(LIBPERF_BENCH) $(LIBPERF_TEST) $(LIBPERF_UI) $(LIBPMU_EVENTS)
443446

444447
# We choose to avoid "if .. else if .. else .. endif endif"
445448
# because maintaining the nesting to match is a pain. If
@@ -741,6 +744,12 @@ $(LIBPMU_EVENTS_IN): FORCE prepare
741744
$(LIBPMU_EVENTS): $(LIBPMU_EVENTS_IN)
742745
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $<
743746

747+
$(LIBPERF_BENCH_IN): FORCE prepare
748+
$(Q)$(MAKE) $(build)=perf-bench
749+
750+
$(LIBPERF_BENCH): $(LIBPERF_BENCH_IN)
751+
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $<
752+
744753
$(LIBPERF_TEST_IN): FORCE prepare
745754
$(Q)$(MAKE) $(build)=perf-test
746755

tools/perf/bench/Build

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
perf-y += sched-messaging.o
2-
perf-y += sched-pipe.o
3-
perf-y += syscall.o
4-
perf-y += mem-functions.o
5-
perf-y += futex-hash.o
6-
perf-y += futex-wake.o
7-
perf-y += futex-wake-parallel.o
8-
perf-y += futex-requeue.o
9-
perf-y += futex-lock-pi.o
10-
perf-y += epoll-wait.o
11-
perf-y += epoll-ctl.o
12-
perf-y += synthesize.o
13-
perf-y += kallsyms-parse.o
14-
perf-y += find-bit-bench.o
15-
perf-y += inject-buildid.o
16-
perf-y += evlist-open-close.o
17-
perf-y += breakpoint.o
18-
perf-y += pmu-scan.o
19-
perf-y += uprobe.o
1+
perf-bench-y += sched-messaging.o
2+
perf-bench-y += sched-pipe.o
3+
perf-bench-y += syscall.o
4+
perf-bench-y += mem-functions.o
5+
perf-bench-y += futex-hash.o
6+
perf-bench-y += futex-wake.o
7+
perf-bench-y += futex-wake-parallel.o
8+
perf-bench-y += futex-requeue.o
9+
perf-bench-y += futex-lock-pi.o
10+
perf-bench-y += epoll-wait.o
11+
perf-bench-y += epoll-ctl.o
12+
perf-bench-y += synthesize.o
13+
perf-bench-y += kallsyms-parse.o
14+
perf-bench-y += find-bit-bench.o
15+
perf-bench-y += inject-buildid.o
16+
perf-bench-y += evlist-open-close.o
17+
perf-bench-y += breakpoint.o
18+
perf-bench-y += pmu-scan.o
19+
perf-bench-y += uprobe.o
2020

21-
perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
22-
perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
21+
perf-bench-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
22+
perf-bench-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
2323

24-
perf-$(CONFIG_NUMA) += numa.o
24+
perf-bench-$(CONFIG_NUMA) += numa.o

0 commit comments

Comments
 (0)