[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100526183559.GA5094@redhat.com>
Date: Wed, 26 May 2010 14:35:59 -0400
From: Jason Baron <jbaron@...hat.com>
To: Roman Fietze <roman.fietze@...emotive.de>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dynamic_debug: allow to set dynamic debug flags right
at module load time
On Wed, May 26, 2010 at 02:25:38PM +0200, Roman Fietze wrote:
> Hello Jason, hello list,
>
> If I'm not wrong one could only enable any dynamic debugging flag
> after a module had been completely loaded, using debugfs. This makes
> it impossible to use dev_dbg or pr_debug e.g. inside the module init
> function or any function called by it.
>
yes, that's correct.
> My patch works by replacing _DPRINTK_FLAGS_DEFAULT after including all
> kernel headers in my module source file and some small patch inside
> dynamic_debug.c setting up the internal variables already when loading
> a module with flags unequal to zero. This patch can of course be
> optimized somewhat by reusing existing variables.
>
> Subject: [PATCH] dynamic_debug: allow to set dynamic debug flags right at module load time
>
> This allows to use e.g. pr_debug right from the beginning, e.g. in the
> module init function.
>
> - the module must redefine _DPRINTK_FLAGS_DEFAULT, e.g.
>
> #undef _DPRINTK_FLAGS_DEFAULT
> #define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT
>
> - when a module is loaded and the flags are not zero, the enabled
> count and hash masks are enabled right away
>
it's a good idea, but i think we want this to be runtime configurable.
That is, we probably want this implemented as a module parameter, not as
a compile time thing. something like: modprobe module verbose=1
thanks,
-Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists