23 #include <sys/types.h>
61 dprintf(
"set %s as cpufreq governor\n", governor);
64 perror(
"cpufreq_cpu_exists");
65 fprintf(stderr,
"error: cpu %u does not exist\n", cpu);
70 perror(
"cpufreq_modify_policy_governor");
71 fprintf(stderr,
"error: unable to set %s governor\n", governor);
92 CPU_SET(cpu, &cpuset);
94 dprintf(
"set affinity to cpu #%u\n", cpu);
97 perror(
"sched_setaffinity");
98 fprintf(stderr,
"warning: unable to set cpu affinity\n");
118 dprintf(
"set scheduler priority to %i\n", priority);
123 perror(
"sched_setscheduler");
124 fprintf(stderr,
"warning: unable to set scheduler priority\n");
140 unsigned long sleep_time = 0;
141 unsigned long load_time = 0;
144 for (round = 0; round < config->
rounds; round++) {
145 sleep_time += 2 * config->
cycles *
147 load_time += 2 * config->
cycles *
153 printf(
"approx. test duration: %im\n",
154 (
int)((sleep_time + load_time) / 60000000));
167 printf(
"set cpu affinity to cpu #%u\n", config->
cpu);
171 switch (config->
prio) {
174 printf(
"high priority condition requested\n");
180 printf(
"low priority condition requested\n");
186 printf(
"default priority condition requested\n");