Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import re | 5 import re |
| 6 | 6 |
| 7 from core import perf_benchmark | 7 from core import perf_benchmark |
| 8 | 8 |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 from telemetry.timeline import tracing_category_filter | 10 from telemetry.timeline import tracing_category_filter |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 # Enable only memory-infra, to get memory dumps, and blink.console, to get | 33 # Enable only memory-infra, to get memory dumps, and blink.console, to get |
| 34 # the timeline markers used for mapping threads to tabs. | 34 # the timeline markers used for mapping threads to tabs. |
| 35 trace_memory = tracing_category_filter.TracingCategoryFilter( | 35 trace_memory = tracing_category_filter.TracingCategoryFilter( |
| 36 filter_string='-*,blink.console,disabled-by-default-memory-infra') | 36 filter_string='-*,blink.console,disabled-by-default-memory-infra') |
| 37 tbm_options = timeline_based_measurement.Options( | 37 tbm_options = timeline_based_measurement.Options( |
| 38 overhead_level=trace_memory) | 38 overhead_level=trace_memory) |
| 39 tbm_options.config.enable_android_graphics_memtrack = True | 39 tbm_options.config.enable_android_graphics_memtrack = True |
| 40 return tbm_options | 40 return tbm_options |
| 41 | 41 |
| 42 @classmethod | 42 @classmethod |
| 43 def HasBenchmarkTraceRerunDebugOption(cls): | 43 def HasTraceRerunDebugOption(cls): |
|
perezju
2016/03/10 13:45:47
The bug was caused by this method having the wrong
| |
| 44 return True | 44 return True |
| 45 | 45 |
| 46 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): | 46 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): |
| 47 # TODO(perezju): Call this function for TBM benchmarks: crbug.com/593678 | |
| 48 tbm_options.SetLegacyTimelineBasedMetrics(( | 47 tbm_options.SetLegacyTimelineBasedMetrics(( |
| 49 memory_timeline.MemoryTimelineMetric(), | 48 memory_timeline.MemoryTimelineMetric(), |
| 50 )) | 49 )) |
| 51 | 50 |
| 52 | 51 |
| 53 # TODO(bashi): Workaround for http://crbug.com/532075 | 52 # TODO(bashi): Workaround for http://crbug.com/532075 |
| 54 # @benchmark.Enabled('android') shouldn't be needed. | 53 # @benchmark.Enabled('android') shouldn't be needed. |
| 55 @benchmark.Enabled('android') | 54 @benchmark.Enabled('android') |
| 56 class MemoryHealthPlan(_MemoryInfra): | 55 class MemoryHealthPlan(_MemoryInfra): |
| 57 """Timeline based benchmark for the Memory Health Plan.""" | 56 """Timeline based benchmark for the Memory Health Plan.""" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 | 130 |
| 132 def CreateTimelineBasedMeasurementOptions(self): | 131 def CreateTimelineBasedMeasurementOptions(self): |
| 133 v8_categories = [ | 132 v8_categories = [ |
| 134 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] | 133 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] |
| 135 memory_categories = 'blink.console,disabled-by-default-memory-infra' | 134 memory_categories = 'blink.console,disabled-by-default-memory-infra' |
| 136 category_filter = tracing_category_filter.TracingCategoryFilter( | 135 category_filter = tracing_category_filter.TracingCategoryFilter( |
| 137 memory_categories) | 136 memory_categories) |
| 138 for category in v8_categories: | 137 for category in v8_categories: |
| 139 category_filter.AddIncludedCategory(category) | 138 category_filter.AddIncludedCategory(category) |
| 140 options = timeline_based_measurement.Options(category_filter) | 139 options = timeline_based_measurement.Options(category_filter) |
| 141 options.SetLegacyTimelineBasedMetrics([ | 140 return options |
| 141 | |
| 142 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): | |
| 143 tbm_options.SetLegacyTimelineBasedMetrics(( | |
| 142 v8_gc_latency.V8GCLatency(), | 144 v8_gc_latency.V8GCLatency(), |
| 143 memory_timeline.MemoryTimelineMetric()]) | 145 memory_timeline.MemoryTimelineMetric(), |
| 144 return options | 146 )) |
|
nednguyen
2016/03/10 16:33:32
We also need to set the categories properly, I thi
perezju
2016/03/14 11:55:03
So, you mean all of the code to set category filte
nednguyen
2016/03/14 15:10:49
Ah, I just look at the code. It looks like you don
| |
| 145 | 147 |
| 146 @classmethod | 148 @classmethod |
| 147 def Name(cls): | 149 def Name(cls): |
| 148 return 'memory.long_running_idle_gmail_tbm' | 150 return 'memory.long_running_idle_gmail_tbm' |
| 149 | 151 |
| 150 @classmethod | 152 @classmethod |
| 151 def ShouldTearDownStateAfterEachStoryRun(cls): | 153 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 152 return True | 154 return True |
| OLD | NEW |