Lines Matching refs:file
188 FILE *file; in get_cpu_count_from_file() local
192 file = fopen(filename, "r"); in get_cpu_count_from_file()
193 if (!file) die("Could not open %s\n", filename); in get_cpu_count_from_file()
194 if (!fgets(line, MAX_BUF_SIZE, file)) die("Could not get %s contents\n", filename); in get_cpu_count_from_file()
195 fclose(file); in get_cpu_count_from_file()
213 FILE *file; in get_freq_scales_count() local
219 file = fopen(filename, "r"); in get_freq_scales_count()
220 if (!file) die("Could not open %s\n", filename); in get_freq_scales_count()
223 fscanf(file, "%lu %*d\n", &freq); in get_freq_scales_count()
226 fclose(file); in get_freq_scales_count()
235 FILE *file; in read_stats() local
239 file = fopen("/proc/stat", "r"); in read_stats()
240 if (!file) die("Could not open /proc/stat.\n"); in read_stats()
241 fscanf(file, "cpu %lu %lu %lu %lu %lu %lu %lu %*d %*d %*d\n", in read_stats()
252 fscanf(file, scanline, &new_cpus[i].utime, &new_cpus[i].ntime, &new_cpus[i].stime, in read_stats()
257 fclose(file); in read_stats()
264 FILE *file; in read_freq_stats() local
269 file = fopen(filename, "r"); in read_freq_stats()
271 if (file) { in read_freq_stats()
272 fscanf(file, "%u %lu\n", &new_cpus[cpu].freqs[i].freq, in read_freq_stats()
284 if (file) in read_freq_stats()
285 fclose(file); in read_freq_stats()