diff --git a/lisa/_assets/kmodules/lisa/introspection.json b/lisa/_assets/kmodules/lisa/introspection.json index 1955511b5d..78f83811be 100644 --- a/lisa/_assets/kmodules/lisa/introspection.json +++ b/lisa/_assets/kmodules/lisa/introspection.json @@ -29,6 +29,7 @@ "SCHED_AVG_RBL": "HAS_MEMBER(struct, sched_avg, runnable_load_avg) || HAS_MEMBER(struct, sched_avg, runnable_avg)", "FILE_IO": "HAS_SYMBOL(kernel_read) && HAS_SYMBOL(kernel_write) && HAS_SYMBOL(filp_open)", - "FREQ_INVARIANCE": "HAS_SYMBOL(arch_freq_scale) && HAS_MEMBER(struct, rq, cpu_capacity_orig)" + "FREQ_INVARIANCE": "HAS_SYMBOL(arch_freq_scale)", + "UARCH_INVARIANCE": "HAS_SYMBOL(cpu_scale)" } } diff --git a/lisa/_assets/kmodules/lisa/sched_helpers.h b/lisa/_assets/kmodules/lisa/sched_helpers.h index 2e4cb771e9..51d3ff6cba 100644 --- a/lisa/_assets/kmodules/lisa/sched_helpers.h +++ b/lisa/_assets/kmodules/lisa/sched_helpers.h @@ -214,11 +214,15 @@ static inline int rq_cpu_capacity(const struct rq *rq) ; } +# if HAS_KERNEL_FEATURE(UARCH_INVARIANCE) +DECLARE_PER_CPU(unsigned long, cpu_scale); +# endif + static inline int rq_cpu_orig_capacity(const struct rq *rq) { return -# if HAS_KERNEL_FEATURE(FREQ_INVARIANCE) - rq->cpu_capacity_orig; +# if HAS_KERNEL_FEATURE(UARCH_INVARIANCE) + per_cpu(cpu_scale, rq->cpu) # else rq_cpu_capacity(rq) # endif