Lines Matching refs:config

120 struct config *prepare_default_config()  in prepare_default_config()
122 struct config *config = malloc(sizeof(struct config)); in prepare_default_config() local
126 config->sleep = 500000; in prepare_default_config()
127 config->load = 500000; in prepare_default_config()
128 config->sleep_step = 500000; in prepare_default_config()
129 config->load_step = 500000; in prepare_default_config()
130 config->cycles = 5; in prepare_default_config()
131 config->rounds = 50; in prepare_default_config()
132 config->cpu = 0; in prepare_default_config()
133 config->prio = SCHED_HIGH; in prepare_default_config()
134 config->verbose = 0; in prepare_default_config()
135 strncpy(config->governor, "ondemand", sizeof(config->governor)); in prepare_default_config()
137 config->output = stdout; in prepare_default_config()
140 if (prepare_config(DEFAULT_CONFIG_FILE, config)) in prepare_default_config()
143 return config; in prepare_default_config()
155 int prepare_config(const char *path, struct config *config) in prepare_config() argument
161 if (config == NULL) { in prepare_config()
170 free(config); in prepare_config()
184 sscanf(val, "%li", &config->sleep); in prepare_config()
187 sscanf(val, "%li", &config->load); in prepare_config()
190 sscanf(val, "%li", &config->load_step); in prepare_config()
193 sscanf(val, "%li", &config->sleep_step); in prepare_config()
196 sscanf(val, "%u", &config->cycles); in prepare_config()
199 sscanf(val, "%u", &config->rounds); in prepare_config()
202 sscanf(val, "%u", &config->verbose); in prepare_config()
205 config->output = prepare_output(val); in prepare_config()
208 sscanf(val, "%u", &config->cpu); in prepare_config()
211 strncpy(config->governor, val, in prepare_config()
212 sizeof(config->governor)); in prepare_config()
213 config->governor[sizeof(config->governor) - 1] = '\0'; in prepare_config()
218 config->prio = string_to_prio(val); in prepare_config()