From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932802AbYGQVX0 (ORCPT ); Thu, 17 Jul 2008 17:23:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760233AbYGQVXS (ORCPT ); Thu, 17 Jul 2008 17:23:18 -0400 Received: from mx1.redhat.com ([66.187.233.31]:58850 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758362AbYGQVXR (ORCPT ); Thu, 17 Jul 2008 17:23:17 -0400 Date: Thu, 17 Jul 2008 17:20:40 -0400 From: Jason Baron To: Greg KH 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 Message-ID: <20080717212040.GB13252@redhat.com> References: <20080715213108.GB23331@redhat.com> <20080717070103.GA21961@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080717070103.GA21961@kroah.com> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 17, 2008 at 12:01:03AM -0700, Greg KH wrote: > Return-Path: > 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 > 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 "". However, some of them do include a subsystem specific #include. For example, the cpufreq subsystem include, : +++ 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. thanks, -Jason