~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to profile_imports.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-18 04:28:27 UTC
  • mto: This revision was merged to the branch mainline in revision 1794.
  • Revision ID: john@arbash-meinel.com-20060618042827-748cb3f43cca8ae8
change layout to be easier to mentally parse.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
def log_stack_info(out_file):
72
72
    # Find all of the roots with import = 0
73
 
    out_file.write('cum_time\tmod_time\tname\tscope\tframe\n')
 
73
    out_file.write('cum   inline name\t\t\tscope\t\t\tframe\n')
74
74
    todo = [key for key,value in _info.iteritems() if value[0] == 0]
75
75
 
76
76
    while todo:
86
86
 
87
87
        scope_name = info[3]
88
88
        if scope_name is None:
89
 
            txt = '%-48s' % (cur[1],)
 
89
            txt = '%-64s' % (cur[1],)
90
90
        else:
91
 
            txt = '%-24s\tfor %-24s' % (cur[1], scope_name)
 
91
            txt = '%-28s\tfor %-24s' % (cur[1], scope_name)
92
92
        # indent, cum_time, mod_time, name,
93
93
        # scope_name, frame_name, frame_lineno
94
 
        out_file.write('%s%5.1f %5.1f %s\t@ %s:%d\n'
95
 
            % (info[0]*'+', info[-1]*1000., mod_time, txt, info[1], info[2]))
 
94
        out_file.write('%5.1f %5.1f %s %s\t@ %s:%d\n'
 
95
            % (info[-1]*1000., mod_time*1000., '+'*info[0], 
 
96
               txt, info[1], info[2]))
96
97
 
97
98
        todo.extend(reversed(children))
98
99
 
158
159
    frame_name = frame.f_globals.get('__name__', '<unknown>')
159
160
    frame_lineno = frame.f_lineno
160
161
 
161
 
    this = stack_add(repr(args[0][:40]), frame_name, frame_lineno)
 
162
    this = stack_add(repr(args[0]), frame_name, frame_lineno)
162
163
 
163
164
    tstart = time.time()
164
165
    try: