Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: tools/telemetry/telemetry/timeline/model.py

Issue 847433005: Revert of Revert of Add explicit support for discovering the GpuProcess to Telemetry's 'Model'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/timeline/trace_event_importer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '''A container for timeline-based events and traces and can handle importing 4 '''A container for timeline-based events and traces and can handle importing
5 raw event data from different sources. This model closely resembles that in the 5 raw event data from different sources. This model closely resembles that in the
6 trace_viewer project: 6 trace_viewer project:
7 https://code.google.com/p/trace-viewer/ 7 https://code.google.com/p/trace-viewer/
8 ''' 8 '''
9 9
10 from operator import attrgetter 10 from operator import attrgetter
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Args: 55 Args:
56 trace_data: trace_data.TraceData containing events to import 56 trace_data: trace_data.TraceData containing events to import
57 shift_world_to_zero: If true, the events will be shifted such that the 57 shift_world_to_zero: If true, the events will be shifted such that the
58 first event starts at time 0. 58 first event starts at time 0.
59 """ 59 """
60 super(TimelineModel, self).__init__(name='TimelineModel', parent=None) 60 super(TimelineModel, self).__init__(name='TimelineModel', parent=None)
61 self._bounds = bounds.Bounds() 61 self._bounds = bounds.Bounds()
62 self._thread_time_bounds = {} 62 self._thread_time_bounds = {}
63 self._processes = {} 63 self._processes = {}
64 self._browser_process = None 64 self._browser_process = None
65 self._gpu_process = None
65 self._surface_flinger_process = None 66 self._surface_flinger_process = None
66 self._frozen = False 67 self._frozen = False
67 self._tab_ids_to_renderer_threads_map = {} 68 self._tab_ids_to_renderer_threads_map = {}
68 self.import_errors = [] 69 self.import_errors = []
69 self.metadata = [] 70 self.metadata = []
70 self.flow_events = [] 71 self.flow_events = []
71 if trace_data is not None: 72 if trace_data is not None:
72 self.ImportTraces(trace_data, shift_world_to_zero=shift_world_to_zero) 73 self.ImportTraces(trace_data, shift_world_to_zero=shift_world_to_zero)
73 74
74 def IterChildContainers(self): 75 def IterChildContainers(self):
(...skipping 22 matching lines...) Expand all
97 def browser_process(self): 98 def browser_process(self):
98 return self._browser_process 99 return self._browser_process
99 100
100 @browser_process.setter 101 @browser_process.setter
101 #pylint: disable=E0202 102 #pylint: disable=E0202
102 def browser_process(self, browser_process): 103 def browser_process(self, browser_process):
103 self._browser_process = browser_process 104 self._browser_process = browser_process
104 105
105 @property 106 @property
106 #pylint: disable=E0202 107 #pylint: disable=E0202
108 def gpu_process(self):
109 return self._gpu_process
110
111 @gpu_process.setter
112 #pylint: disable=E0202
113 def gpu_process(self, gpu_process):
114 self._gpu_process = gpu_process
115
116 @property
117 #pylint: disable=E0202
107 def surface_flinger_process(self): 118 def surface_flinger_process(self):
108 return self._surface_flinger_process 119 return self._surface_flinger_process
109 120
110 @surface_flinger_process.setter 121 @surface_flinger_process.setter
111 #pylint: disable=E0202 122 #pylint: disable=E0202
112 def surface_flinger_process(self, surface_flinger_process): 123 def surface_flinger_process(self, surface_flinger_process):
113 self._surface_flinger_process = surface_flinger_process 124 self._surface_flinger_process = surface_flinger_process
114 125
115 def AddMappingFromTabIdToRendererThread(self, tab_id, renderer_thread): 126 def AddMappingFromTabIdToRendererThread(self, tab_id, renderer_thread):
116 if self._frozen: 127 if self._frozen:
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 importers = [] 264 importers = []
254 for part in trace_data.active_parts: 265 for part in trace_data.active_parts:
255 importer_class = FindImporterClassForPart(part) 266 importer_class = FindImporterClassForPart(part)
256 if not importer_class: 267 if not importer_class:
257 raise Exception('No importer found for %s' % repr(part)) 268 raise Exception('No importer found for %s' % repr(part))
258 importers.append(importer_class(self, trace_data)) 269 importers.append(importer_class(self, trace_data))
259 270
260 importers.sort(key=lambda k: k.import_order) 271 importers.sort(key=lambda k: k.import_order)
261 272
262 return importers 273 return importers
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/timeline/trace_event_importer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698