Lines Matching refs:cpu
58 static long unsigned get_cpu_total_time(struct cpu_info *cpu);
59 static int get_freq_scales_count(int cpu);
65 static void read_freq_stats(int cpu);
215 static int get_freq_scales_count(int cpu) { in get_freq_scales_count() argument
221 sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", cpu); in get_freq_scales_count()
266 static void read_freq_stats(int cpu) { in read_freq_stats() argument
271 sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", cpu); in read_freq_stats()
273 for (i = 0; i < new_cpus[cpu].freq_count; i++) { in read_freq_stats()
275 fscanf(file, "%u %lu\n", &new_cpus[cpu].freqs[i].freq, in read_freq_stats()
276 &new_cpus[cpu].freqs[i].time); in read_freq_stats()
279 new_cpus[cpu].freqs[i].freq = old_cpus[cpu].freqs[i].freq; in read_freq_stats()
280 new_cpus[cpu].freqs[i].time = old_cpus[cpu].freqs[i].time; in read_freq_stats()
283 new_total_cpu.freqs[i].freq = new_cpus[cpu].freqs[i].freq; in read_freq_stats()
284 new_total_cpu.freqs[i].time += new_cpus[cpu].freqs[i].time; in read_freq_stats()
294 static long unsigned get_cpu_total_time(struct cpu_info *cpu) { in get_cpu_total_time() argument
295 return (cpu->utime + cpu->ntime + cpu->stime + cpu->itime + cpu->iowtime + cpu->irqtime + in get_cpu_total_time()
296 cpu->sirqtime); in get_cpu_total_time()