Lines Matching refs:i
71 int i, freq_count; in main() local
78 for (i = 0; i < argc; i++) { in main()
79 if (!strcmp(argv[i], "-n")) { in main()
80 if (i + 1 >= argc) { in main()
85 iterations = atoi(argv[++i]); in main()
88 if (!strcmp(argv[i], "-d")) { in main()
89 if (i + 1 >= argc) { in main()
94 delay = atoi(argv[++i]); in main()
97 if (!strcmp(argv[i], "-m")) { in main()
100 if (!strcmp(argv[i], "-h")) { in main()
113 for (i = 0; i < cpu_count; i++) { in main()
114 old_cpus[i].freq_count = new_cpus[i].freq_count = get_freq_scales_count(i); in main()
115 new_cpus[i].freqs = malloc(sizeof(struct freq_info) * new_cpus[i].freq_count); in main()
116 if (!new_cpus[i].freqs) die("Could not allocate struct freq_info\n"); in main()
117 old_cpus[i].freqs = malloc(sizeof(struct freq_info) * old_cpus[i].freq_count); in main()
118 if (!old_cpus[i].freqs) die("Could not allocate struct freq_info\n"); in main()
156 for (i = 0; i < cpu_count; i++) { in main()
157 free(new_cpus[i].freqs); in main()
158 free(old_cpus[i].freqs); in main()
236 int i; in read_stats() local
244 for (i = 0; i < new_total_cpu.freq_count; i++) { in read_stats()
245 new_total_cpu.freqs[i].time = 0; in read_stats()
249 for (i = 0; i < cpu_count; i++) { in read_stats()
250 sprintf(scanline, "cpu%d %%lu %%lu %%lu %%lu %%lu %%lu %%lu %%*d %%*d %%*d\n", i); in read_stats()
251 fscanf(file, scanline, &new_cpus[i].utime, &new_cpus[i].ntime, &new_cpus[i].stime, in read_stats()
252 &new_cpus[i].itime, &new_cpus[i].iowtime, &new_cpus[i].irqtime, in read_stats()
253 &new_cpus[i].sirqtime); in read_stats()
254 read_freq_stats(i); in read_stats()
265 int i; in read_freq_stats() local
270 for (i = 0; i < new_cpus[cpu].freq_count; i++) { in read_freq_stats()
271 fscanf(file, "%u %lu\n", &new_cpus[cpu].freqs[i].freq, in read_freq_stats()
272 &new_cpus[cpu].freqs[i].time); in read_freq_stats()
274 new_total_cpu.freqs[i].freq = new_cpus[cpu].freqs[i].freq; in read_freq_stats()
275 new_total_cpu.freqs[i].time += new_cpus[cpu].freqs[i].time; in read_freq_stats()
294 int i, j; in print_stats() local
300 for (i = 0; i < cpu_count; i++) { in print_stats()
301 sprintf(label, "cpu%d", i); in print_stats()
302 print_cpu_stats(label, &new_cpus[i], &old_cpus[i], print_freq); in print_stats()
348 int i; in print_freq_stats() local
354 for (i = 0; i < new_cpu->freq_count; i++) { in print_freq_stats()
355 delta_time = new_cpu->freqs[i].time - old_cpu->freqs[i].time; in print_freq_stats()
357 printf("%ukHz %ld", new_cpu->freqs[i].freq, delta_time); in print_freq_stats()
358 if (i + 1 != new_cpu->freq_count) { in print_freq_stats()
366 for (i = 0; i < new_cpu->freq_count; i++) { in print_freq_stats()
367 printf(",%u,%ld", new_cpu->freqs[i].freq, in print_freq_stats()
368 new_cpu->freqs[i].time - old_cpu->freqs[i].time); in print_freq_stats()
382 int i, j; in should_print_freq_stats() local
384 for (i = 1; i < cpu_count; i++) { in should_print_freq_stats()
385 for (j = 0; j < new_cpus[i].freq_count; j++) { in should_print_freq_stats()
386 if (new_cpus[i].freqs[j].time - old_cpus[i].freqs[j].time != in should_print_freq_stats()
403 int i, j; in should_aggregate_freq_stats() local
405 for (i = 1; i < cpu_count; i++) { in should_aggregate_freq_stats()
406 if (new_cpus[i].freq_count != new_cpus[0].freq_count) { in should_aggregate_freq_stats()
409 for (j = 0; j < new_cpus[i].freq_count; j++) { in should_aggregate_freq_stats()
410 if (new_cpus[i].freqs[j].freq != new_cpus[0].freqs[j].freq) { in should_aggregate_freq_stats()