DEBUG: sched: add tracepoint for cpu/freq scale invariance
authorJuri Lelli <juri.lelli@arm.com>
Mon, 9 Nov 2015 12:06:24 +0000 (12:06 +0000)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 14 Sep 2016 09:28:22 +0000 (14:58 +0530)
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
include/trace/events/sched.h
kernel/sched/fair.c

index d34eba74af27d1cfa0ff8188172c5fa0b3073f4c..67e465f8b15970bf07e2092b6a484670483093ca 100644 (file)
@@ -611,6 +611,30 @@ TRACE_EVENT(sched_wake_idle_without_ipi,
 
        TP_printk("cpu=%d", __entry->cpu)
 );
+
+TRACE_EVENT(sched_contrib_scale_f,
+
+       TP_PROTO(int cpu, unsigned long freq_scale_factor,
+                unsigned long cpu_scale_factor),
+
+       TP_ARGS(cpu, freq_scale_factor, cpu_scale_factor),
+
+       TP_STRUCT__entry(
+               __field(int, cpu)
+               __field(unsigned long, freq_scale_factor)
+               __field(unsigned long, cpu_scale_factor)
+       ),
+
+       TP_fast_assign(
+               __entry->cpu = cpu;
+               __entry->freq_scale_factor = freq_scale_factor;
+               __entry->cpu_scale_factor = cpu_scale_factor;
+       ),
+
+       TP_printk("cpu=%d freq_scale_factor=%lu cpu_scale_factor=%lu",
+                 __entry->cpu, __entry->freq_scale_factor,
+                 __entry->cpu_scale_factor)
+);
 #endif /* _TRACE_SCHED_H */
 
 /* This part must be outside protection */
index 5ccc9f13a29533795ff43f4f103980c3c6aa595f..7444383c032f3c0a962bc33b47907c52276ff637 100644 (file)
@@ -2585,6 +2585,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
 
        scale_freq = arch_scale_freq_capacity(NULL, cpu);
        scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
+       trace_sched_contrib_scale_f(cpu, scale_freq, scale_cpu);
 
        /* delta_w is the amount already accumulated against our next period */
        delta_w = sa->period_contrib;