diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-07-18 18:58:27 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-18 18:58:27 -0700 |
commit | b8e7b66fe40e6117f9b7eaee264d407ef91d29eb (patch) | |
tree | 71499c23f2ab9c5e2079a6752f94ef4fc2bf5df8 /tools/find_bigfuncs.py | |
parent | 6e6807b4ce0448b00d8e10a222c44829bb3b60c7 (diff) |
improve find_bigfuncs
Diffstat (limited to 'tools/find_bigfuncs.py')
-rw-r--r-- | tools/find_bigfuncs.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/find_bigfuncs.py b/tools/find_bigfuncs.py index ebff8b6e..31825544 100644 --- a/tools/find_bigfuncs.py +++ b/tools/find_bigfuncs.py @@ -1,15 +1,14 @@ ''' -Simple tool to find big functions in an .ll file. Anything over i64 is of interest. +Simple tool to find big functions in an .ll file. ''' import os, sys, re filename = sys.argv[1] i = 0 -maxx = -1 -maxxest = '?' start = -1 curr = '?' +data = [] for line in open(filename): i += 1 if line.startswith('function '): @@ -17,7 +16,7 @@ for line in open(filename): curr = line elif line.startswith('}'): size = i - start - if size > maxx: - maxx = size - maxxest = curr -print maxx, 'lines in', maxxest + data.append([curr, size]); +data.sort(lambda x, y: x[1] - y[1]) +print ''.join(['%6d : %s' % (x[1], x[0]) for x in data]) + |