Lines Matching +full:cycle +full:- +full:0

1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* cpufreq-bench CPUFreq microbenchmark
17 if (config->output != stdout) { \
37 unsigned int rounds = 0; in calculate_timespace()
38 unsigned int timed = 0; in calculate_timespace()
40 if (config->verbose) in calculate_timespace()
48 timed = (unsigned int)(then - now); in calculate_timespace()
52 for (i = 0; i < 4; i++) { in calculate_timespace()
59 timed = (unsigned int)(then - now); in calculate_timespace()
62 if (config->verbose) in calculate_timespace()
80 unsigned int _round, cycle; in start_benchmark() local
82 long sleep_time = 0, load_time = 0; in start_benchmark()
83 long performance_time = 0, powersave_time = 0; in start_benchmark()
85 unsigned long total_time = 0, progress_time = 0; in start_benchmark()
87 sleep_time = config->sleep; in start_benchmark()
88 load_time = config->load; in start_benchmark()
91 for (_round = 1; _round <= config->rounds; _round++) in start_benchmark()
92 total_time += _round * (config->sleep + config->load); in start_benchmark()
95 for (_round = 0; _round < config->rounds; _round++) { in start_benchmark()
96 performance_time = 0LL; in start_benchmark()
97 powersave_time = 0LL; in start_benchmark()
102 * P-State switching. */ in start_benchmark()
103 if (set_cpufreq_governor("performance", config->cpu) != 0) in start_benchmark()
111 if (config->verbose) in start_benchmark()
113 " for %lius\n", _round + 1, config->cycles, in start_benchmark()
116 fprintf(config->output, "%u %li %li ", in start_benchmark()
119 if (config->verbose) in start_benchmark()
125 for (cycle = 0; cycle < config->cycles; cycle++) { in start_benchmark()
130 performance_time += then - now - sleep_time; in start_benchmark()
131 if (config->verbose) in start_benchmark()
132 printf("performance cycle took %lius, " in start_benchmark()
135 (long)(then - now), sleep_time, in start_benchmark()
138 fprintf(config->output, "%li ", in start_benchmark()
139 performance_time / config->cycles); in start_benchmark()
144 /* set the powersave governor which activates P-State switching in start_benchmark()
146 if (set_cpufreq_governor(config->governor, config->cpu) != 0) in start_benchmark()
151 for (cycle = 0; cycle < config->cycles; cycle++) { in start_benchmark()
156 powersave_time += then - now - sleep_time; in start_benchmark()
157 if (config->verbose) in start_benchmark()
158 printf("powersave cycle took %lius, " in start_benchmark()
161 (long)(then - now), sleep_time, in start_benchmark()
168 fprintf(config->output, "%li ", in start_benchmark()
169 powersave_time / config->cycles); in start_benchmark()
170 fprintf(config->output, "%.3f\n", in start_benchmark()
172 fflush(config->output); in start_benchmark()
174 if (config->verbose) in start_benchmark()
178 sleep_time += config->sleep_step; in start_benchmark()
179 load_time += config->load_step; in start_benchmark()