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