From: Jason Baron <jbaron@redhat.com>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
joe@perches.com, nick@nick-andrew.net, randy.dunlap@oracle.com
Subject: Re: [PATCH 1/7] dynamic debug v2 - infrastructure
Date: Fri, 18 Jul 2008 10:39:54 -0400 [thread overview]
Message-ID: <20080718143954.GA10141@redhat.com> (raw)
In-Reply-To: <20080717223222.GA28016@kroah.com>
On Thu, Jul 17, 2008 at 03:32:22PM -0700, Greg KH wrote:
> On Thu, Jul 17, 2008 at 05:20:40PM -0400, Jason Baron wrote:
> > On Thu, Jul 17, 2008 at 12:01:03AM -0700, Greg KH wrote:
> > > Return-Path: <greg@kroah.com>
> > > On Tue, Jul 15, 2008 at 05:31:08PM -0400, Jason Baron wrote:
> > > > diff --git a/include/linux/device.h b/include/linux/device.h
> > > > index 1a06026..fb03dbc 100644
> > > > --- a/include/linux/device.h
> > > > +++ b/include/linux/device.h
> > > > @@ -592,7 +592,11 @@ extern const char *dev_driver_string(struct device *dev);
> > > > #define dev_info(dev, format, arg...) \
> > > > dev_printk(KERN_INFO , dev , format , ## arg)
> > > >
> > > > -#ifdef DEBUG
> > > > +#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
> > > > +#define dev_dbg(dev, format, ...) do { \
> > > > + dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
> > > > + } while (0)
> > > > +#elif defined(DEBUG)
> > > > #define dev_dbg(dev, format, arg...) \
> > > > dev_printk(KERN_DEBUG , dev , format , ## arg)
> > > > #else
> > >
> > > In looking at your follow-on patches, where you add this to subsystems,
> > > it seems that you have to add a lot of #include <linux/dynamic_printk.h>
> > > lines.
> > >
> > > And in looking at this modification to device.h, I think lots of the
> > > kernel should break, but you are getting it "for free" by including the
> > > .h file within kernel.h.
> > >
> > > Why not also include it here in device.h?
> > >
> >
> > I don't believe the follow-on patches include "<linux/dynamic_printk.h>".
> > However, some of them do include a subsystem specific #include. For example,
> > the cpufreq subsystem include, <linux/dynamic_debug_cpufreq.h>:
>
> Ah, you are correct, sorry about that, I misread.
>
> > +++ b/include/linux/dynamic_debug_cpufreq.h
> > @@ -0,0 +1,8 @@
> > +#define DYNAMIC_DEBUG_NUM_FLAGS "3"
> > +#define DYNAMIC_DEBUG_FLAG_NAMES "CPUFREQ_DEBUG_CORE,CPUFREQ_DEBUG_DRIVER,CPUFREQ_DEBUG_GOVERNOR"
> > +#define DYNAMIC_DEBUG_TYPE "2"
> > +#define DYNAMIC_DEBUG_MODNAME "cpufreq_shared"
> > +
> > +#ifdef CONFIG_CPU_FREQ_DEBUG
> > +#define DEBUG 1
> > +#endif
> >
> > This header file conveys that cpufreq subsystem, wants non-default options-it
> > has 3 debugging flags that can be set, and all modules in the subsystem are
> > tied together using the module name: "cpufreq_shared".
> >
> > I don't have an explicit #include of kernel.h in device.h b/c it already picked
> > up.
> >
> > > Also, with this change, code that is already using dev_dbg() today is
> > > instantly converted over to this logic now, right?
> > >
> >
> > that is correct. any callers of dev_dbg() don't have to do anything. its really
> > only the more complex debugging, where there are flags or levels that need to
> > make adjustments to work with the new infrastructure.
>
> For this reason alone, I see no reason why your patch should not be
> merged today. You don't need the other subsystems at this point in time
> in my opinion, it's benifit is huge already.
>
> Not to say that you shouldn't also go after these subsystems in your
> overall scheme here, but please, don't feel it should hold your code up
> at this point in time :)
>
> Because of that, do you want me to try to merge the basic infrastructure
> and dev_dbg() support through the driver-core tree? This code has been
> in the past -mm and linux-next releases, right?
>
On my system, with just the pr_debug, dev_dbg() hooks, i get about 80 modules
loaded that i can enable/disable debugging for. So, this piece is useful by
itself as you point out.
However, there are a couple important issues that need to be resolved. One is
the the infrastructure relies on 'KBUILD_MODNAME' to differentiate modules.
However, these are not necessarily unique within the tree. For example,
mm/mmap.c and arch/x86/mm/mmap.c both have the 'KBUILD_MODNAME' of 'mmap'.
Thus, enabling debugging for one of these will enabled both. Perhaps, this
is the desired affect, but there might be cases where we want to differentiate?
We could use a combination of directory location in combination with
'KBUILD_MODNAME'.
The second issue, is the splitting up the control file from one monolithic one,
to one per module...i did one monolithic one to make the implementation simpler
but we could definitely split it up.
So, yes it could go in now, or I can try and polish it a little more...it has
not yet had a runtime in either -mm or linux-next yet.
thanks,
-Jason
next prev parent reply other threads:[~2008-07-18 14:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-15 21:31 [PATCH 1/7] dynamic debug v2 - infrastructure Jason Baron
2008-07-17 7:01 ` Greg KH
2008-07-17 21:20 ` Jason Baron
2008-07-17 22:32 ` Greg KH
2008-07-17 22:56 ` Dominik Brodowski
2008-07-17 23:35 ` Greg KH
2008-07-18 6:37 ` Dominik Brodowski
2008-07-18 14:39 ` Jason Baron [this message]
2008-08-08 21:51 ` Jason Baron
2008-08-09 1:07 ` Greg KH
2008-08-11 14:12 ` Jason Baron
2008-08-11 16:45 ` Greg KH
2008-08-09 2:38 ` Randy Dunlap
2008-08-11 17:36 ` Jason Baron
2008-08-11 22:33 ` Greg KH
2008-08-12 19:48 ` Jason Baron
2008-08-12 20:09 ` Greg KH
2008-08-12 20:46 ` Jason Baron
2008-08-13 1:08 ` Greg KH
2008-08-13 1:16 ` Andrew Morton
2008-08-13 3:38 ` Greg KH
2008-08-13 20:00 ` Sam Ravnborg
2008-08-13 22:49 ` jbaron
2008-08-13 23:54 ` Greg KH
2008-08-14 1:25 ` Greg KH
2008-08-13 19:05 ` Jason Baron
2008-08-14 14:53 ` Greg KH
2008-08-14 21:05 ` Jason Baron
2008-09-16 0:03 ` Rusty Russell
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=20080718143954.GA10141@redhat.com \
--to=jbaron@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@nick-andrew.net \
--cc=randy.dunlap@oracle.com \
/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