Lines Matching refs:i
72 int i, freq_count; in main() local
79 for (i = 0; i < argc; i++) { in main()
80 if (!strcmp(argv[i], "-n")) { in main()
81 if (i + 1 >= argc) { in main()
86 iterations = atoi(argv[++i]); in main()
89 if (!strcmp(argv[i], "-d")) { in main()
90 if (i + 1 >= argc) { in main()
95 delay = atoi(argv[++i]); in main()
98 if (!strcmp(argv[i], "-m")) { in main()
101 if (!strcmp(argv[i], "-h")) { in main()
115 for (i = 0; i < cpu_count; i++) { in main()
116 freq_count = get_freq_scales_count(i); in main()
118 old_cpus[i].freq_count = new_cpus[i].freq_count = freq_count; in main()
119 new_cpus[i].freqs = malloc(sizeof(struct freq_info) * new_cpus[i].freq_count); in main()
120 if (!new_cpus[i].freqs) die("Could not allocate struct freq_info\n"); in main()
121 old_cpus[i].freqs = malloc(sizeof(struct freq_info) * old_cpus[i].freq_count); in main()
122 if (!old_cpus[i].freqs) die("Could not allocate struct freq_info\n"); in main()
160 for (i = 0; i < cpu_count; i++) { in main()
161 free(new_cpus[i].freqs); in main()
162 free(old_cpus[i].freqs); in main()
240 int i; in read_stats() local
248 for (i = 0; i < new_total_cpu.freq_count; i++) { in read_stats()
249 new_total_cpu.freqs[i].time = 0; in read_stats()
253 for (i = 0; i < cpu_count; i++) { in read_stats()
254 sprintf(scanline, "cpu%d %%lu %%lu %%lu %%lu %%lu %%lu %%lu %%*d %%*d %%*d\n", i); in read_stats()
255 fscanf(file, scanline, &new_cpus[i].utime, &new_cpus[i].ntime, &new_cpus[i].stime, in read_stats()
256 &new_cpus[i].itime, &new_cpus[i].iowtime, &new_cpus[i].irqtime, in read_stats()
257 &new_cpus[i].sirqtime); in read_stats()
258 read_freq_stats(i); in read_stats()
269 int i; in read_freq_stats() local
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()
304 int i; in print_stats() local
310 for (i = 0; i < cpu_count; i++) { in print_stats()
311 sprintf(label, "cpu%d", i); in print_stats()
312 print_cpu_stats(label, &new_cpus[i], &old_cpus[i], print_freq); in print_stats()
358 int i; in print_freq_stats() local
364 for (i = 0; i < new_cpu->freq_count; i++) { in print_freq_stats()
365 delta_time = new_cpu->freqs[i].time - old_cpu->freqs[i].time; in print_freq_stats()
367 printf("%ukHz %ld", new_cpu->freqs[i].freq, delta_time); in print_freq_stats()
368 if (i + 1 != new_cpu->freq_count) { in print_freq_stats()
376 for (i = 0; i < new_cpu->freq_count; i++) { in print_freq_stats()
377 printf(",%u,%ld", new_cpu->freqs[i].freq, in print_freq_stats()
378 new_cpu->freqs[i].time - old_cpu->freqs[i].time); in print_freq_stats()
392 int i, j; in should_print_freq_stats() local
394 for (i = 1; i < cpu_count; i++) { in should_print_freq_stats()
395 for (j = 0; j < new_cpus[i].freq_count; j++) { in should_print_freq_stats()
396 if (new_cpus[i].freqs[j].time - old_cpus[i].freqs[j].time != in should_print_freq_stats()
413 int i, j; in should_aggregate_freq_stats() local
415 for (i = 1; i < cpu_count; i++) { in should_aggregate_freq_stats()
416 if (new_cpus[i].freq_count != new_cpus[0].freq_count) { in should_aggregate_freq_stats()
419 for (j = 0; j < new_cpus[i].freq_count; j++) { in should_aggregate_freq_stats()
420 if (new_cpus[i].freqs[j].freq != new_cpus[0].freqs[j].freq) { in should_aggregate_freq_stats()