Patchwork ubifs: Do not build debug messages with CONFIG_UBIFS_FS_DEBUG disabled

login
register
mail settings
Submitter Michal Marek
Date Aug. 11, 2011, 10:29 a.m.
Message ID <1313058586-24239-1-git-send-email-mmarek@suse.cz>
Download mbox | patch
Permalink /patch/109591/
State New
Headers show

Comments

Michal Marek - Aug. 11, 2011, 10:29 a.m.
With
  $ grep -e UBIFS_FS_DEBUG -e DYNAMIC_DEBUG .config
  # CONFIG_UBIFS_FS_DEBUG is not set
  CONFIG_DYNAMIC_DEBUG=y

Debug messages are kept in the object files due to the
dynamic_pr_debug() macro, even if they are never going to be printed:
  $ make fs/ubifs/super.o
  $ strings fs/ubifs/super.o | grep 'compiled on'
  compiled on:         Aug 11 2011 at 12:21:38

Use plain printk to fix this.

Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 fs/ubifs/debug.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - Aug. 19, 2011, 3:55 p.m.
On Thu, 2011-08-11 at 12:29 +0200, Michal Marek wrote:
> With
>   $ grep -e UBIFS_FS_DEBUG -e DYNAMIC_DEBUG .config
>   # CONFIG_UBIFS_FS_DEBUG is not set
>   CONFIG_DYNAMIC_DEBUG=y
> 
> Debug messages are kept in the object files due to the
> dynamic_pr_debug() macro, even if they are never going to be printed:
>   $ make fs/ubifs/super.o
>   $ strings fs/ubifs/super.o | grep 'compiled on'
>   compiled on:         Aug 11 2011 at 12:21:38
> 
> Use plain printk to fix this.
> 
> Signed-off-by: Michal Marek <mmarek@suse.cz>

Good catch, thanks! Pushed to ubifs-2.6.git, thanks!
Artem Bityutskiy - Aug. 19, 2011, 4:08 p.m.
On Fri, 2011-08-19 at 18:55 +0300, Artem Bityutskiy wrote:
> On Thu, 2011-08-11 at 12:29 +0200, Michal Marek wrote:
> > With
> >   $ grep -e UBIFS_FS_DEBUG -e DYNAMIC_DEBUG .config
> >   # CONFIG_UBIFS_FS_DEBUG is not set
> >   CONFIG_DYNAMIC_DEBUG=y
> > 
> > Debug messages are kept in the object files due to the
> > dynamic_pr_debug() macro, even if they are never going to be printed:
> >   $ make fs/ubifs/super.o
> >   $ strings fs/ubifs/super.o | grep 'compiled on'
> >   compiled on:         Aug 11 2011 at 12:21:38
> > 
> > Use plain printk to fix this.
> > 
> > Signed-off-by: Michal Marek <mmarek@suse.cz>
> 
> Good catch, thanks! Pushed to ubifs-2.6.git, thanks!

There is a similar issue in UBI - just fixed it. I'll send this to Linus
soon, as this is a regression (blown-up binaries even though debugging
is disabled).

Patch

diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 45174b5..5163a01 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -337,7 +337,7 @@  void dbg_debugfs_exit_fs(struct ubifs_info *c);
 
 #define ubifs_dbg_msg(fmt, ...) do {               \
 	if (0)                                     \
-		pr_debug(fmt "\n", ##__VA_ARGS__); \
+		printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
 } while (0)
 
 #define dbg_dump_stack()