From b8e7b66fe40e6117f9b7eaee264d407ef91d29eb Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 18 Jul 2013 18:58:27 -0700 Subject: improve find_bigfuncs --- tools/find_bigfuncs.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tools/find_bigfuncs.py') 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]) + -- cgit v1.2.3-18-g5258