Messages in this thread | | | Date | Wed, 26 May 2010 14:35:59 -0400 | From | Jason Baron <> | 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
| |