Commit 53e0e084 authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Ionela Voinescu
Browse files

sched_tp: Add cpu_capacity trace events



...
[000] .Ns3 185.489841: sched_cpu_capacity: cpu=0 capacity=437 capacity_orig=446
[002] ..s1 185.501802: sched_cpu_capacity: cpu=2 capacity=999 capacity_orig=1024
[003] ..s3 185.517837: sched_cpu_capacity: cpu=3 capacity=438 capacity_orig=446
[002] ..s1 185.529794: sched_cpu_capacity: cpu=2 capacity=999 capacity_orig=1024
[001] ..s1 185.545789: sched_cpu_capacity: cpu=1 capacity=1011 capacity_orig=1024
[004] .Ns1 185.545837: sched_cpu_capacity: cpu=4 capacity=439 capacity_orig=446
...

Use arch_scale_cpu_capacity() instead of rq->cpu_capacity_orig because
there is a patch further up the stack which removes the latter.
Signed-off-by: Dietmar Eggemann's avatarDietmar Eggemann <dietmar.eggemann@arm.com>
parent 2890008f
......@@ -279,6 +279,28 @@ TRACE_EVENT_CONDITION(uclamp_util_cfs,
#define trace_uclamp_util_cfs_enabled() false
#endif /* CONFIG_UCLAMP_TASK */
TRACE_EVENT(sched_cpu_capacity,
TP_PROTO(struct rq *rq),
TP_ARGS(rq),
TP_STRUCT__entry(
__field( int, cpu )
__field( unsigned long, capacity )
__field( unsigned long, capacity_orig )
),
TP_fast_assign(
__entry->cpu = rq->cpu;
__entry->capacity = rq->cpu_capacity;
__entry->capacity_orig = arch_scale_cpu_capacity(rq->cpu);
),
TP_printk("cpu=%d capacity=%lu capacity_orig=%lu",
__entry->cpu, __entry->capacity, __entry->capacity_orig)
);
#endif /* _SCHED_EVENTS_H */
/* This part must be outside protection */
......
......@@ -154,6 +154,12 @@ static void sched_util_est_se(void *data, struct sched_entity *se)
_trace_se(se, trace_sched_util_est_se);
}
static void sched_cpu_capacity(void *data, struct rq *rq)
{
if (trace_sched_cpu_capacity_enabled())
trace_sched_cpu_capacity(rq);
}
static int sched_tp_init(void)
{
register_trace_pelt_cfs_tp(sched_pelt_cfs, NULL);
......@@ -164,6 +170,7 @@ static int sched_tp_init(void)
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);
register_trace_sched_cpu_capacity_tp(sched_cpu_capacity, NULL);
return 0;
}
......@@ -178,6 +185,7 @@ static void sched_tp_finish(void)
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);
unregister_trace_sched_cpu_capacity_tp(sched_cpu_capacity, NULL);
}
......
Markdown is supported
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