| 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 |
| 11 from telemetry.web_perf import timeline_based_measurement | 11 from telemetry.web_perf import timeline_based_measurement |
| 12 from telemetry.web_perf.metrics import memory_timeline | 12 from telemetry.web_perf.metrics import memory_timeline |
| 13 from telemetry.web_perf.metrics import v8_gc_latency | 13 from telemetry.web_perf.metrics import v8_gc_latency |
| 14 | 14 |
| 15 import page_sets | 15 import page_sets |
| 16 | 16 |
| 17 | 17 |
| 18 class _MemoryInfra(perf_benchmark.PerfBenchmark): | 18 class _MemoryInfra(perf_benchmark.PerfBenchmark): |
| 19 """Base class for new-generation memory benchmarks based on memory-infra. | 19 """Base class for new-generation memory benchmarks based on memory-infra. |
| 20 | 20 |
| 21 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which | 21 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which |
| 22 is part of chrome tracing, and extracts it using timeline-based measurements. | 22 is part of chrome tracing, and extracts it using timeline-based measurements. |
| 23 """ | 23 """ |
| 24 | 24 |
| 25 def SetExtraBrowserOptions(self, options): | 25 def SetExtraBrowserOptions(self, options): |
| 26 options.AppendExtraBrowserArgs([ | 26 options.AppendExtraBrowserArgs([ |
| 27 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | 27 # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
| 28 # See: http://crbug.com/513692 | 28 # See: http://crbug.com/513692 |
| 29 '--enable-memory-benchmarking', | 29 # '--enable-memory-benchmarking', |
| 30 '--no-sandbox', |
| 31 '--enable-heap-profiling', |
| 30 ]) | 32 ]) |
| 31 | 33 |
| 32 def CreateTimelineBasedMeasurementOptions(self): | 34 def CreateTimelineBasedMeasurementOptions(self): |
| 33 # Enable only memory-infra, to get memory dumps, and blink.console, to get | 35 # Enable only memory-infra, to get memory dumps, and blink.console, to get |
| 34 # the timeline markers used for mapping threads to tabs. | 36 # the timeline markers used for mapping threads to tabs. |
| 35 trace_memory = tracing_category_filter.TracingCategoryFilter( | 37 trace_memory = tracing_category_filter.TracingCategoryFilter( |
| 36 filter_string='-*,blink.console,disabled-by-default-memory-infra') | 38 filter_string='-*,blink.console,disabled-by-default-memory-infra,skia') |
| 37 tbm_options = timeline_based_measurement.Options( | 39 tbm_options = timeline_based_measurement.Options( |
| 38 overhead_level=trace_memory) | 40 overhead_level=trace_memory) |
| 39 tbm_options.config.enable_android_graphics_memtrack = True | 41 tbm_options.config.enable_android_graphics_memtrack = True |
| 40 return tbm_options | 42 return tbm_options |
| 41 | 43 |
| 42 @classmethod | 44 @classmethod |
| 43 def HasTraceRerunDebugOption(cls): | 45 def HasTraceRerunDebugOption(cls): |
| 44 return True | 46 return True |
| 45 | 47 |
| 46 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): | 48 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 memory_timeline.MemoryTimelineMetric(), | 147 memory_timeline.MemoryTimelineMetric(), |
| 146 )) | 148 )) |
| 147 | 149 |
| 148 @classmethod | 150 @classmethod |
| 149 def Name(cls): | 151 def Name(cls): |
| 150 return 'memory.long_running_idle_gmail_tbm' | 152 return 'memory.long_running_idle_gmail_tbm' |
| 151 | 153 |
| 152 @classmethod | 154 @classmethod |
| 153 def ShouldTearDownStateAfterEachStoryRun(cls): | 155 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 154 return True | 156 return True |
| OLD | NEW |