diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2010-04-13 23:46:02 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-04-14 09:34:19 -0400 |
commit | 22c7eca61e51296643bb0a379fc726fda8f3b015 (patch) | |
tree | ee313b7cf959db1aa0e4fb33174fa8c4a1c8af3b /scripts/kconfig/menu.c | |
parent | 7b5d87215b38359ecadf7a69575b11e140a00484 (diff) |
menuconfig: add support to show hidden options which have prompts
Usage:
Press <Z> 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 <Z> 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 <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r-- | scripts/kconfig/menu.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) | |||
390 | } | 390 | } |
391 | } | 391 | } |
392 | 392 | ||
393 | bool menu_has_prompt(struct menu *menu) | ||
394 | { | ||
395 | if (!menu->prompt) | ||
396 | return false; | ||
397 | return true; | ||
398 | } | ||
399 | |||
393 | bool menu_is_visible(struct menu *menu) | 400 | bool menu_is_visible(struct menu *menu) |
394 | { | 401 | { |
395 | struct menu *child; | 402 | struct menu *child; |
@@ -398,6 +405,7 @@ bool menu_is_visible(struct menu *menu) | |||
398 | 405 | ||
399 | if (!menu->prompt) | 406 | if (!menu->prompt) |
400 | return false; | 407 | return false; |
408 | |||
401 | sym = menu->sym; | 409 | sym = menu->sym; |
402 | if (sym) { | 410 | if (sym) { |
403 | sym_calc_value(sym); | 411 | sym_calc_value(sym); |
@@ -407,12 +415,14 @@ bool menu_is_visible(struct menu *menu) | |||
407 | 415 | ||
408 | if (visible != no) | 416 | if (visible != no) |
409 | return true; | 417 | return true; |
418 | |||
410 | if (!sym || sym_get_tristate_value(menu->sym) == no) | 419 | if (!sym || sym_get_tristate_value(menu->sym) == no) |
411 | return false; | 420 | return false; |
412 | 421 | ||
413 | for (child = menu->list; child; child = child->next) | 422 | for (child = menu->list; child; child = child->next) |
414 | if (menu_is_visible(child)) | 423 | if (menu_is_visible(child)) |
415 | return true; | 424 | return true; |
425 | |||
416 | return false; | 426 | return false; |
417 | } | 427 | } |
418 | 428 | ||