diff options
author | Calen Pennington <cpennington@wgen.net> | 2011-09-09 17:33:13 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-01-13 11:49:42 -0500 |
commit | 56292eaac58c78a7e89d3c264b13b348e5d65a8f (patch) | |
tree | fc6dfb099b415e9963fbb0fcb21249b0b9cc3243 /src/sbin/bcfg2-info | |
parent | b3bb4a985fa23305f79c9eb390bcfda4db5069f5 (diff) | |
download | bcfg2-56292eaac58c78a7e89d3c264b13b348e5d65a8f.tar.gz bcfg2-56292eaac58c78a7e89d3c264b13b348e5d65a8f.tar.bz2 bcfg2-56292eaac58c78a7e89d3c264b13b348e5d65a8f.zip |
Use cProfile if available, otherwise use standard python profile
cProfile, when available (python >= 2.5), gives enhanced profiling of c
calls (and has a lower overhead). This means it's possible to find
things like socket.gethostbyname that might be eating up large amounts
of time (without showing up in the standard profile reports).
Diffstat (limited to 'src/sbin/bcfg2-info')
-rwxr-xr-x | src/sbin/bcfg2-info | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index de4e95102..31b9ba0c6 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -14,7 +14,10 @@ import sys import tempfile try: - import profile + try: + import cProfile as profile + except: + import profile import pstats have_profile = True except: |