From: Jason Baron <jbaron@redhat.com>
To: Jim Cromie <jim.cromie@gmail.com>
Cc: bvanassche@acm.org, joe@perches.com, gregkh@suse.de,
linux-kernel@vger.kernel.org, gnb@fmeh.org
Subject: Re: dynamic_debug: enabled vs FLAGS_PRINT, more filtering tricks.
Date: Thu, 4 Aug 2011 12:12:27 -0400 [thread overview]
Message-ID: <20110804161227.GB2462@redhat.com> (raw)
In-Reply-To: <CAJfuBxx_cSTuYoJjLkrGX3kYMvgw4Ep+rEL2VDNv-Ti5PB1C4w@mail.gmail.com>
On Wed, Jul 27, 2011 at 04:04:53PM -0600, Jim Cromie wrote:
> On Mon, Jul 25, 2011 at 3:42 PM, Jim Cromie <jim.cromie@gmail.com> wrote:
> >
> >
> > This patchset extends dynamic-debug facility to allow
> > use of pr_debug() within a loadable module's module_init()
> > function. Query/rules can be given on the boot-line,
> > and are saved to a pending list if they cannot be applied
> > immediately. Later, when the module is being loaded, the
> > pending list is scanned, and matching rules are applied.
> > Thus pr_debug() calls in the module's initialization function
> > are active when it is invoked.
> >
>
> latest version (including fixes for Barts comments) is at
> git://github.com/jimc/linux-2.6.git
> in dyndbg-next branch.
>
> Is there a reason for having both enabled and _DPRINTK_FLAGS_PRINT ?
>
> struct _ddebug {
> ...
> #define _DPRINTK_FLAGS_PRINT (1<<0)
> ...
> #define _DPRINTK_FLAGS_DEFAULT 0
> unsigned int flags:8;
> char enabled;
> } __attribute__((aligned(8)));
>
> as things stand, you can disable print flag with " -p "
> but the call-site may still be enabled, ie [tmlf]
>
> New ability to clear all flags via " =_ " handles this, but ..
>
> OTOH, if (descriptor.enabled)
> becomes if (descriptor.flags & _DPRINTK_FLAGS_PRINT)
>
> then current flags can be filtered to enable/disable previously
> selected callsites.
> echo " t+p " > /dbg/dynamic_debug/control
>
> This suggests that unused flags can be named (x,y,z for example)
> then used expressly for marking arbitrary sets of callsites,
> and toggling their enabled/disabled states.
>
> echo " x+p " > /dbg/dynamic_debug/control
> echo " y-p " > /dbg/dynamic_debug/control
> echo " z+p " > /dbg/dynamic_debug/control
'enabled' is an artifact from when we only had only flag: 'p'. Now, that
we have multiple flags, it probably does make more sense to use 'p' to
control whether there is printing. Since as you pointed out, it makes it
easier to disable things with just " -p".
Thanks,
-Jason
prev parent reply other threads:[~2011-08-04 16:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-27 22:04 Jim Cromie
2011-08-04 16:12 ` Jason Baron [this message]
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=20110804161227.GB2462@redhat.com \
--to=jbaron@redhat.com \
--cc=bvanassche@acm.org \
--cc=gnb@fmeh.org \
--cc=gregkh@suse.de \
--cc=jim.cromie@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®