| 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 | 5 |
| 6 from metrics import Metric | 6 from metrics import Metric |
| 7 | 7 |
| 8 TRACING_MODE = 'tracing-mode' | 8 TRACING_MODE = 'tracing-mode' |
| 9 TIMELINE_MODE = 'timeline-mode' | 9 TIMELINE_MODE = 'timeline-mode' |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 results.Add(counter_name + '_avg', 'count', total / len(counter.totals)) | 100 results.Add(counter_name + '_avg', 'count', total / len(counter.totals)) |
| 101 | 101 |
| 102 | 102 |
| 103 # We want to generate a consistant picture of our thread usage, despite | 103 # We want to generate a consistant picture of our thread usage, despite |
| 104 # having several process configurations (in-proc-gpu/single-proc). | 104 # having several process configurations (in-proc-gpu/single-proc). |
| 105 # Since we can't isolate renderer threads in single-process mode, we | 105 # Since we can't isolate renderer threads in single-process mode, we |
| 106 # always sum renderer-process threads' times. We also sum all io-threads | 106 # always sum renderer-process threads' times. We also sum all io-threads |
| 107 # for simplicity. | 107 # for simplicity. |
| 108 TimelineThreadCategories = { | 108 TimelineThreadCategories = { |
| 109 "Chrome_InProcGpuThread": "GPU", | 109 "Chrome_InProcGpuThread": "GPU", |
| 110 "CrGPUMain" : "GPU", | 110 "CrGpuMain" : "GPU", |
| 111 "AsyncTransferThread" : "GPU_transfer", | 111 "AsyncTransferThread" : "GPU_transfer", |
| 112 "CrBrowserMain" : "browser_main", | 112 "CrBrowserMain" : "browser_main", |
| 113 "Browser Compositor" : "browser_compositor", | 113 "Browser Compositor" : "browser_compositor", |
| 114 "CrRendererMain" : "renderer_main", | 114 "CrRendererMain" : "renderer_main", |
| 115 "Compositor" : "renderer_compositor", | 115 "Compositor" : "renderer_compositor", |
| 116 "IOThread" : "IO", | 116 "IOThread" : "IO", |
| 117 "CompositorRasterWorker": "raster" | 117 "CompositorRasterWorker": "raster" |
| 118 } | 118 } |
| 119 MatchBySubString = ["IOThread", "CompositorRasterWorker"] | 119 MatchBySubString = ["IOThread", "CompositorRasterWorker"] |
| 120 FastPath = ["GPU", | 120 FastPath = ["GPU", |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 self._model.bounds.bounds) * 100 | 223 self._model.bounds.bounds) * 100 |
| 224 results.Add(cpu_time_report_name, '%', time_as_percentage) | 224 results.Add(cpu_time_report_name, '%', time_as_percentage) |
| 225 | 225 |
| 226 # TOOD(nduca): When generic results objects are done, this special case | 226 # TOOD(nduca): When generic results objects are done, this special case |
| 227 # can be replaced with a generic UI feature. | 227 # can be replaced with a generic UI feature. |
| 228 for thread_category, results_for_thread_category in ( | 228 for thread_category, results_for_thread_category in ( |
| 229 results_per_thread_category.iteritems()): | 229 results_per_thread_category.iteritems()): |
| 230 if (thread_category == 'renderer_main' and | 230 if (thread_category == 'renderer_main' and |
| 231 self.report_renderer_main_details): | 231 self.report_renderer_main_details): |
| 232 results_for_thread_category.AddDetailedResults(thread_category, results) | 232 results_for_thread_category.AddDetailedResults(thread_category, results) |
| OLD | NEW |