From 7e8b871b07c1afff6bcfe2e218c88ab1463ecfe5 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 9 Mar 2009 18:07:10 +0000 Subject: bcfg2-info: add option trace file option for profiling mode git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5113 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-info | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/sbin') diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index 72e6c42e0..4f7228c8e 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -2,7 +2,7 @@ '''This tool loads the Bcfg2 core into an interactive debugger''' __revision__ = '$Revision$' -import copy, logging, lxml.etree, sys, cmd, tempfile +import copy, logging, lxml.etree, sys, cmd import Bcfg2.Logger, Bcfg2.Server.Core, os import Bcfg2.Server.Plugins.Metadata, Bcfg2.Server.Plugin import Bcfg2.Options @@ -317,15 +317,13 @@ if __name__ == '__main__': '-d' in sys.argv, []) else: import hotshot, hotshot.stats - pfd, pfile = tempfile.mkstemp() - prof = hotshot.Profile(pfile) + prof = hotshot.Profile(setup['profile']) try: prof.runcall(main, setup['repo'], setup['plugins'], setup['password'], setup['encoding'], '-d' in sys.argv, ['exit']) except SystemExit: - stats = hotshot.stats.load(pfile) + stats = hotshot.stats.load(setup['profile']) stats.strip_dirs() stats.sort_stats('time', 'calls') stats.print_stats(80) - print pfile raise -- cgit v1.2.3-1-g7c22