public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Rob Landley <rob@landley.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Small patch to bloat-o-meter.
Date: Sun, 7 May 2006 23:48:00 -0500	[thread overview]
Message-ID: <20060508044800.GV15445@waste.org> (raw)
In-Reply-To: <200605080043.51415.rob@landley.net>

On Mon, May 08, 2006 at 12:43:51AM -0400, Rob Landley wrote:
> On Sunday 07 May 2006 11:02 pm, Matt Mackall wrote:
> > > --- linux-old/scripts/bloat-o-meter	2006-05-07 15:47:23.000000000 -0400
> > > +++ linux-2.6.16/scripts/bloat-o-meter	2006-05-07 15:08:31.000000000
> > > -0400 @@ -18,7 +18,9 @@
> > >      for l in os.popen("nm --size-sort " + file).readlines():
> > >          size, type, name = l[:-1].split()
> > >          if type in "tTdDbB":
> > > -            sym[name] = int(size, 16)
> > > +            if name.find(".") != -1: name = "static." +
> > > name.split(".")[0]
> >
> > if "." in name:
> >
> > (just like 'if type in "tTdDbB":' above it)
> 
> I learned python over 5 years ago and the language has changed out from under 
> me a bit.  When I've done a lot of C programming recently, I tend to fall 
> back on the old ways... :)
> 
> > > +            if name in sym: sym[name] += int(size, 16)
> > > +            else :sym[name] = int(size, 16)
> >
> > else:
> 
> I'm surprised that even ran...
> 
> > Actually, this probably wants to be:
> >
> > sym.setdefault(name, 0) += int(size, 16)
> 
> File "scripts/bloat-o-meter", line 22
>   sym.setdefault(name, 0) += int(size, 16)
> SyntaxError: can't assign to function call

Oh, right. That's why I never do that.

sym[name] = sym.get(name, 0) + int(size, 16)

-- 
Mathematics is the supreme nostalgia of our time.

  reply	other threads:[~2006-05-08  4:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-07 19:59 [PATCH] Small patch to bloat-o-meter Rob Landley
2006-05-08  3:02 ` Matt Mackall
2006-05-08  4:43   ` Rob Landley
2006-05-08  4:48     ` Matt Mackall [this message]
2006-05-08  5:11       ` Rob Landley

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=20060508044800.GV15445@waste.org \
    --to=mpm@selenic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    /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