Commit 57b72eb5 authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Ionela Voinescu
Browse files

sched_tp: Add capacity_curr to cpu_capacity trace event

Whereas capacity_orig is the CPU capacity scaled by CPU architecture,
capacity_curr (current capacity) is the CPU capacity scaled by CPU
architecture and current_frequency/max_frequency.

capacity_curr is used to create the PELT clock information for
enqueue/dequeue (sched_switch) out of (not aligned) PELT sched events
in LISA's PELT simulation.
Here, the ftrace time between an enqueue/dequeue and a PELT sched event
has to be rescaled by the time-scaling factor which itself consists of
CPU capacity and current_frequency/max_frequency scaling factor. And
this is done by using a series of capacity_curr values.
parent 53e0e084
......@@ -289,16 +289,21 @@ TRACE_EVENT(sched_cpu_capacity,
__field( int, cpu )
__field( unsigned long, capacity )
__field( unsigned long, capacity_orig )
__field( unsigned long, capacity_curr )
),
unsigned long scale_cpu = arch_scale_cpu_capacity(rq->cpu);
unsigned long scale_freq = arch_scale_freq_capacity(rq->cpu);
TP_fast_assign(
__entry->cpu = rq->cpu;
__entry->capacity = rq->cpu_capacity;
__entry->capacity_orig = arch_scale_cpu_capacity(rq->cpu);
__entry->capacity_orig = scale_cpu;
__entry->capacity_curr = cap_scale(scale_cpu, scale_freq);
),
TP_printk("cpu=%d capacity=%lu capacity_orig=%lu",
__entry->cpu, __entry->capacity, __entry->capacity_orig)
TP_printk("cpu=%d capacity=%lu capacity_orig=%lu capacity_curr=%lu",
__entry->cpu, __entry->capacity, __entry->capacity_orig, __entry->capacity_curr)
);
#endif /* _SCHED_EVENTS_H */
......
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