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

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

Issue 809753002: Revert of telemetry: Clean up SurfaceFlinger statistics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 from telemetry.timeline import importer
6 from telemetry.timeline import surface_flinger_timeline_data
7
8 class SurfaceFlingerTimelineImporter(importer.TimelineImporter):
9 def __init__(self, model, timeline_data):
10 super(SurfaceFlingerTimelineImporter, self).__init__(
11 model, timeline_data, import_priority=2)
12 self._events = timeline_data.EventData()
13 self._surface_flinger_process = None
14
15 @staticmethod
16 def CanImport(timeline_data):
17 if isinstance(timeline_data,
18 surface_flinger_timeline_data.SurfaceFlingerTimelineData):
19 return True
20
21 return False
22
23 def ImportEvents(self):
24 for event in self._events:
25 self._surface_flinger_process = self._model.GetOrCreateProcess(
26 event['pid'])
27 self._surface_flinger_process.name = 'SurfaceFlinger'
28 thread = self._surface_flinger_process.GetOrCreateThread(event['tid'])
29 thread.BeginSlice(event['cat'],
30 event['name'],
31 event['ts'],
32 args=event.get('args'))
33 thread.EndSlice(event['ts'])
34
35 def FinalizeImport(self):
36 '''Called by the Model after all other importers have imported their
37 events.'''
38 self._model.UpdateBounds()
39 self._model.surface_flinger_process = self._surface_flinger_process
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/timeline/model.py ('k') | tools/telemetry/telemetry/timeline/surface_flinger_timeline_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698