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