[RFC|PATCH] Compile time printk verbosity

2009-09-01 Thread Marc Andre Tanner
but not wrapped by a macro. Patches 4-6 make existing kernel code aware of this fact. The series was compile tested with make allyesconfig for x86 and arm (with a cross compiler) but I might have missed something. All kinds of comments are welcome. Marc Andre Tanner (7): printk: introduce

[PATCH 5/7] drivers: make macro independent of printk's return value

2009-09-01 Thread Marc Andre Tanner
Because printk might be wrapped by a macro avoid constructs which assume that the return value can be interpreted as a boolean value. This doesn't work because the macro has no return value which results in a compile error void value not ignored as it ought to be. Signed-off-by: Marc Andre

[PATCH 1/7] printk: introduce CONFIG_PRINTK_VERBOSITY

2009-09-01 Thread Marc Andre Tanner
Introduce a config option which allows to selectively compile out printk messages based on a specified verbosity level. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- init/Kconfig | 28 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/init

[PATCH 6/7] video/stk-webcam: change use of STK_ERROR

2009-09-01 Thread Marc Andre Tanner
Don't rely on the return value of STK_ERROR which is a wrapper around printk use a normal if clause instead. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- drivers/media/video/stk-webcam.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH 4/7] drivers: replace printk with printk_unfiltered

2009-09-01 Thread Marc Andre Tanner
Use the unfiltered variant in cases where the return value is of interest. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- drivers/char/mem.c |2 +- drivers/md/md.c|2 +- drivers/scsi/aic7xxx/aic79xx_osm.h |2 +- drivers/scsi/aic7xxx

[PATCH 2/7] printk: move printk to the end of the file

2009-09-01 Thread Marc Andre Tanner
A later patch will #undef printk because the macro would otherwise conflict with the function definition. Moving the printk function to the end of the file makes sure that the macro is expanded within the rest of the file. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- kernel/printk.c

[PATCH 3/7] printk: introduce printk_unfiltered as an alias to printk

2009-09-01 Thread Marc Andre Tanner
The standard printk function will be wrapped by a macro. However this doesn't work in all situations (for example when the return value of printk is of interest). We therefore provide a new function which is just an alias to printk and therefore bypasses the macro. Signed-off-by: Marc Andre

Re: [RFC|PATCH] Compile time printk verbosity

2009-09-02 Thread Marc Andre Tanner
On Tue, Sep 01, 2009 at 07:37:27PM -0400, Mike Frysinger wrote: On Tue, Sep 1, 2009 at 18:31, Marc Andre Tanner wrote: This series adds a configuration option to selectively compile out printk message strings based on a verbosity level. This works by wrapping printk with a macro which

Re: [PATCH 7/7] printk: provide a filtering macro for printk

2009-09-02 Thread Marc Andre Tanner
On Wed, Sep 02, 2009 at 12:35:42AM +0100, Jamie Lokier wrote: Marc Andre Tanner wrote: + * The check with sizeof(void*) should make sure that we don't operate on + * pointers, which the compiler wouldn't be able to optimize out, but only + * on string constants. Take a look

Re: [PATCH 7/7] printk: provide a filtering macro for printk

2009-09-02 Thread Marc Andre Tanner
the next version of the patch will contain even less changes to the rest of the kernel. I haven't looked over this patch series yet but does it work with the pr_level macros (pr_info, pr_err, etc.)? It should work, yes. Regards, Marc -- Marc Andre Tanner http://www.brain-dump.org/ GPG

[PATCH 1/5] printk: introduce CONFIG_PRINTK_VERBOSITY

2009-09-02 Thread Marc Andre Tanner
Introduce a config option which allows to selectively compile out printk messages based on a specified verbosity level. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- init/Kconfig | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/init

[PATCH 2/5] printk: move printk to the end of the file

2009-09-02 Thread Marc Andre Tanner
A later patch will #undef printk because the macro would otherwise conflict with the function definition. Moving the printk function to the end of the file makes sure that the macro is expanded within the rest of the file. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- kernel/printk.c

[PATCH 4/5] char/mem: replace printk with printk_unfiltered

2009-09-02 Thread Marc Andre Tanner
We don't want to filter user space data which comes from /dev/kmsg. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- drivers/char/mem.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index afa8813..ba48b82 100644

[PATCH 5/5] printk: provide a filtering macro for printk

2009-09-02 Thread Marc Andre Tanner
The macro filters out printk messages based on a configurable verbosity level (CONFIG_PRINTK_VERBOSITY). Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- include/linux/kernel.h | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/include/linux

[PATCH 3/5] printk: introduce printk_unfiltered as an alias to printk

2009-09-02 Thread Marc Andre Tanner
The standard printk function will be wrapped by a macro which filters out messages above a certain verbosity level. Because this might not be desired in certain situations we provide an unfiltered variant. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- include/linux/kernel.h |5

Re: [PATCH 1/5] printk: introduce CONFIG_PRINTK_VERBOSITY

2009-09-02 Thread Marc Andre Tanner
On Wed, Sep 02, 2009 at 06:44:06PM +0200, Marco Stornelli wrote: Marc Andre Tanner ha scritto: Introduce a config option which allows to selectively compile out printk messages based on a specified verbosity level. Signed-off-by: Marc Andre Tanner m...@brain-dump.org --- init