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 |