~ubuntu-branches/ubuntu/karmic/busybox/karmic

« back to all changes in this revision

Viewing changes to scripts/bloat-o-meter

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-06-19 11:41:15 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090619114115-asrhxtx2khmkjnhd
Tags: 1:1.13.3-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  - [udeb] Enable chvt, dd conv=notrunc, getopt (and -l), killall,
    losetup, mktemp, NFS mount, od, ping, stat, and remote syslog.
  - [deb] Enable mdev.
  - Enable 'mount -f' and mount helpers for all targets.
  - Add busybox-initramfs.
  - mkswap-uuid.patch: Set UUIDs on swap areas.
  - test-bin.patch: Move test and friends to /bin.
  - mount-helper-fixes.patch: Add proper support for mount -i (don't use
    external mount helper), and trivial support for umount -i although
    busybox umount doesn't support external helpers yet. Fix handling of
    mount -f and -n.
  - getopt-long-only.patch: Allow 'getopt -l' to be enabled independently
    of the whole of CONFIG_GETOPT_LONG, so that it can be enabled more
    cheaply.
  - printf-errors.patch: Exit non-zero on conversion errors.
* procps-kernel-threads.patch: Drop. We haven't needed this since we
  rewrote casper as an initramfs-tools module anyway, and the bit of this
  patch that actually does anything was dropped in 1:1.01-4ubuntu1 so we
  clearly don't need the rest of it!
* [initramfs] Include wc for the benefit of live-initramfs (LP: #387944).

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
import sys, os, re
11
11
 
12
 
if len(sys.argv) != 3:
 
12
def usage():
13
13
    sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0])
14
14
    sys.exit(-1)
15
15
 
 
16
if len(sys.argv) < 3:
 
17
    usage()
 
18
 
16
19
for f in sys.argv[1], sys.argv[2]:
17
20
    if not os.path.exists(f):
18
21
        sys.stderr.write("Error: file '%s' does not exist\n" % f)
19
 
        sys.exit(-1)
 
22
        usage()
20
23
 
 
24
nm_args = " ".join([x for x in sys.argv[3:]])
21
25
def getsizes(file):
22
26
    sym = {}
23
 
    for l in os.popen("nm --size-sort " + file).readlines():
24
 
        size, type, name = l[:-1].split()
 
27
    for l in os.popen("nm --size-sort %s %s" % (nm_args, file)).readlines():
 
28
        l = l.strip()
 
29
        # Skip empty lines
 
30
        if not len(l): continue
 
31
        # Skip archive members
 
32
        if len(l.split()) == 1 and l.endswith(':'):
 
33
          continue
 
34
        size, type, name = l.split()
25
35
        if type in "tTdDbBrR":
26
36
            if "." in name: name = "static." + name.split(".")[0]
27
37
            sym[name] = sym.get(name, 0) + int(size, 16)