From 56292eaac58c78a7e89d3c264b13b348e5d65a8f Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 9 Sep 2011 17:33:13 -0400 Subject: 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). --- src/sbin/bcfg2-info | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sbin') 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: -- cgit v1.2.3-1-g7c22