linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Gustavo F. Padovan" <padovan@profusion.mobi>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] bluetooth: Add bt_printk, convert logging macros to lower case
Date: Wed, 29 Jun 2011 20:47:41 -0700	[thread overview]
Message-ID: <1309405661.1726.7.camel@Joe-Laptop> (raw)
In-Reply-To: <20110630033119.GA3438@joana>

On Thu, 2011-06-30 at 00:31 -0300, Gustavo F. Padovan wrote:
> Hi Joe,

Hello Gustavo.

> > Use the more common logging styles.
> > bt_print uses vsprintf extension %pV.
> > This saves 2 to 3 % of code/text space.
> > $ find net/bluetooth -name "built-in.o.*" | xargs size
> >    text	   data	    bss	    dec	    hex	filename
> >   14778	   1012	   3408	  19198	   4afe	net/bluetooth/bnep/built-in.o.new
> >   15067	   1012	   3408	  19487	   4c1f	net/bluetooth/bnep/built-in.o.old
> >   18483	   1172	   4264	  23919	   5d6f	net/bluetooth/cmtp/built-in.o.new
> >   18927	   1172	   4264	  24363	   5f2b	net/bluetooth/cmtp/built-in.o.old
> >   59461	   3884	  14464	  77809	  12ff1	net/bluetooth/rfcomm/built-in.o.new
> >   61206	   3884	  14464	  79554	  136c2	net/bluetooth/rfcomm/built-in.o.old
> >   19237	   1172	   5152	  25561	   63d9	net/bluetooth/hidp/built-in.o.new
> >   19581	   1172	   5152	  25905	   6531	net/bluetooth/hidp/built-in.o.old
> >  346600	  19163	  86080	 451843	  6e503	net/bluetooth/built-in.o.new
> >  353751	  19163	  86064	 458978	  700e2	net/bluetooth/built-in.o.old
> > $ find drivers/bluetooth/ -name "built-in.o.*" | xargs size
> >    text	   data	    bss	    dec	    hex	filename
> >  129956	   8632	  36096	 174684	  2aa5c	drivers/bluetooth/built-in.o.new
> >  134402	   8632	  36064	 179098	  2bb9a	drivers/bluetooth/built-in.o.old
> This is really nice, but can we keep the lower case?

I don't understand what you mean.
Maybe "keep the upper case"?

Sure, go for it.

My point was to add bt_printk and convert the macros.
You could break that up into 5 patches I suppose.

Some sequence like:

	Add bt_printk, convert current BT_<LEVEL> to use them
	Rename bt_err to bt_to_errno
	Add lowercase bt_<level>
	Case conversions of BT_<LEVEL> to bt_<level>
	Remove BT_<LEVEL>

> I think applying this
> patch now will break things to people developing on top of my tree.

Do what you think best.
The code size saving is in conversion to bt_printk and using %pV.
The UPPER->lower is noisy and trivial.

> Then someday in the future when development becomes calm or just after the
> next merge window I run a s/BT_*/bt_*/ on everything.
> Thanks a lot for looking into this, reduce code/text by 3% only changing
> logging is awesome.

cheers, Joe

  reply	other threads:[~2011-06-30  3:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1309370457.2208.48.camel@aeonflux>
2011-06-30  1:18 ` [PATCH 0/2] bluetooth: Use current logging styles Joe Perches
2011-06-30  1:18   ` [PATCH 1/2] bluetooth: Rename function bt_err to bt_to_errno Joe Perches
2011-07-01 19:04     ` Gustavo F. Padovan
2011-06-30  1:18   ` [PATCH 2/2] bluetooth: Add bt_printk, convert logging macros to lower case Joe Perches
2011-06-30  3:31     ` Gustavo F. Padovan
2011-06-30  3:47       ` Joe Perches [this message]
2011-06-30  7:19       ` [PATCH] bluetooth: Add bt_printk Joe Perches
2011-07-01 19:03         ` Gustavo F. Padovan
2011-07-01 19:36           ` Gustavo F. Padovan

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=1309405661.1726.7.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=padovan@profusion.mobi \
    /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;
as well as URLs for NNTP newsgroup(s).