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);
212 static int get_freq_scales_count(int cpu) { in get_freq_scales_count() argument
218 sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", cpu); in get_freq_scales_count()
263 static void read_freq_stats(int cpu) { in read_freq_stats() argument
268 sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", cpu); in read_freq_stats()
270 for (i = 0; i < new_cpus[cpu].freq_count; i++) { in read_freq_stats()
272 fscanf(file, "%u %lu\n", &new_cpus[cpu].freqs[i].freq, in read_freq_stats()
273 &new_cpus[cpu].freqs[i].time); in read_freq_stats()
276 new_cpus[cpu].freqs[i].freq = old_cpus[cpu].freqs[i].freq; in read_freq_stats()
277 new_cpus[cpu].freqs[i].time = old_cpus[cpu].freqs[i].time; in read_freq_stats()
280 new_total_cpu.freqs[i].freq = new_cpus[cpu].freqs[i].freq; in read_freq_stats()
281 new_total_cpu.freqs[i].time += new_cpus[cpu].freqs[i].time; in read_freq_stats()
291 static long unsigned get_cpu_total_time(struct cpu_info *cpu) { in get_cpu_total_time() argument
292 return (cpu->utime + cpu->ntime + cpu->stime + cpu->itime + cpu->iowtime + cpu->irqtime + in get_cpu_total_time()
293 cpu->sirqtime); in get_cpu_total_time()