| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 benchmarks import v8_helper | 7 from benchmarks import v8_helper |
| 8 from core import perf_benchmark | 8 from core import perf_benchmark |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 from telemetry.timeline import chrome_trace_config | 10 from telemetry.timeline import chrome_trace_config |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 This benchmark measures memory usage with periodic memory dumps and v8 times. | 35 This benchmark measures memory usage with periodic memory dumps and v8 times. |
| 36 See browsing_stories._BrowsingStory for workload description. | 36 See browsing_stories._BrowsingStory for workload description. |
| 37 """ | 37 """ |
| 38 | 38 |
| 39 def CreateTimelineBasedMeasurementOptions(self): | 39 def CreateTimelineBasedMeasurementOptions(self): |
| 40 categories = [ | 40 categories = [ |
| 41 # Disable all categories by default. | 41 # Disable all categories by default. |
| 42 '-*', | 42 '-*', |
| 43 # Memory categories. | 43 # Memory categories. |
| 44 'disabled-by-default-memory-infra', | 44 'disabled-by-default-memory-infra', |
| 45 # EQT categories. |
| 46 'blink.user_timing', |
| 47 'loading', |
| 48 'navigation', |
| 49 'toplevel', |
| 45 # V8 categories. | 50 # V8 categories. |
| 46 'blink.console', | 51 'blink.console', |
| 47 'disabled-by-default-v8.gc', | 52 'disabled-by-default-v8.gc', |
| 48 'renderer.scheduler', | 53 'renderer.scheduler', |
| 49 'v8', | 54 'v8', |
| 50 'webkit.console', | 55 'webkit.console', |
| 51 # TODO(crbug.com/616441, primiano): Remove this temporary workaround, | 56 # TODO(crbug.com/616441, primiano): Remove this temporary workaround, |
| 52 # which enables memory-infra V8 code stats in V8 code size benchmarks | 57 # which enables memory-infra V8 code stats in V8 code size benchmarks |
| 53 # only (to not slow down detailed memory dumps in other benchmarks). | 58 # only (to not slow down detailed memory dumps in other benchmarks). |
| 54 'disabled-by-default-memory-infra.v8.code_stats', | 59 'disabled-by-default-memory-infra.v8.code_stats', |
| 55 ] | 60 ] |
| 56 options = timeline_based_measurement.Options( | 61 options = timeline_based_measurement.Options( |
| 57 chrome_trace_category_filter.ChromeTraceCategoryFilter( | 62 chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 58 ','.join(categories))) | 63 ','.join(categories))) |
| 59 options.config.enable_android_graphics_memtrack = True | 64 options.config.enable_android_graphics_memtrack = True |
| 60 # Trigger periodic light memory dumps every 1000 ms. | 65 # Trigger periodic light memory dumps every 1000 ms. |
| 61 memory_dump_config = chrome_trace_config.MemoryDumpConfig() | 66 memory_dump_config = chrome_trace_config.MemoryDumpConfig() |
| 62 memory_dump_config.AddTrigger('light', 1000) | 67 memory_dump_config.AddTrigger('light', 1000) |
| 63 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) | 68 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) |
| 64 options.SetTimelineBasedMetrics(['v8AndMemoryMetrics']) | 69 options.SetTimelineBasedMetrics([ |
| 70 'expectedQueueingTimeMetric', 'v8AndMemoryMetrics']) |
| 65 return options | 71 return options |
| 66 | 72 |
| 67 def CreateStorySet(self, options): | 73 def CreateStorySet(self, options): |
| 68 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') | 74 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') |
| 69 | 75 |
| 70 @classmethod | 76 @classmethod |
| 71 def Name(cls): | 77 def Name(cls): |
| 72 return 'v8.browsing_%s%s' % (cls.PLATFORM, cls.TEST_SUFFIX) | 78 return 'v8.browsing_%s%s' % (cls.PLATFORM, cls.TEST_SUFFIX) |
| 73 | 79 |
| 74 @classmethod | 80 @classmethod |
| 75 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 81 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 76 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 82 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 77 # is able to cope with the data load generated by TBMv2 metrics. | 83 # is able to cope with the data load generated by TBMv2 metrics. |
| 78 if 'memory:chrome' in value.name: | 84 if 'memory:chrome' in value.name: |
| 79 return ('renderer_processes' in value.name and | 85 return ('renderer_processes' in value.name and |
| 80 not _IGNORED_MEMORY_STATS_RE.search(value.name)) | 86 not _IGNORED_MEMORY_STATS_RE.search(value.name)) |
| 81 if 'v8-gc' in value.name: | 87 if 'v8-gc' in value.name: |
| 82 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and | 88 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and |
| 83 not _IGNORED_V8_STATS_RE.search(value.name)) | 89 not _IGNORED_V8_STATS_RE.search(value.name)) |
| 84 # Allow all other non-GC metrics. | 90 # Allow all other metrics. |
| 85 return 'v8' in value.name | 91 return True |
| 86 | 92 |
| 87 @classmethod | 93 @classmethod |
| 88 def ShouldTearDownStateAfterEachStoryRun(cls): | 94 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 89 return True | 95 return True |
| 90 | 96 |
| 91 | 97 |
| 92 class _V8RuntimeStatsBrowsingBenchmark(perf_benchmark.PerfBenchmark): | 98 class _V8RuntimeStatsBrowsingBenchmark(perf_benchmark.PerfBenchmark): |
| 93 """Base class for V8 browsing benchmarks that measure RuntimeStats. | 99 """Base class for V8 browsing benchmarks that measure RuntimeStats. |
| 94 RuntimeStats measure the time spent by v8 in different phases like | 100 RuntimeStats measure the time spent by v8 in different phases like |
| 95 compile, JS execute, runtime etc., | 101 compile, JS execute, runtime etc., |
| 96 See browsing_stories._BrowsingStory for workload description. | 102 See browsing_stories._BrowsingStory for workload description. |
| 97 """ | 103 """ |
| 98 | 104 |
| 99 def CreateTimelineBasedMeasurementOptions(self): | 105 def CreateTimelineBasedMeasurementOptions(self): |
| 100 categories = [ | 106 categories = [ |
| 101 # Disable all categories by default. | 107 # Disable all categories by default. |
| 102 '-*', | 108 '-*', |
| 103 # Memory categories. | 109 # Memory categories. |
| 104 'disabled-by-default-memory-infra', | 110 'disabled-by-default-memory-infra', |
| 105 # UE categories requred by runtimeStatsTotalMetric to bucket | 111 # UE categories requred by runtimeStatsTotalMetric to bucket |
| 106 # runtimeStats by UE. | 112 # runtimeStats by UE. |
| 107 'rail', | 113 'rail', |
| 114 # EQT categories. |
| 115 'blink.user_timing', |
| 116 'loading', |
| 117 'navigation', |
| 118 'toplevel', |
| 108 # V8 categories. | 119 # V8 categories. |
| 109 'blink.console', | 120 'blink.console', |
| 110 'disabled-by-default-v8.gc', | 121 'disabled-by-default-v8.gc', |
| 111 'renderer.scheduler', | 122 'renderer.scheduler', |
| 112 'v8', | 123 'v8', |
| 113 'webkit.console', | 124 'webkit.console', |
| 114 'disabled-by-default-v8.runtime_stats', | 125 'disabled-by-default-v8.runtime_stats', |
| 115 ] | 126 ] |
| 116 options = timeline_based_measurement.Options( | 127 options = timeline_based_measurement.Options( |
| 117 chrome_trace_category_filter.ChromeTraceCategoryFilter( | 128 chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 118 ','.join(categories))) | 129 ','.join(categories))) |
| 119 options.config.enable_android_graphics_memtrack = True | 130 options.config.enable_android_graphics_memtrack = True |
| 120 # Trigger periodic light memory dumps every 1000 ms. | 131 # Trigger periodic light memory dumps every 1000 ms. |
| 121 memory_dump_config = chrome_trace_config.MemoryDumpConfig() | 132 memory_dump_config = chrome_trace_config.MemoryDumpConfig() |
| 122 memory_dump_config.AddTrigger('light', 1000) | 133 memory_dump_config.AddTrigger('light', 1000) |
| 123 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) | 134 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) |
| 124 | 135 |
| 125 options.SetTimelineBasedMetrics(['runtimeStatsTotalMetric', 'gcMetric']) | 136 options.SetTimelineBasedMetrics([ |
| 137 'expectedQueueingTimeMetric', 'runtimeStatsTotalMetric', 'gcMetric']) |
| 126 return options | 138 return options |
| 127 | 139 |
| 128 def CreateStorySet(self, options): | 140 def CreateStorySet(self, options): |
| 129 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') | 141 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') |
| 130 | 142 |
| 131 @classmethod | 143 @classmethod |
| 132 def Name(cls): | 144 def Name(cls): |
| 133 return 'v8.runtimestats.browsing_%s%s' % (cls.PLATFORM, cls.TEST_SUFFIX) | 145 return 'v8.runtimestats.browsing_%s%s' % (cls.PLATFORM, cls.TEST_SUFFIX) |
| 134 | 146 |
| 135 @classmethod | 147 @classmethod |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 TEST_SUFFIX = '_classic' | 315 TEST_SUFFIX = '_classic' |
| 304 | 316 |
| 305 def SetExtraBrowserOptions(self, options): | 317 def SetExtraBrowserOptions(self, options): |
| 306 super(V8RuntimeStatsMobileClassicBrowsingBenchmark, | 318 super(V8RuntimeStatsMobileClassicBrowsingBenchmark, |
| 307 self).SetExtraBrowserOptions(options) | 319 self).SetExtraBrowserOptions(options) |
| 308 v8_helper.EnableClassic(options) | 320 v8_helper.EnableClassic(options) |
| 309 | 321 |
| 310 @classmethod | 322 @classmethod |
| 311 def ShouldDisable(cls, possible_browser): | 323 def ShouldDisable(cls, possible_browser): |
| 312 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | 324 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' |
| OLD | NEW |