linux/tools/perf/bench
Ian Rogers 9d6a1df9b2 perf pmus: Allow just core PMU scanning
Scanning all PMUs is expensive as all PMUs sysfs entries are loaded,
benchmarking shows more than 4x the cost:

```
$ perf bench internals pmu-scan -i 1000
Computing performance of sysfs PMU event scan for 1000 times
  Average core PMU scanning took: 989.231 usec (+- 1.535 usec)
  Average PMU scanning took: 4309.425 usec (+- 74.322 usec)
```

Add new perf_pmus__scan_core routine that scans just core
PMUs. Replace perf_pmus__scan calls with perf_pmus__scan_core when
non-core PMUs are being ignored.

Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ali Saidi <alisaidi@amazon.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kang Minchul <tegongkang@gmail.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Ming Wang <wangming01@loongson.cn>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230527072210.2900565-30-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-05-27 09:42:00 -03:00
..
bench.h perf bench: Add pmu-scan benchmark 2023-04-04 13:23:58 -03:00
breakpoint.c perf bench breakpoint: Fix build on 32-bit arches 2022-05-16 21:23:09 -03:00
Build perf bench: Add pmu-scan benchmark 2023-04-04 13:23:58 -03:00
epoll-ctl.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
epoll-wait.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
evlist-open-close.c perf evlist: Rename cpus to user_requested_cpus 2022-04-01 16:19:35 -03:00
find-bit-bench.c perf bench: Avoid NDEBUG warning 2023-04-04 09:39:56 -03:00
futex-hash.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
futex-lock-pi.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
futex-requeue.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
futex-wake-parallel.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
futex-wake.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
futex.h Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t" 2021-11-01 11:42:54 -03:00
inject-buildid.c perf bench inject-buildid: Use zfree() to reduce chances of use after free 2023-04-12 10:14:01 -03:00
kallsyms-parse.c perf bench: Add kallsyms parsing 2020-05-05 16:35:32 -03:00
mem-functions.c perf bench mem: Always memset source before memcpy 2020-08-13 09:34:26 -03:00
mem-memcpy-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memcpy-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memcpy-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memset-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
numa.c perf bench numa: Fix type of loop iterator in do_work, it should be 'long' 2023-04-04 09:39:56 -03:00
pmu-scan.c perf pmus: Allow just core PMU scanning 2023-05-27 09:42:00 -03:00
sched-messaging.c Revert "perf bench: Fix two memory leaks detected with ASan" 2021-12-06 21:57:52 -03:00
sched-pipe.c perf tools: Cast (struct timeval).tv_sec when printing 2021-03-06 16:54:24 -03:00
synthesize.c perf tools: Allow controlling synthesizing PERF_RECORD_ metadata events during record 2021-09-17 08:44:19 -03:00
syscall.c perf bench syscall: Add fork syscall benchmark 2023-04-04 09:39:55 -03:00