Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (6 years ago)
Author:
bruno
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/scripts/bloat-o-meter

    r2725 r3232  
    1 #!/usr/bin/python
     1#!/usr/bin/env python
    22#
    33# Copyright 2004 Matt Mackall <mpm@selenic.com>
    44#
    5 # inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen
     5# Inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen
    66#
    77# This software may be used and distributed according to the terms
     
    4040def getsizes(file):
    4141    sym, alias, lut = {}, {}, {}
    42     #dynsym_filter = re.compile("^\d+:\s+[\dA-Fa-f]+\s+\d+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+$")
    4342    for l in os.popen("readelf -W -s %s %s" % (sym_args, file)).readlines():
    44         if True:
    45             l = l.strip()
    46             if not (len(l) and l[0].isdigit() and len(l.split()) == 8):
    47                 continue
    48             num, value, size, typ, bind, vis, ndx, name = l.split()
    49             if ndx == "UND": continue # skip undefined
    50             if typ in ["SECTION", "FILES"]: continue # skip sections and files
    51         #else:
    52         #    l = l.strip()
    53         #    match = dynsym_filter.match(l)
    54         #    if not match: continue
    55         #    x, value, size, typ, bind, x, ndx, name = l.split()
    56         #    if ndx == "UND": continue # skip undefined
    57         #    if typ in ["SECTION", "FILES"]: continue # skip sections and files
     43        l = l.strip()
     44        if not (len(l) and l[0].isdigit() and len(l.split()) == 8):
     45            continue
     46        num, value, size, typ, bind, vis, ndx, name = l.split()
     47        if ndx == "UND": continue # skip undefined
     48        if typ in ["SECTION", "FILES"]: continue # skip sections and files
    5849        if "." in name: name = "static." + name.split(".")[0]
    5950        value = int(value, 16)
    60         size = int(size)
     51        size = int(size, 16) if size.startswith('0x') else int(size)
    6152        if vis != "DEFAULT" and bind != "GLOBAL": # see if it is an alias
    6253            alias[(value, size)] = {"name" : name}
Note: See TracChangeset for help on using the changeset viewer.