From: Greg KH <greg@kroah.com>
To: Jason Baron <jbaron@redhat.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, 8 Aug 2008 18:07:41 -0700 [thread overview]
Message-ID: <20080809010741.GA26036@kroah.com> (raw)
In-Reply-To: <20080808215153.GA16729@redhat.com>
On Fri, Aug 08, 2008 at 05:51:53PM -0400, Jason Baron wrote:
>
> ok, here's a patch that implements just the basic core functionality that ties
> into pr_debug() and dev_dbg(). That is, any users of those two functions can
> be dynamically enabled/disabled at runtime if CONFIG_DYNAMIC_PRINTK_DEBUG is
> set at compile time. We can add the more complex flag/level debugging later as
> you suggest...
Very nice, just as I'm writing patches to dynamically make
CONFIG_USB_DEBUG be selectable on the fly :)
Don't worry, that can easily be moved over to your version once it is
done and in the tree...
> Few notes...there is still one control file: <debugfs>/dynamic_printk/modules
> We can split this up now or later, but I kind of like being able to see all
> the controls in one file. Also, i've used a djb2 hash function in the code,
> which i'm not sure is under the correct license/copyright, so i just wanted
> to point that out as well. see: scripts/basic/hash.c. If its an issue, i can
> find another hash function.
Why use that hash function? Actually, it looks like you are using 2
different ones, right? Why?
> --- /dev/null
> +++ b/include/linux/dynamic_printk.h
> @@ -0,0 +1,94 @@
> +#ifndef _DYNAMIC_PRINTK_H
> +#define _DYNAMIC_PRINTK_H
> +
> +#ifdef __KERNEL__
Shouldn't be needed.
> +#include <linux/string.h>
> +#include <linux/hash.h>
> +
> +#define DYNAMIC_DEBUG_HASH_BITS 6
> +#define DEBUG_HASH_TABLE_SIZE (1 << DYNAMIC_DEBUG_HASH_BITS)
> +
> +#define TYPE_BOOLEAN 1
What's this for?
> +#define DYNAMIC_ENABLED_ALL 0
> +#define DYNAMIC_ENABLED_NONE 1
> +#define DYNAMIC_ENABLED_SOME 2
> +
> +extern int dynamic_enabled;
> +extern long long dynamic_printk_enabled;
> +extern long long dynamic_printk_enabled2;
What's up with the "2" versions?
> +config DYNAMIC_PRINTK_DEBUG
> + bool "Enable dynamic printk() call support"
> + default n
> + depends on PRINTK
> + select PRINTK_DEBUG
> + help
> +
> + Compiles debug level messages into the kernel, which would not
> + otherwise be available at runtime. These messages can then be
> + enabled/disabled on a per module basis. This mechanism, implicitly
> + enables all pr_debug() and dev_dbg() calls. The impact of this
> + compile option is a larger kernel text size ~2%.
Trailing spaces :(
It's looking very good so far.
thanks,
greg k-h
next prev parent reply other threads:[~2008-08-09 1:10 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
2008-08-08 21:51 ` Jason Baron
2008-08-09 1:07 ` Greg KH [this message]
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=20080809010741.GA26036@kroah.com \
--to=greg@kroah.com \
--cc=akpm@linux-foundation.org \
--cc=jbaron@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.