Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: tools/deep_memory_profiler/lib/policy.py

Issue 692343003: dmprof expand command supports to analyze multiple components with same name in different allocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix conflict Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/deep_memory_profiler/subcommands/expand.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/deep_memory_profiler/lib/policy.py
diff --git a/tools/deep_memory_profiler/lib/policy.py b/tools/deep_memory_profiler/lib/policy.py
index 2a41bb25106740ffa1ca695a5b50ff81bea5163b..a9776f34a0f34fbc10afc4899faa2a781d9926c8 100644
--- a/tools/deep_memory_profiler/lib/policy.py
+++ b/tools/deep_memory_profiler/lib/policy.py
@@ -125,9 +125,19 @@ class Policy(object):
def components(self):
return self._components
- def find_rule(self, component_name):
- """Finds a rule whose name is |component_name|. """
+ def find_rule(self, component_name, after_rule=None):
+ """Finds a rule whose name is |component_name|.
+
+ If there are multiple rules with same component name,
+ use |after_rule| to search the rule after it.
+ """
+ found_after_rule = False
for rule in self._rules:
+ if after_rule and not found_after_rule:
+ if rule == after_rule:
+ found_after_rule = True
+ continue
+
if rule.name == component_name:
return rule
return None
« no previous file with comments | « no previous file | tools/deep_memory_profiler/subcommands/expand.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698