Commit 55a0bbb3 authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Ionela Voinescu
Browse files

sched_tp: Add sched_pelt_thermal trace event

hackbench-3060 [007] 565.489752: sched_pelt_thermal: cpu=7 load=101 runnable=103765 util=951 update_time=564835470336
hackbench-3147 [005] 565.489760: sched_pelt_thermal: cpu=5 load=101 runnable=104036 util=954 update_time=565325810688
task_n3-3-576  [000] 565.489763: sched_pelt_thermal: cpu=0 load=31 runnable=32404 util=953 update_time=557800611840
hackbench-862  [001] 565.489763: sched_pelt_thermal: cpu=1 load=31 runnable=32395 util=952 update_time=564421108736
hackbench-2136 [002] 565.489763: sched_pelt_thermal: cpu=2 load=31 runnable=32455 util=954 update_time=564142488576

The actual PELT thermal signal is `load`, `runnable` and `util` are
meaningless. It's plotted here since the trace event is implemented
according to the `sched_pelt_rq_template` trace event class.
The `sched_pelt_rt`, `sched_pelt_dl` and `sched_pelt_irq` trace event
have a similar issue.
Signed-off-by: Dietmar Eggemann's avatarDietmar Eggemann <>
parent 57b72eb5
......@@ -2184,6 +2184,7 @@ int sched_trace_cfs_rq_cpu(struct cfs_rq *cfs_rq);
const struct sched_avg *sched_trace_rq_avg_rt(struct rq *rq);
const struct sched_avg *sched_trace_rq_avg_dl(struct rq *rq);
const struct sched_avg *sched_trace_rq_avg_irq(struct rq *rq);
const struct sched_avg *sched_trace_rq_avg_thermal(struct rq *rq);
int sched_trace_rq_cpu(struct rq *rq);
int sched_trace_rq_cpu_capacity(struct rq *rq);
......@@ -11648,6 +11648,16 @@ const struct sched_avg *sched_trace_rq_avg_irq(struct rq *rq)
const struct sched_avg *sched_trace_rq_avg_thermal(struct rq *rq)
return rq ? &rq->avg_thermal : NULL;
return NULL;
int sched_trace_rq_cpu(struct rq *rq)
return rq ? cpu_of(rq) : -1;
......@@ -92,6 +92,10 @@ DEFINE_EVENT(sched_pelt_rq_template, sched_pelt_irq,
TP_PROTO(int cpu, const struct sched_avg *avg),
TP_ARGS(cpu, avg));
DEFINE_EVENT(sched_pelt_rq_template, sched_pelt_thermal,
TP_PROTO(int cpu, const struct sched_avg *avg),
TP_ARGS(cpu, avg));
TP_PROTO(int cpu, char *path, char *comm, int pid, const struct sched_avg *avg),
......@@ -116,6 +116,19 @@ static void sched_pelt_irq(void *data, struct rq *rq)
static void sched_pelt_thermal(void *data, struct rq *rq)
if (trace_sched_pelt_thermal_enabled()){
const struct sched_avg *avg = sched_trace_rq_avg_thermal(rq);
int cpu = sched_trace_rq_cpu(rq);
if (!avg)
trace_sched_pelt_thermal(cpu, avg);
static void sched_pelt_se(void *data, struct sched_entity *se)
if (trace_sched_pelt_se_enabled()) {
......@@ -167,6 +180,7 @@ static int sched_tp_init(void)
register_trace_pelt_dl_tp(sched_pelt_dl, NULL);
register_trace_pelt_irq_tp(sched_pelt_irq, NULL);
register_trace_pelt_se_tp(sched_pelt_se, NULL);
register_trace_pelt_thermal_tp(sched_pelt_thermal, NULL);
register_trace_sched_overutilized_tp(sched_overutilized, NULL);
register_trace_sched_util_est_cfs_tp(sched_util_est_cfs, NULL);
register_trace_sched_util_est_se_tp(sched_util_est_se, NULL);
......@@ -182,6 +196,7 @@ static void sched_tp_finish(void)
unregister_trace_pelt_dl_tp(sched_pelt_dl, NULL);
unregister_trace_pelt_irq_tp(sched_pelt_irq, NULL);
unregister_trace_pelt_se_tp(sched_pelt_se, NULL);
unregister_trace_pelt_thermal_tp(sched_pelt_thermal, NULL);
unregister_trace_sched_overutilized_tp(sched_overutilized, NULL);
unregister_trace_sched_util_est_cfs_tp(sched_util_est_cfs, NULL);
unregister_trace_sched_util_est_se_tp(sched_util_est_se, NULL);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment