~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-27 00:11:40 UTC
  • mfrom: (3698.1.4 debug_memory)
  • Revision ID: pqm@pqm.ubuntu.com-20080927001140-kf9vnhradsc7ilmo
(jam) Add trace.debug_memory() as a simple way to dump mem info.

Show diffs side-by-side

added added

removed removed

Lines of Context:
796
796
        else:
797
797
            ret = run(*run_argv)
798
798
        if 'memory' in debug.debug_flags:
799
 
            try:
800
 
                status_file = file('/proc/%s/status' % os.getpid(), 'rb')
801
 
            except IOError:
802
 
                pass
803
 
            else:
804
 
                status = status_file.read()
805
 
                status_file.close()
806
 
                trace.note("Process status after command:")
807
 
                for line in status.splitlines():
808
 
                    trace.note(line)
 
799
            trace.debug_memory('Process status after command:', short=False)
809
800
        return ret or 0
810
801
    finally:
811
802
        # reset, in case we may do other commands later within the same process