kconfig: speed up all*config + randconfig
Drop the chatty mode when we generate the all*config, randconfig configurations. Ths speeds up the process considerably and noone looked at the output anyway. This patch uses the conf_set_all_new_symbols() function just added to kconfig. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Roman Zippel <zippel@linux-m68k.org>
This commit is contained in:
@@ -76,7 +76,6 @@ static void check_stdin(void)
|
|||||||
static int conf_askvalue(struct symbol *sym, const char *def)
|
static int conf_askvalue(struct symbol *sym, const char *def)
|
||||||
{
|
{
|
||||||
enum symbol_type type = sym_get_type(sym);
|
enum symbol_type type = sym_get_type(sym);
|
||||||
tristate val;
|
|
||||||
|
|
||||||
if (!sym_has_value(sym))
|
if (!sym_has_value(sym))
|
||||||
printf(_("(NEW) "));
|
printf(_("(NEW) "));
|
||||||
@@ -92,15 +91,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (input_mode) {
|
switch (input_mode) {
|
||||||
case set_no:
|
|
||||||
case set_mod:
|
|
||||||
case set_yes:
|
|
||||||
case set_random:
|
|
||||||
if (sym_has_value(sym)) {
|
|
||||||
printf("%s\n", def);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ask_new:
|
case ask_new:
|
||||||
case ask_silent:
|
case ask_silent:
|
||||||
if (sym_has_value(sym)) {
|
if (sym_has_value(sym)) {
|
||||||
@@ -128,52 +118,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
|
|||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
switch (input_mode) {
|
|
||||||
case set_yes:
|
|
||||||
if (sym_tristate_within_range(sym, yes)) {
|
|
||||||
line[0] = 'y';
|
|
||||||
line[1] = '\n';
|
|
||||||
line[2] = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case set_mod:
|
|
||||||
if (type == S_TRISTATE) {
|
|
||||||
if (sym_tristate_within_range(sym, mod)) {
|
|
||||||
line[0] = 'm';
|
|
||||||
line[1] = '\n';
|
|
||||||
line[2] = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (sym_tristate_within_range(sym, yes)) {
|
|
||||||
line[0] = 'y';
|
|
||||||
line[1] = '\n';
|
|
||||||
line[2] = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case set_no:
|
|
||||||
if (sym_tristate_within_range(sym, no)) {
|
|
||||||
line[0] = 'n';
|
|
||||||
line[1] = '\n';
|
|
||||||
line[2] = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case set_random:
|
|
||||||
do {
|
|
||||||
val = (tristate)(rand() % 3);
|
|
||||||
} while (!sym_tristate_within_range(sym, val));
|
|
||||||
switch (val) {
|
|
||||||
case no: line[0] = 'n'; break;
|
|
||||||
case mod: line[0] = 'm'; break;
|
|
||||||
case yes: line[0] = 'y'; break;
|
|
||||||
}
|
|
||||||
line[1] = '\n';
|
|
||||||
line[2] = 0;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
printf("%s", line);
|
printf("%s", line);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -374,16 +318,12 @@ static int conf_choice(struct menu *menu)
|
|||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
case set_random:
|
|
||||||
if (is_new)
|
|
||||||
def = (rand() % cnt) + 1;
|
|
||||||
case set_default:
|
case set_default:
|
||||||
case set_yes:
|
|
||||||
case set_mod:
|
|
||||||
case set_no:
|
|
||||||
cnt = def;
|
cnt = def;
|
||||||
printf("%d\n", cnt);
|
printf("%d\n", cnt);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_childs:
|
conf_childs:
|
||||||
@@ -494,6 +434,43 @@ static void check_conf(struct menu *menu)
|
|||||||
check_conf(child);
|
check_conf(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void conf_do_update(void)
|
||||||
|
{
|
||||||
|
/* Update until a loop caused no more changes */
|
||||||
|
do {
|
||||||
|
conf_cnt = 0;
|
||||||
|
check_conf(&rootmenu);
|
||||||
|
} while (conf_cnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int conf_silent_update(void)
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
|
||||||
|
if (conf_get_changed()) {
|
||||||
|
name = getenv("KCONFIG_NOSILENTUPDATE");
|
||||||
|
if (name && *name) {
|
||||||
|
fprintf(stderr,
|
||||||
|
_("\n*** Kernel configuration requires explicit update.\n\n"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
conf_do_update();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int conf_update(void)
|
||||||
|
{
|
||||||
|
rootEntry = &rootmenu;
|
||||||
|
conf(&rootmenu);
|
||||||
|
if (input_mode == ask_all) {
|
||||||
|
input_mode = ask_silent;
|
||||||
|
valid_stdin = 1;
|
||||||
|
}
|
||||||
|
conf_do_update();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int main(int ac, char **av)
|
||||||
{
|
{
|
||||||
int opt;
|
int opt;
|
||||||
@@ -599,36 +576,41 @@ int main(int ac, char **av)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
switch (input_mode) {
|
||||||
if (input_mode != ask_silent) {
|
case set_no:
|
||||||
rootEntry = &rootmenu;
|
conf_set_all_new_symbols(def_no);
|
||||||
conf(&rootmenu);
|
break;
|
||||||
if (input_mode == ask_all) {
|
case set_yes:
|
||||||
input_mode = ask_silent;
|
conf_set_all_new_symbols(def_yes);
|
||||||
valid_stdin = 1;
|
break;
|
||||||
}
|
case set_mod:
|
||||||
} else if (conf_get_changed()) {
|
conf_set_all_new_symbols(def_mod);
|
||||||
name = getenv("KCONFIG_NOSILENTUPDATE");
|
break;
|
||||||
if (name && *name) {
|
case set_random:
|
||||||
fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n"));
|
conf_set_all_new_symbols(def_random);
|
||||||
return 1;
|
break;
|
||||||
}
|
case ask_silent:
|
||||||
} else
|
if (conf_silent_update())
|
||||||
goto skip_check;
|
exit(1);
|
||||||
|
break;
|
||||||
do {
|
case ask_new:
|
||||||
conf_cnt = 0;
|
case ask_all:
|
||||||
check_conf(&rootmenu);
|
case set_default:
|
||||||
} while (conf_cnt);
|
if (conf_update())
|
||||||
if (conf_write(NULL)) {
|
exit(1);
|
||||||
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
|
break;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
skip_check:
|
|
||||||
|
if (conf_get_changed() && conf_write(NULL)) {
|
||||||
|
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
/* ask_silent is used during the build so we shall update autoconf.
|
||||||
|
* All other commands are only used to generate a config.
|
||||||
|
*/
|
||||||
if (input_mode == ask_silent && conf_write_autoconf()) {
|
if (input_mode == ask_silent && conf_write_autoconf()) {
|
||||||
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
|
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user