From 8075477f59d5c9771f596c7e98e9ebe992fb1c90 Mon Sep 17 00:00:00 2001 From: Shaleen Agrawal Date: Mon, 16 May 2022 11:26:39 -0700 Subject: [PATCH] sched/walt: Add thermal pressure to cpu_util TP In the event that thermal throttling is under way, and user has not enabled update_cpu_capacity trace point, add a backup way of quickly determining scheduler under thermal constraints by displaying the thermal pressure in the sched_cpu_util trace point. Change-Id: I36b8f23e37b4e9b42770e1535feabb9d513fb730 Signed-off-by: Shaleen Agrawal --- kernel/sched/walt/trace.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/sched/walt/trace.h b/kernel/sched/walt/trace.h index 0bfd17eea7fc..30d1a1fffb73 100644 --- a/kernel/sched/walt/trace.h +++ b/kernel/sched/walt/trace.h @@ -950,6 +950,7 @@ TRACE_EVENT(sched_cpu_util, __field(unsigned int, nr_rtg_high_prio_tasks) __field(u64, prs_gprs) __field(unsigned int, lowest_mask) + __field(unsigned long, thermal_pressure) ), TP_fast_assign( @@ -974,16 +975,17 @@ TRACE_EVENT(sched_cpu_util, __entry->lowest_mask = 0; else __entry->lowest_mask = cpumask_bits(lowest_mask)[0]; + __entry->thermal_pressure = arch_scale_thermal_pressure(cpu); ), - TP_printk("cpu=%d nr_running=%d cpu_util=%ld cpu_util_cum=%ld capacity_curr=%lu capacity=%lu capacity_orig=%lu idle_exit_latency=%u irqload=%llu online=%u, inactive=%u, halted=%u, reserved=%u, high_irq_load=%u nr_rtg_hp=%u prs_gprs=%llu lowest_mask=0x%x", + TP_printk("cpu=%d nr_running=%d cpu_util=%ld cpu_util_cum=%ld capacity_curr=%lu capacity=%lu capacity_orig=%lu idle_exit_latency=%u irqload=%llu online=%u, inactive=%u, halted=%u, reserved=%u, high_irq_load=%u nr_rtg_hp=%u prs_gprs=%llu lowest_mask=0x%x thermal_pressure=%llu", __entry->cpu, __entry->nr_running, __entry->cpu_util, __entry->cpu_util_cum, __entry->capacity_curr, __entry->capacity, __entry->capacity_orig, __entry->idle_exit_latency, __entry->irqload, __entry->online, __entry->inactive, __entry->halted, __entry->reserved, __entry->high_irq_load, __entry->nr_rtg_high_prio_tasks, __entry->prs_gprs, - __entry->lowest_mask) + __entry->lowest_mask, __entry->thermal_pressure) ); TRACE_EVENT(sched_compute_energy,