Merge "sched: walt: Add judgement for reading sysreg on AMU"
This commit is contained in:
commit
78ca2e08c6
1 changed files with 5 additions and 1 deletions
|
|
@ -59,6 +59,10 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
|
|||
}
|
||||
#endif /* CREATE_TRACE_POINTS */
|
||||
|
||||
/* Check the AMU bits to judge AMU implementation in ID_AA64PFR0_EL1 */
|
||||
#define cpu_has_amu \
|
||||
cpuid_feature_extract_unsigned_field(read_cpuid(ID_AA64PFR0_EL1), ID_AA64PFR0_EL1_AMU_SHIFT)
|
||||
|
||||
TRACE_EVENT(sched_switch_with_ctrs,
|
||||
|
||||
TP_PROTO(bool preempt,
|
||||
|
|
@ -125,7 +129,7 @@ TRACE_EVENT(sched_switch_with_ctrs,
|
|||
delta_l1_cnts[i] = 0;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_ARM64_AMU_EXTN)) {
|
||||
if (IS_ENABLED(CONFIG_ARM64_AMU_EXTN) && cpu_has_amu > 0) {
|
||||
amu_cnt = read_sysreg_s(SYS_AMEVCNTR0_CORE_EL0);
|
||||
delta_amu_cnts[0] = amu_cnt -
|
||||
per_cpu(previous_amu_cnts[0], cpu);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue