Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/scripts/bloat-o-meter
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/scripts/bloat-o-meter
r2725 r3232 1 #!/usr/bin/ python1 #!/usr/bin/env python 2 2 # 3 3 # Copyright 2004 Matt Mackall <mpm@selenic.com> 4 4 # 5 # inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen5 # Inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen 6 6 # 7 7 # This software may be used and distributed according to the terms … … 40 40 def getsizes(file): 41 41 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+$")43 42 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 58 49 if "." in name: name = "static." + name.split(".")[0] 59 50 value = int(value, 16) 60 size = int(size )51 size = int(size, 16) if size.startswith('0x') else int(size) 61 52 if vis != "DEFAULT" and bind != "GLOBAL": # see if it is an alias 62 53 alias[(value, size)] = {"name" : name}
Note:
See TracChangeset
for help on using the changeset viewer.