2007-05-10 03:51:09

by Paul Mundt

[permalink] [raw]
Subject: [PATCH] net: trivial MLX4_DEBUG dependency fix.

First SLUB_DEBUG, and now this..

CONFIG_MLX4_DEBUG works out to a def_bool y for those that
have CONFIG_EMBEDDED set. Make it depend on MLX4_CORE..

I'll let someone else wonder why debugging output is default enabled,
this seems to be a worrying trend as of late.

Signed-off-by: Paul Mundt <[email protected]>

--

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index fa489b1..b3f4ffa 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2500,6 +2500,7 @@ config MLX4_CORE

config MLX4_DEBUG
bool "Verbose debugging output" if (MLX4_CORE && EMBEDDED)
+ depends on MLX4_CORE
default y
---help---
This option causes debugging code to be compiled into the


2007-05-10 11:45:48

by Roland Dreier

[permalink] [raw]
Subject: Re: [PATCH] net: trivial MLX4_DEBUG dependency fix.

> CONFIG_MLX4_DEBUG works out to a def_bool y for those that
> have CONFIG_EMBEDDED set. Make it depend on MLX4_CORE..

Thanks, applied... (by the way, this bug just results in an
extraneous CONFIG variable being defined, right? There's no further
breakage -- or am I misunderstanding the situation?)

> I'll let someone else wonder why debugging output is default enabled,
> this seems to be a worrying trend as of late.

Actually this option just controls whether to build the debugging
output at all. The output is controlled at runtime with a module
parameter (which can be changed via sysfs after the module is loaded),
and the output defaults to off.

The reason why I want building the debugging stuff to default to y is
so that distros automatically build modules with debugging enabled.
Otherwise it's a pain to try and gather info from someone who has
problems with a kernel they didn't build.

Thanks,
Roland

2007-05-10 12:11:30

by Satyam Sharma

[permalink] [raw]
Subject: Re: [PATCH] net: trivial MLX4_DEBUG dependency fix.

Hi,

On 5/10/07, Roland Dreier <[email protected]> wrote:
> > CONFIG_MLX4_DEBUG works out to a def_bool y for those that
> > have CONFIG_EMBEDDED set. Make it depend on MLX4_CORE..
>
> Thanks, applied... (by the way, this bug just results in an
> extraneous CONFIG variable being defined, right? There's no further
> breakage -- or am I misunderstanding the situation?)

Yeah, it won't cause any build breakage. It doesn't cause anything to
even get _built_ actually, because of the way this config option is
used directly in the .h and .c sources in drivers/net/mlx4/ (which is
itself compiled only when MLX4_CORE=y or m), and not in a Makefile.

> > I'll let someone else wonder why debugging output is default enabled,
> > this seems to be a worrying trend as of late.
>
> Actually this option just controls whether to build the debugging
> output at all. The output is controlled at runtime with a module
> parameter (which can be changed via sysfs after the module is loaded),
> and the output defaults to off.
>
> The reason why I want building the debugging stuff to default to y is
> so that distros automatically build modules with debugging enabled.
> Otherwise it's a pain to try and gather info from someone who has
> problems with a kernel they didn't build.

IMHO default configs must be aimed at production usage scenarios, so
are better off without debugging enabled by default. Except if the
driver is really new / EXPERIMENTAL where the goal is to get it tested
out by all users asap (and no production systems would be using it
anyway).

Just my 2 paise,
Satyam

2007-05-10 12:50:05

by Paul Mundt

[permalink] [raw]
Subject: Re: [PATCH] net: trivial MLX4_DEBUG dependency fix.

On Thu, May 10, 2007 at 04:42:37AM -0700, Roland Dreier wrote:
> > CONFIG_MLX4_DEBUG works out to a def_bool y for those that
> > have CONFIG_EMBEDDED set. Make it depend on MLX4_CORE..
>
> Thanks, applied... (by the way, this bug just results in an
> extraneous CONFIG variable being defined, right? There's no further
> breakage -- or am I misunderstanding the situation?)
>
Correct, there was no real breakage, just the extraneous variable.
SLUB_DEBUG had the same symptoms, which is why I referenced it ;-)

> > I'll let someone else wonder why debugging output is default enabled,
> > this seems to be a worrying trend as of late.
>
> Actually this option just controls whether to build the debugging
> output at all. The output is controlled at runtime with a module
> parameter (which can be changed via sysfs after the module is loaded),
> and the output defaults to off.
>
> The reason why I want building the debugging stuff to default to y is
> so that distros automatically build modules with debugging enabled.
> Otherwise it's a pain to try and gather info from someone who has
> problems with a kernel they didn't build.
>
That's more reasonable at least. Thanks for the clarification.

2007-05-10 18:20:35

by Roland Dreier

[permalink] [raw]
Subject: Re: [PATCH] net: trivial MLX4_DEBUG dependency fix.

> IMHO default configs must be aimed at production usage scenarios, so
> are better off without debugging enabled by default. Except if the
> driver is really new / EXPERIMENTAL where the goal is to get it tested
> out by all users asap (and no production systems would be using it
> anyway).

I agree, but I would hope that MLX4_DEBUG *is* enabled in production.
It doesn't print anything or introduce any measurable overhead except
for slightly larger code size unless the debug level is explicitly
increased, so the only reason to turn it off is if a few bytes of code
makes a big difference to you (hence making it selectable only if
EMBEDDED is selected).