aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/profiling.py
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar/panels/profiling.py')
-rw-r--r--debug_toolbar/panels/profiling.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/debug_toolbar/panels/profiling.py b/debug_toolbar/panels/profiling.py
index 623b27a..e57aa97 100644
--- a/debug_toolbar/panels/profiling.py
+++ b/debug_toolbar/panels/profiling.py
@@ -123,7 +123,8 @@ class FunctionCall(object):
return 16 * self.depth
def line_stats_text(self):
- if self._line_stats_text is None:
+ if (self._line_stats_text is None and
+ DJ_PROFILE_USE_LINE_PROFILER):
lstats = self.statobj.line_stats
if self.func in lstats.timings:
out = StringIO()
@@ -188,12 +189,13 @@ class ProfilingDebugPanel(DebugPanel):
func.has_subfuncs = False
if func.depth < max_depth:
for subfunc in func.subfuncs():
- if subfunc.stats[3] >= cum_time or (subfunc.func in self.stats.line_stats.timings):
+ if (subfunc.stats[3] >= cum_time or
+ (hasattr(self.stats, 'line_stats') and
+ (subfunc.func in self.stats.line_stats.timings))):
func.has_subfuncs = True
self.add_node(func_list, subfunc, max_depth, cum_time=cum_time)
def content(self):
- import ipdb; ipdb.set_trace()
root = FunctionCall(self.stats, self.stats.get_root_func(), depth=0)
func_list = []