DEBUG: sched,cpufreq: add cpu_capacity change tracepoint
[firefly-linux-kernel-4.4.55.git] / kernel / sched / fair.c
index b5ea9ec335d841fde7a55cec16cb2bbf62ec4df6..9b74b86aba3aadd1b5f364c482db16b998469e0a 100644 (file)
@@ -4698,6 +4698,17 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg)
 
 #endif
 
+/*
+ * Returns the current capacity of cpu after applying both
+ * cpu and freq scaling.
+ */
+unsigned long capacity_curr_of(int cpu)
+{
+       return cpu_rq(cpu)->cpu_capacity_orig *
+              arch_scale_freq_capacity(NULL, cpu)
+              >> SCHED_CAPACITY_SHIFT;
+}
+
 static inline bool energy_aware(void)
 {
        return sched_feat(ENERGY_AWARE);