blob: 9fcdfa23dd9cd99cee8217847fd4fb423011de0c [file] [log] [blame]
Dominik Brodowski7fe2f632011-03-30 16:30:11 +02001/* cpufreq-bench CPUFreq microbenchmark
2 *
3 * Copyright (C) 2008 Christian Kornacker <ckornacker@suse.de>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20/* struct that holds the required config parameters */
21struct config
22{
23 long sleep; /* sleep time in µs */
24 long load; /* load time in µs */
25 long sleep_step; /* time value which changes the
26 * sleep time after every round in µs */
27 long load_step; /* time value which changes the
28 * load time after every round in µs */
29 unsigned int cycles; /* calculation cycles with the same sleep/load time */
30 unsigned int rounds; /* calculation rounds with iterated sleep/load time */
31 unsigned int cpu; /* cpu for which the affinity is set */
32 char governor[15]; /* cpufreq governor */
33 enum sched_prio /* possible scheduler priorities */
34 {
35 SCHED_ERR=-1,SCHED_HIGH, SCHED_DEFAULT, SCHED_LOW
36 } prio;
37
38 unsigned int verbose; /* verbose output */
39 FILE *output; /* logfile */
40 char *output_filename; /* logfile name, must be freed at the end
41 if output != NULL and output != stdout*/
42};
43
44enum sched_prio string_to_prio(const char *str);
45
46FILE *prepare_output(const char *dir);
47
48int prepare_config(const char *path, struct config *config);
49struct config *prepare_default_config();
50