mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-04 18:00:02 -05:00
MIPS: perf: More robustly probe for the presence of per-tc counters
The presence of per TC performance counters is now detected by cpu-probe.c and indicated by MIPS_CPU_MT_PER_TC_PERF_COUNTERS in cpu_data. Switch detection of the feature to use this new flag rather than blindly testing the implementation specific config7 register with a magic number. Signed-off-by: Matt Redfearn <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Maciej W. Rozycki <[email protected]> Cc: Paul Burton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Robert Richter <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19142/ Signed-off-by: James Hogan <[email protected]>
This commit is contained in:
parent
8270ab48e6
commit
800fb71281
3 changed files with 7 additions and 5 deletions
|
|
@ -535,6 +535,13 @@
|
|||
# define cpu_has_shared_ftlb_entries 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MIPS_MT_SMP
|
||||
# define cpu_has_mipsmt_pertccounters \
|
||||
(cpu_data[0].options & MIPS_CPU_MT_PER_TC_PERF_COUNTERS)
|
||||
#else
|
||||
# define cpu_has_mipsmt_pertccounters 0
|
||||
#endif /* CONFIG_MIPS_MT_SMP */
|
||||
|
||||
/*
|
||||
* Guest capabilities
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -129,8 +129,6 @@ static struct mips_pmu mipspmu;
|
|||
|
||||
|
||||
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
|
||||
static int cpu_has_mipsmt_pertccounters;
|
||||
|
||||
static DEFINE_RWLOCK(pmuint_rwlock);
|
||||
|
||||
#if defined(CONFIG_CPU_BMIPS5000)
|
||||
|
|
@ -1723,7 +1721,6 @@ init_hw_perf_events(void)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
|
||||
cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19);
|
||||
if (!cpu_has_mipsmt_pertccounters)
|
||||
counters = counters_total_to_per_cpu(counters);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ static int perfcount_irq;
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_MIPS_MT_SMP
|
||||
static int cpu_has_mipsmt_pertccounters;
|
||||
#define WHAT (MIPS_PERFCTRL_MT_EN_VPE | \
|
||||
M_PERFCTL_VPEID(cpu_vpe_id(¤t_cpu_data)))
|
||||
#define vpe_id() (cpu_has_mipsmt_pertccounters ? \
|
||||
|
|
@ -326,7 +325,6 @@ static int __init mipsxx_init(void)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_MIPS_MT_SMP
|
||||
cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19);
|
||||
if (!cpu_has_mipsmt_pertccounters)
|
||||
counters = counters_total_to_per_cpu(counters);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue