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

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: 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..a7fc4d3855d954e19fa149c022d94ef69bcd6807 100644
--- a/tools/deep_memory_profiler/lib/policy.py
+++ b/tools/deep_memory_profiler/lib/policy.py
@@ -125,9 +125,15 @@ class Policy(object):
def components(self):
return self._components
- def find_rule(self, component_name):
+ def find_rule(self, component_name, follow_rule=None):
kouhei (in TOK) 2014/11/04 18:17:03 follow_rule -> after?
wensheng 2014/11/05 01:46:17 Yes
"""Finds a rule whose name is |component_name|. """
kouhei (in TOK) 2014/11/04 18:17:03 Please update comment.
wensheng 2014/11/05 01:46:17 Done.
+ flag = False
kouhei (in TOK) 2014/11/04 18:17:03 please use more descriptive variable name.
wensheng 2014/11/05 01:46:17 Done.
for rule in self._rules:
+ if follow_rule and not flag:
+ if rule == follow_rule:
+ flag = 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