parse.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* cpufreq-bench CPUFreq microbenchmark
  3. *
  4. * Copyright (C) 2008 Christian Kornacker <ckornacker@suse.de>
  5. */
  6. /* struct that holds the required config parameters */
  7. struct config
  8. {
  9. long sleep; /* sleep time in µs */
  10. long load; /* load time in µs */
  11. long sleep_step; /* time value which changes the
  12. * sleep time after every round in µs */
  13. long load_step; /* time value which changes the
  14. * load time after every round in µs */
  15. unsigned int cycles; /* calculation cycles with the same sleep/load time */
  16. unsigned int rounds; /* calculation rounds with iterated sleep/load time */
  17. unsigned int cpu; /* cpu for which the affinity is set */
  18. char governor[15]; /* cpufreq governor */
  19. enum sched_prio /* possible scheduler priorities */
  20. {
  21. SCHED_ERR = -1,
  22. SCHED_HIGH,
  23. SCHED_DEFAULT,
  24. SCHED_LOW
  25. } prio;
  26. unsigned int verbose; /* verbose output */
  27. FILE *output; /* logfile */
  28. char *output_filename; /* logfile name, must be freed at the end
  29. if output != NULL and output != stdout*/
  30. };
  31. enum sched_prio string_to_prio(const char *str);
  32. FILE *prepare_output(const char *dir);
  33. int prepare_config(const char *path, struct config *config);
  34. struct config *prepare_default_config();