mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
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 <[email protected]> Reviewed-by: Adrian Hunter <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: James Clark <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Yang Jihong <[email protected]> Cc: Will Deacon <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mike Leach <[email protected]> Cc: Jing Zhang <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Kan Liang <[email protected]> Cc: John Garry <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
34 lines
770 B
C
34 lines
770 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Arm Statistical Profiling Extensions (SPE) support
|
|
* Copyright (c) 2017-2018, Arm Ltd.
|
|
*/
|
|
|
|
#ifndef INCLUDE__PERF_ARM_SPE_H__
|
|
#define INCLUDE__PERF_ARM_SPE_H__
|
|
|
|
#define ARM_SPE_PMU_NAME "arm_spe_"
|
|
|
|
enum {
|
|
ARM_SPE_PMU_TYPE,
|
|
ARM_SPE_PER_CPU_MMAPS,
|
|
ARM_SPE_AUXTRACE_PRIV_MAX,
|
|
};
|
|
|
|
#define ARM_SPE_AUXTRACE_PRIV_SIZE (ARM_SPE_AUXTRACE_PRIV_MAX * sizeof(u64))
|
|
|
|
union perf_event;
|
|
struct perf_session;
|
|
struct perf_pmu;
|
|
|
|
struct auxtrace_record *arm_spe_recording_init(int *err,
|
|
struct perf_pmu *arm_spe_pmu);
|
|
|
|
int arm_spe_process_auxtrace_info(union perf_event *event,
|
|
struct perf_session *session);
|
|
|
|
void arm_spe_pmu_default_config(const struct perf_pmu *arm_spe_pmu,
|
|
struct perf_event_attr *attr);
|
|
|
|
#endif
|