| 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 from benchmarks import silk_flags | 4 from benchmarks import silk_flags |
| 5 import page_sets | 5 import page_sets |
| 6 from telemetry import benchmark | 6 from telemetry import benchmark |
| 7 from telemetry.core.platform import tracing_category_filter | 7 from telemetry.core.platform import tracing_category_filter |
| 8 from telemetry.web_perf import timeline_based_measurement | 8 from telemetry.web_perf import timeline_based_measurement |
| 9 from telemetry.web_perf.metrics import gpu_timeline | 9 from telemetry.web_perf.metrics import gpu_timeline |
| 10 | 10 |
| 11 TOPLEVEL_GL_CATEGORY = 'gpu_toplevel' | 11 TOPLEVEL_GL_CATEGORY = 'gpu_toplevel' |
| 12 TOPLEVEL_CATEGORIES = ['disabled-by-default-gpu.device', | 12 TOPLEVEL_CATEGORIES = ['disabled-by-default-gpu.device', |
| 13 'disabled-by-default-gpu.service'] | 13 'disabled-by-default-gpu.service'] |
| 14 | 14 |
| 15 | 15 |
| 16 class _GPUTimes(benchmark.Benchmark): | 16 class _GPUTimes(benchmark.Benchmark): |
| 17 def CreateTimelineBasedMeasurementOptions(self): | 17 def CreateTimelineBasedMeasurementOptions(self): |
| 18 cat_string = ','.join(TOPLEVEL_CATEGORIES) | 18 cat_string = ','.join(TOPLEVEL_CATEGORIES) |
| 19 cat_filter = tracing_category_filter.TracingCategoryFilter(cat_string) | 19 cat_filter = tracing_category_filter.TracingCategoryFilter(cat_string) |
| 20 | 20 |
| 21 return timeline_based_measurement.Options( | 21 return timeline_based_measurement.Options( |
| 22 overhead_level=cat_filter) | 22 overhead_level=cat_filter) |
| 23 | 23 |
| 24 @classmethod | 24 @classmethod |
| 25 def ValueCanBeAddedPredicate(cls, value, _): | 25 def ValueCanBeAddedPredicate(cls, value, _): |
| 26 return (isinstance(value, gpu_timeline.GPUTimelineListOfValues) or | 26 return (isinstance(value, gpu_timeline.GPUTimelineListOfValues) or |
| 27 isinstance(value, gpu_timeline.GPUTimelineValue)) | 27 isinstance(value, gpu_timeline.GPUTimelineValue)) |
| 28 | 28 |
| 29 @benchmark.Disabled # http://crbug.com/455292 | 29 @benchmark.Disabled('win') # http://crbug.com/453131 |
| 30 class GPUTimesKeyMobileSites(_GPUTimes): | 30 class GPUTimesKeyMobileSites(_GPUTimes): |
| 31 """Measures GPU timeline metric on key mobile sites.""" | 31 """Measures GPU timeline metric on key mobile sites.""" |
| 32 page_set = page_sets.KeyMobileSitesSmoothPageSet | 32 page_set = page_sets.KeyMobileSitesSmoothPageSet |
| 33 | 33 |
| 34 @classmethod | 34 @classmethod |
| 35 def Name(cls): | 35 def Name(cls): |
| 36 return 'gpu_times.key_mobile_sites_smooth' | 36 return 'gpu_times.key_mobile_sites_smooth' |
| 37 | 37 |
| 38 @benchmark.Disabled # http://crbug.com/455292 | 38 @benchmark.Disabled('win') # http://crbug.com/453131 |
| 39 class GPUTimesGpuRasterizationKeyMobileSites(_GPUTimes): | 39 class GPUTimesGpuRasterizationKeyMobileSites(_GPUTimes): |
| 40 """Measures GPU timeline metric on key mobile sites with GPU rasterization. | 40 """Measures GPU timeline metric on key mobile sites with GPU rasterization. |
| 41 """ | 41 """ |
| 42 page_set = page_sets.KeyMobileSitesSmoothPageSet | 42 page_set = page_sets.KeyMobileSitesSmoothPageSet |
| 43 def CustomizeBrowserOptions(self, options): | 43 def CustomizeBrowserOptions(self, options): |
| 44 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) | 44 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) |
| 45 | 45 |
| 46 @classmethod | 46 @classmethod |
| 47 def Name(cls): | 47 def Name(cls): |
| 48 return 'gpu_times.gpu_rasterization.key_mobile_sites_smooth' | 48 return 'gpu_times.gpu_rasterization.key_mobile_sites_smooth' |
| 49 | 49 |
| 50 @benchmark.Disabled # http://crbug.com/453131, http://crbug.com/455292 | 50 @benchmark.Disabled('win') # http://crbug.com/453131 |
| 51 class GPUTimesTop25Sites(_GPUTimes): | 51 class GPUTimesTop25Sites(_GPUTimes): |
| 52 """Measures GPU timeline metric for the top 25 sites.""" | 52 """Measures GPU timeline metric for the top 25 sites.""" |
| 53 page_set = page_sets.Top25SmoothPageSet | 53 page_set = page_sets.Top25SmoothPageSet |
| 54 | 54 |
| 55 @classmethod | 55 @classmethod |
| 56 def Name(cls): | 56 def Name(cls): |
| 57 return 'gpu_times.top_25_smooth' | 57 return 'gpu_times.top_25_smooth' |
| 58 | 58 |
| 59 @benchmark.Disabled # http://crbug.com/455292 | 59 @benchmark.Disabled('win') # http://crbug.com/453131 |
| 60 class GPUTimesGpuRasterizationTop25Sites(_GPUTimes): | 60 class GPUTimesGpuRasterizationTop25Sites(_GPUTimes): |
| 61 """Measures GPU timeline metric for the top 25 sites with GPU rasterization. | 61 """Measures GPU timeline metric for the top 25 sites with GPU rasterization. |
| 62 """ | 62 """ |
| 63 page_set = page_sets.Top25SmoothPageSet | 63 page_set = page_sets.Top25SmoothPageSet |
| 64 def CustomizeBrowserOptions(self, options): | 64 def CustomizeBrowserOptions(self, options): |
| 65 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) | 65 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) |
| 66 | 66 |
| 67 @classmethod | 67 @classmethod |
| 68 def Name(cls): | 68 def Name(cls): |
| 69 return 'gpu_times.gpu_rasterization.top_25_smooth' | 69 return 'gpu_times.gpu_rasterization.top_25_smooth' |
| 70 | 70 |
| OLD | NEW |