From 22c7eca61e51296643bb0a379fc726fda8f3b015 Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Wed, 14 Apr 2010 11:46:02 +0800 Subject: menuconfig: add support to show hidden options which have prompts Usage: Press to show all config symbols which have prompts. Quote Tim Bird: | I've been bitten by this numerous times. I most often | use ftrace on ARM, but when I go back to x86, I almost | always go through a sequence of searching for the | function graph tracer in the menus, then realizing it's | completely missing until I disable CC_OPTIMIZE_FOR_SIZE. | | Is there any way to have the menu item appear, but be | unsettable unless the SIZE option is disabled? I'm | not a Kconfig guru... I myself found this useful too. For example, I need to test ftrace/tracing and want to be sure all the tracing features are enabled, so I enter the "Tracers" menu, and press to see if there is any config hidden. I also noticed gconfig and xconfig have a button "Show all options", but that's a bit too much, and I think normally what we are not interested in those configs which have no prompt thus can't be changed by users. Exmaple: --- Tracers -*- Kernel Function Tracer - - Kernel Function Graph Tracer [*] Interrupts-off Latency Tracer - - Preemption-off Latency Tracer [*] Sysprof Tracer Here you can see 2 tracers are not selectable, and then can find out how to make them selectable. Signed-off-by: Li Zefan Signed-off-by: Michal Marek --- scripts/kconfig/menu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/kconfig/menu.c') diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 62e3f15ede0f..203632cc30bd 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -390,6 +390,13 @@ void menu_finalize(struct menu *parent) } } +bool menu_has_prompt(struct menu *menu) +{ + if (!menu->prompt) + return false; + return true; +} + bool menu_is_visible(struct menu *menu) { struct menu *child; @@ -398,6 +405,7 @@ bool menu_is_visible(struct menu *menu) if (!menu->prompt) return false; + sym = menu->sym; if (sym) { sym_calc_value(sym); @@ -407,12 +415,14 @@ bool menu_is_visible(struct menu *menu) if (visible != no) return true; + if (!sym || sym_get_tristate_value(menu->sym) == no) return false; for (child = menu->list; child; child = child->next) if (menu_is_visible(child)) return true; + return false; } -- cgit v1.2.3-59-g8ed1b