summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-03-09 18:07:10 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-03-09 18:07:10 +0000
commit7e8b871b07c1afff6bcfe2e218c88ab1463ecfe5 (patch)
tree698e60fc0dc267ff036640bbc3badf3cb5f06c1b /src
parent1158fc115d9b2a32e657d8c87967a67a98581148 (diff)
downloadbcfg2-7e8b871b07c1afff6bcfe2e218c88ab1463ecfe5.tar.gz
bcfg2-7e8b871b07c1afff6bcfe2e218c88ab1463ecfe5.tar.bz2
bcfg2-7e8b871b07c1afff6bcfe2e218c88ab1463ecfe5.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/Options.py2
-rwxr-xr-xsrc/sbin/bcfg2-info8
2 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/Options.py b/src/lib/Options.py
index b497c138f..8f3df5f39 100644
--- a/src/lib/Options.py
+++ b/src/lib/Options.py
@@ -220,7 +220,7 @@ CLIENT_EXTRA_DISPLAY = Option('enable extra entry output',
default=False, cmd='-e', )
CLIENT_PARANOID = Option('make automatic backups of config files',
default=False, cmd='-P', )
-CORE_PROFILE = Option('profile server core',
+CORE_PROFILE = Option('profile server core', odesc='<profile trace path>',
default=False, cmd='-p', )
CLIENT_AGENT = Option('run in agent (continuous) mode, wait for reconfigure command from server', default=False, cmd='-A', )
CLIENT_DRIVERS = Option('Specify tool driver set', cmd='-D',
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