| This is cpufreq-bench, a microbenchmark for the cpufreq framework. |
| |
| description: |
| cpufreq-bench helps to test the condition of a given cpufreq governor. |
| For that purpose, it compares the performance governor to a configured |
| powersave module. |
| |
| The functional principle is quite easy: we generate a load for a specific |
| time with the performance governor. The load is generated with some rounds |
| of calculation. Now, we idle for some time to let the CPU change to a lower |
| frequency. Then, We take that amount of rounds and do another test with |
| the powersave governor. But now, we don’t generate load for a specific time |
| but rather generate load with the amount of calculations we’ve got. |
| The resulting time is compared to the time we spent for the initial |
| performance calculation. |
| The powersave cycle should take 1-40% longer than the performance cycle due |
| to the time the CPU needs to change to a higher frequency. |
| nr. of calculations |
| |
| ^ |
| |__________________ _ _ _ _ _ |
| | performance | powersave| |
| | | | |
| | | | |
| |-----------------------------------------------> time |
| |
| To get a more precise value, this sleep/load cycle is done several times. |
| We use the average values for the comparison. |
| After each round, a specific time is added to the load and sleep time to see |
| how good the sleep/load switch behaves with different timeframes. |
| |
| |
| usage: |
| -l, --load=<long int> initial load time in us |
| -s, --sleep=<long int> initial sleep time in us |
| -x, --load-step=<long int> time to be added to load time, in us |
| -y, --sleep-step=<long int> time to be added to sleep time, in us |
| -c, --cpu=<unsigned int> CPU Number to use, starting at 0 |
| -p, --prio=<priority> scheduler priority, HIGH, LOW or DEFAULT |
| -g, --governor=<governor> cpufreq governor to test |
| -n, --cycles=<int> load/sleep cycles to get an avarage value to compare |
| -r, --rounds<int> load/sleep rounds |
| -f, --file=<configfile> config file to use |
| -o, --output=<dir> output dir, must exist |
| -v, --verbose verbose output on/off |
| |
| Due to the high priority, the application my not be responsible for some time. |
| After the benchmark, the logfile is saved in OUTPUTDIR/benchmark_TIMESTAMP.log |
| |