mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* dynamic_debug: enabled vs FLAGS_PRINT, more filtering tricks.
@ 2011-07-27 22:04 Jim Cromie
  2011-08-04 16:12 ` Jason Baron
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Cromie @ 2011-07-27 22:04 UTC (permalink / raw)
  To: jbaron; +Cc: bvanassche, joe, gregkh, linux-kernel, gnb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-04 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-27 22:04 dynamic_debug: enabled vs FLAGS_PRINT, more filtering tricks Jim Cromie
2011-08-04 16:12 ` Jason Baron

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®