| Index: tools/telemetry/telemetry/core/timeline/async_slice.py
|
| diff --git a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py b/tools/telemetry/telemetry/core/timeline/async_slice.py
|
| similarity index 62%
|
| rename from tools/telemetry/telemetry/core/timeline/tracing/async_slice.py
|
| rename to tools/telemetry/telemetry/core/timeline/async_slice.py
|
| index 03031c1e6e43bb5afdcd66c5444f37086507a965..f1b2af68aea8d60c71ede4d4693d75c05f7053c7 100644
|
| --- a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py
|
| +++ b/tools/telemetry/telemetry/core/timeline/async_slice.py
|
| @@ -2,20 +2,26 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| -import telemetry.core.timeline.tracing.slice as tracing_slice
|
| +import telemetry.core.timeline.event as event
|
|
|
| -class AsyncSlice(tracing_slice.Slice):
|
| +class AsyncSlice(event.TimelineEvent):
|
| ''' A AsyncSlice represents an interval of time during which an
|
| asynchronous operation is in progress. An AsyncSlice consumes no CPU time
|
| itself and so is only associated with Threads at its start and end point.
|
| '''
|
| def __init__(self, category, name, timestamp, args=None, parent=None):
|
| super(AsyncSlice, self).__init__(
|
| - category, name, timestamp, args=args, parent=parent)
|
| + category, name, timestamp, duration=0, args=args, parent=parent)
|
| self.start_thread = None
|
| self.end_thread = None
|
| + self.sub_slices = []
|
| self.id = None
|
|
|
| def AddSubSlice(self, sub_slice):
|
| - super(AsyncSlice, self).AddSubSlice(sub_slice)
|
| - self.children.append(sub_slice)
|
| + assert sub_slice.parent == self
|
| + self.sub_slices.append(sub_slice)
|
| +
|
| +
|
| + def IterEventsInThisContainerRecrusively(self):
|
| + for sub_slice in self.sub_slices:
|
| + yield sub_slice
|
|
|