~jelmer/bzr/merge-2.2-into-2.3

« back to all changes in this revision

Viewing changes to profile_imports.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
 
65
65
def log_stack_info(out_file, sorted=True, hide_fast=True):
66
66
    # Find all of the roots with import = 0
67
 
    out_file.write(' cum  inline name\t\t\t\t\t\tframe\n')
 
67
    out_file.write('%5s %5s %-40s @ %s:%s\n'
 
68
        % ('cum', 'inline', 'name', 'file', 'line'))
68
69
    todo = [(value[-1], key) for key,value in _info.iteritems() if value[0] == 0]
69
70
 
70
71
    if sorted:
89
90
 
90
91
        # indent, cum_time, mod_time, name,
91
92
        # scope_name, frame_name, frame_lineno
92
 
        out_file.write('%5.1f %5.1f %s %-35s\t@ %s:%d\n'
93
 
            % (info[-1]*1000., mod_time*1000., '+'*info[0], 
94
 
               cur[1][:35], info[1], info[2]))
 
93
        out_file.write('%5.1f %5.1f %-40s @ %s:%d\n'
 
94
            % (info[-1]*1000., mod_time*1000.,
 
95
               ('+'*info[0] + cur[1]),
 
96
               info[1], info[2]))
95
97
 
96
98
        if sorted:
97
99
            c_times.sort()