linux/tools/perf/arch/arm64/util
Ian Rogers 0197da7aff perf pmu: Lazily compute default config
The default config is computed during creation of the PMU and may do
things like scanning sysfs, when the PMU may just be used as part of
scanning. Change default_config to perf_event_attr_init_default, a
callback that is used when a default config needs initializing. This
avoids holding onto the memory for a perf_event_attr and copying.

On a tigerlake laptop running the pmu-scan benchmark:

Before:
Running 'internals/pmu-scan' benchmark:
Computing performance of sysfs PMU event scan for 100 times
  Average core PMU scanning took: 28.780 usec (+- 0.503 usec)
  Average PMU scanning took: 283.480 usec (+- 18.471 usec)
Number of openat syscalls: 30,227

After:
Running 'internals/pmu-scan' benchmark:
Computing performance of sysfs PMU event scan for 100 times
  Average core PMU scanning took: 27.880 usec (+- 0.169 usec)
  Average PMU scanning took: 245.260 usec (+- 15.758 usec)
Number of openat syscalls: 28,914

Over 3 runs it is a nearly 12% reduction in execution time and a 4.3%
of openat calls.

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: James Clark <james.clark@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Will Deacon <will@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: John Garry <john.g.garry@oracle.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: coresight@lists.linaro.org
Link: https://lore.kernel.org/r/20231012175645.1849503-8-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2023-10-17 12:40:50 -07:00
..
Build perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
arm-spe.c perf pmu: Lazily compute default config 2023-10-17 12:40:50 -07:00
arm64_exception_types.h perf kvm: Add kvm-stat for arm64 2020-11-04 09:42:41 -03:00
dwarf-regs.c
header.c perf arm64: Allow version comparisons of CPU IDs 2023-08-17 14:11:37 -03:00
hisi-ptt.c perf auxtrace arm64: Add support for HiSilicon PCIe Tune and Trace device driver 2022-10-15 10:13:16 -03:00
kvm-stat.c perf evsel: Introduce evsel__name_is() method to check if the evsel name is equal to a given string 2023-04-24 14:28:11 -03:00
machine.c perf parse-regs: Move out arch specific header from util/perf_regs.h 2023-08-16 08:52:45 -03:00
mem-events.c perf pmu: Remove logic for PMU name being NULL 2023-08-25 10:22:16 -03:00
perf_regs.c perf parse-regs: Move out arch specific header from util/perf_regs.h 2023-08-16 08:52:45 -03:00
pmu.c perf pmu: Remove unused function 2023-09-15 16:46:40 -07:00
tsc.c perf tsc: Add rdtsc() for Arm64 2020-09-22 13:44:16 -03:00
unwind-libdw.c perf parse-regs: Move out arch specific header from util/perf_regs.h 2023-08-16 08:52:45 -03:00
unwind-libunwind.c perf unwind arm64: Decouple Libunwind register names from Perf 2022-05-26 12:43:05 -03:00