diff mbox

[1/6] add symbol value to help find the real depend

Message ID 1247386308-19628-2-git-send-email-crq@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Cheng Renquan July 12, 2009, 8:11 a.m. UTC
From: Cheng Renquan <crquan@gmail.com>

kbuild-menuconfig-display-depend-value.patch

Sometimes when configuring need to disable some unused item, but the item is
selected by many other items, it's hard to find the real dependency which
selected it, This patch add every symbol's value accompanied to make it
possible to find the real dependency easily.

An example is CONFIG_RFKILL,

  ---------------------- RF switch subsystem support ----------------------
  | CONFIG_RFKILL:                                                        |
  |                                                                       |
  | Say Y here if you want to have control over RF switches               |
  | found on many WiFi and Bluetooth cards.                               |
  |                                                                       |
  | To compile this driver as a module, choose M here: the                |
  | module will be called rfkill.                                         |
  |                                                                       |
  | Symbol: RFKILL [=m]                                                   |
  | Prompt: RF switch subsystem support                                   |
  |   Defined at net/rfkill/Kconfig:4                                     |
  |   Depends on: NET [=y]                                                |
  |   Location:                                                           |
  |     -> Networking support (NET [=y])                                  |
  |   Selected by: IWLCORE [=n] && NETDEVICES [=y] && !S390 [=S390] && PC |
  |                                                                       |
  ----------------------------------------------------------------( 99%)---

Signed-off-by: Cheng Renquan <crquan@gmail.com>
---
 scripts/kconfig/expr.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Mikael Pettersson July 12, 2009, 10 a.m. UTC | #1
Cheng Renquan writes:
 > From: Cheng Renquan <crquan@gmail.com>
 > 
 > kbuild-menuconfig-display-depend-value.patch
 > 
 > Sometimes when configuring need to disable some unused item, but the item is
 > selected by many other items, it's hard to find the real dependency which
 > selected it, This patch add every symbol's value accompanied to make it
 > possible to find the real dependency easily.
 > 
 > An example is CONFIG_RFKILL,
 > 
 >   ---------------------- RF switch subsystem support ----------------------
 >   | CONFIG_RFKILL:                                                        |
 >   |                                                                       |
 >   | Say Y here if you want to have control over RF switches               |
 >   | found on many WiFi and Bluetooth cards.                               |
 >   |                                                                       |
 >   | To compile this driver as a module, choose M here: the                |
 >   | module will be called rfkill.                                         |
 >   |                                                                       |
 >   | Symbol: RFKILL [=m]                                                   |
 >   | Prompt: RF switch subsystem support                                   |
 >   |   Defined at net/rfkill/Kconfig:4                                     |
 >   |   Depends on: NET [=y]                                                |
 >   |   Location:                                                           |
 >   |     -> Networking support (NET [=y])                                  |
 >   |   Selected by: IWLCORE [=n] && NETDEVICES [=y] && !S390 [=S390] && PC |
 >   |                                                                       |
 >   ----------------------------------------------------------------( 99%)---

I like this concept, but I'd like to see it supported with make oldconfig.
Let's say I copy a .config from kernel X into kernel Y (Y>X) and make oldconfig.
Sometimes the new kernel will enable some previously disabled option, and
it would be very useful to see WHY.

To take a concrete example, in my 2.6.30 .config I had:

CONFIG_DRM=m
CONFIG_DRM_RADEON=m
# CONFIG_FB is not set

which when oldconfig'd in 2.6.31-rc changed to

CONFIG_DRM=m
CONFIG_DRM_RADEON=m
CONFIG_FB=m
(+ some more FB stuff)

In this case it would have been nice to get an explanation that DRM_RADEON
was responsible for (wrongly, IMO) selecting FB. Something like

# CONFIG_FB was selected by CONFIG_DRM_RADEON
CONFIG_FB=m

These comments should only be emitted for options added by select that
previously were absent or 'is not set'.

/Mikael
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Cheng Renquan July 12, 2009, 5:14 p.m. UTC | #2
On Sun, Jul 12, 2009 at 10:00 AM, Mikael Pettersson<mikpe@it.uu.se> wrote:
[...]
> I like this concept, but I'd like to see it supported with make oldconfig.

'make oldconfig' uses the same 'scripts/kconfig/conf' program as the
'make config' does, which is supported already in this series of
patches,

> Let's say I copy a .config from kernel X into kernel Y (Y>X) and make oldconfig.
> Sometimes the new kernel will enable some previously disabled option, and
> it would be very useful to see WHY.
>
> To take a concrete example, in my 2.6.30 .config I had:
>
> CONFIG_DRM=m
> CONFIG_DRM_RADEON=m
> # CONFIG_FB is not set
>
> which when oldconfig'd in 2.6.31-rc changed to
>
> CONFIG_DRM=m
> CONFIG_DRM_RADEON=m
> CONFIG_FB=m
> (+ some more FB stuff)
>
> In this case it would have been nice to get an explanation that DRM_RADEON
> was responsible for (wrongly, IMO) selecting FB. Something like
>
> # CONFIG_FB was selected by CONFIG_DRM_RADEON
> CONFIG_FB=m
>
> These comments should only be emitted for options added by select that
> previously were absent or 'is not set'.

The conf system is not so smart to find the recent changes (you may
try scripts/diffconfig to diff two .config),

Anyway, if you don't like CONFIG_FB and have no idea why it is
selected, you can navigate to CONFIG_FB in
menuconfig/gconfig/xconfig/config, and find out the real dependency
reason from its help message,

>
> /Mikael
>

--
Cheng Renquan (程任全), from Shenzhen, China
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index 579ece4..cd8a2f0 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -1098,6 +1098,8 @@  void expr_fprint(struct expr *e, FILE *out)
 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str)
 {
 	str_append((struct gstr*)data, str);
+	if (sym)
+		str_printf((struct gstr*)data, " [=%s]", sym_get_string_value(sym));
 }
 
 void expr_gstr_print(struct expr *e, struct gstr *gs)