Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpupowerutils
[pandora-kernel.git] / tools / power / cpupower / bench / parse.h
1 /*  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 */
21 struct 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,
36                 SCHED_HIGH,
37                 SCHED_DEFAULT,
38                 SCHED_LOW
39         } prio;
40
41         unsigned int verbose;   /* verbose output */
42         FILE *output;           /* logfile */
43         char *output_filename;  /* logfile name, must be freed at the end
44                                    if output != NULL and output != stdout*/
45 };
46
47 enum sched_prio string_to_prio(const char *str);
48
49 FILE *prepare_output(const char *dir);
50
51 int prepare_config(const char *path, struct config *config);
52 struct config *prepare_default_config();
53