From b4f88b718b173b9e7f3f34d07488a11d6d6f3b6c Mon Sep 17 00:00:00 2001 From: trss Date: Thu, 14 May 2015 13:40:27 +0530 Subject: [PATCH] Fixed bug where time taken by recursive calls are added to the cumulative time of the outermost call. --- pycallgraph/tracer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pycallgraph/tracer.py b/pycallgraph/tracer.py index ffcab15..68110c2 100644 --- a/pycallgraph/tracer.py +++ b/pycallgraph/tracer.py @@ -241,6 +241,8 @@ def process(self, frame, event, arg, memory=None): if self.call_stack_timer: start_time = self.call_stack_timer.pop(-1) + if full_name in self.call_stack: + start_time = None else: start_time = None