mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@redhat.com>
To: Roman Fietze <roman.fietze@telemotive.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dynamic_debug: allow to set dynamic debug flags right at module load time
Date: Wed, 26 May 2010 14:35:59 -0400	[thread overview]
Message-ID: <20100526183559.GA5094@redhat.com> (raw)
In-Reply-To: <201005261425.39058.roman.fietze@telemotive.de>

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

  reply	other threads:[~2010-05-26 18:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26 12:25 Roman Fietze
2010-05-26 18:35 ` Jason Baron [this message]
2010-05-27  5:05   ` Roman Fietze
2010-05-28 13:55     ` Jason Baron
2010-06-29 11:25       ` Roman Fietze
2010-07-01 20:43         ` Jason Baron
2010-07-02  8:16           ` [PATCH] dynamic_debug: parse module parameters to enable dynamic printk at " Roman Fietze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100526183559.GA5094@redhat.com \
    --to=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roman.fietze@telemotive.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome