OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import collections | 4 import collections |
5 from telemetry.util.statistics import DivideIfPossibleOrZero | 5 from telemetry.util.statistics import DivideIfPossibleOrZero |
6 | 6 |
7 from telemetry.web_perf.metrics import timeline_based_metric | 7 from telemetry.web_perf.metrics import timeline_based_metric |
8 from telemetry.value import scalar | 8 from telemetry.value import scalar |
9 | 9 |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 # for simplicity. | 72 # for simplicity. |
73 TimelineThreadCategories = { | 73 TimelineThreadCategories = { |
74 "Chrome_InProcGpuThread": "GPU", | 74 "Chrome_InProcGpuThread": "GPU", |
75 "CrGpuMain" : "GPU", | 75 "CrGpuMain" : "GPU", |
76 "AsyncTransferThread" : "GPU_transfer", | 76 "AsyncTransferThread" : "GPU_transfer", |
77 "CrBrowserMain" : "browser", | 77 "CrBrowserMain" : "browser", |
78 "Browser Compositor" : "browser", | 78 "Browser Compositor" : "browser", |
79 "CrRendererMain" : "renderer_main", | 79 "CrRendererMain" : "renderer_main", |
80 "Compositor" : "renderer_compositor", | 80 "Compositor" : "renderer_compositor", |
81 "IOThread" : "IO", | 81 "IOThread" : "IO", |
82 "CompositorRasterWorker": "raster", | 82 "CompositorTileWorker" : "raster", |
83 "DummyThreadName1" : "other", | 83 "DummyThreadName1" : "other", |
84 "DummyThreadName2" : "total_fast_path", | 84 "DummyThreadName2" : "total_fast_path", |
85 "DummyThreadName3" : "total_all" | 85 "DummyThreadName3" : "total_all" |
86 } | 86 } |
87 | 87 |
88 _MatchBySubString = ["IOThread", "CompositorRasterWorker"] | 88 _MatchBySubString = ["IOThread", "CompositorTileWorker"] |
89 | 89 |
90 AllThreads = TimelineThreadCategories.values() | 90 AllThreads = TimelineThreadCategories.values() |
91 NoThreads = [] | 91 NoThreads = [] |
92 FastPathThreads = ["GPU", "renderer_compositor", "browser", "IO"] | 92 FastPathThreads = ["GPU", "renderer_compositor", "browser", "IO"] |
93 | 93 |
94 ReportMainThreadOnly = ["renderer_main"] | 94 ReportMainThreadOnly = ["renderer_main"] |
95 ReportSilkDetails = ["renderer_main"] | 95 ReportSilkDetails = ["renderer_main"] |
96 | 96 |
97 # TODO(epenner): Thread names above are likely fairly stable but trace names | 97 # TODO(epenner): Thread names above are likely fairly stable but trace names |
98 # could change. We should formalize these traces to keep this robust. | 98 # could change. We should formalize these traces to keep this robust. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 num_frames = frame_rate_thread.CountTracesWithName(FrameTraceName) | 268 num_frames = frame_rate_thread.CountTracesWithName(FrameTraceName) |
269 | 269 |
270 # Report the desired results and details. | 270 # Report the desired results and details. |
271 for thread_results in thread_category_results.values(): | 271 for thread_results in thread_category_results.values(): |
272 if thread_results.name in self.results_to_report: | 272 if thread_results.name in self.results_to_report: |
273 thread_results.AddResults(num_frames, results) | 273 thread_results.AddResults(num_frames, results) |
274 # TOOD(nduca): When generic results objects are done, this special case | 274 # TOOD(nduca): When generic results objects are done, this special case |
275 # can be replaced with a generic UI feature. | 275 # can be replaced with a generic UI feature. |
276 if thread_results.name in self.details_to_report: | 276 if thread_results.name in self.details_to_report: |
277 thread_results.AddDetailedResults(num_frames, results) | 277 thread_results.AddDetailedResults(num_frames, results) |
OLD | NEW |