summaryrefslogtreecommitdiff
path: root/simpleperf/scripts/inferno/data_types.py
diff options
context:
space:
mode:
Diffstat (limited to 'simpleperf/scripts/inferno/data_types.py')
-rw-r--r--simpleperf/scripts/inferno/data_types.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/simpleperf/scripts/inferno/data_types.py b/simpleperf/scripts/inferno/data_types.py
index 35ef4c0b..deb9f515 100644
--- a/simpleperf/scripts/inferno/data_types.py
+++ b/simpleperf/scripts/inferno/data_types.py
@@ -113,16 +113,15 @@ class FlameGraphCallSite(object):
self._get_next_callsite_id())
return child
- def trim_callchain(self, min_num_events, max_depth, depth=0):
+ def trim_callchain(self, min_num_events):
""" Remove call sites with num_events < min_num_events in the subtree.
Remaining children are collected in a list.
"""
- if depth <= max_depth:
- for key in self.child_dict:
- child = self.child_dict[key]
- if child.num_events >= min_num_events:
- child.trim_callchain(min_num_events, max_depth, depth + 1)
- self.children.append(child)
+ for key in self.child_dict:
+ child = self.child_dict[key]
+ if child.num_events >= min_num_events:
+ child.trim_callchain(min_num_events)
+ self.children.append(child)
# Relese child_dict since it will not be used.
self.child_dict = None