Chromium Code Reviews| Index: tools/telemetry/telemetry/core/timeline/model.py |
| diff --git a/tools/telemetry/telemetry/core/timeline/model.py b/tools/telemetry/telemetry/core/timeline/model.py |
| index 762ddb15f1362ae5ee3431bca74f2fb738631fbd..8b9077300d3ba8270f8b25933af5f5eb64d3a5a0 100644 |
| --- a/tools/telemetry/telemetry/core/timeline/model.py |
| +++ b/tools/telemetry/telemetry/core/timeline/model.py |
| @@ -40,6 +40,7 @@ class MarkerOverlapError(Exception): |
| class TimelineModel(object): |
| def __init__(self, event_data=None, shift_world_to_zero=True): |
| self._bounds = bounds.Bounds() |
| + self._thread_bounds = bounds.Bounds() |
|
nduca
2013/12/03 07:18:55
i think the name here is very ... funky. can you t
ernstm
2013/12/03 20:55:54
Done: thread_time_bounds
|
| self._processes = {} |
| self._frozen = False |
| self.import_errors = [] |
| @@ -57,6 +58,10 @@ class TimelineModel(object): |
| return self._bounds |
| @property |
| + def thread_bounds(self): |
| + return self._thread_bounds |
| + |
| + @property |
| def processes(self): |
| return self._processes |
| @@ -77,7 +82,7 @@ class TimelineModel(object): |
| self.UpdateBounds() |
| if not self.bounds.is_empty: |
| for process in self._processes.itervalues(): |
| - process.AutoCloseOpenSlices(self.bounds.max) |
| + process.AutoCloseOpenSlices(self.bounds.max, self.thread_bounds.max) |
| for importer in importers: |
| importer.FinalizeImport() |
| @@ -97,15 +102,23 @@ class TimelineModel(object): |
| self.UpdateBounds() |
| if self._bounds.is_empty: |
| return |
| - shift_amount = -self._bounds.min |
| + shift_amount = self._bounds.min |
| + thread_shift_amount = self._thread_bounds.min |
|
fmeawad
2013/12/03 17:34:17
Thread timestamps are reported from the time the t
ernstm
2013/12/03 20:55:54
Maybe we keep it as is (which is consistent with t
fmeawad
2013/12/03 21:04:41
Sounds good.
|
| for event in self.IterAllEvents(): |
| - event.start += shift_amount |
| + event.start -= shift_amount |
| + if event.thread_start != None: |
| + event.thread_start -= thread_shift_amount |
| def UpdateBounds(self): |
| self._bounds.Reset() |
| + self._thread_bounds.Reset() |
| for event in self.IterAllEvents(): |
| self._bounds.AddValue(event.start) |
| self._bounds.AddValue(event.end) |
| + if event.thread_start != None: |
| + self._thread_bounds.AddValue(event.thread_start) |
| + if event.thread_end != None: |
| + self._thread_bounds.AddValue(event.thread_end) |
| def GetAllContainers(self): |
| containers = [] |