| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 | 4 |
| 5 import telemetry.core.timeline.event_container as event_container | 5 import telemetry.core.timeline.event_container as event_container |
| 6 import telemetry.core.timeline.counter as tracing_counter | 6 import telemetry.core.timeline.counter as tracing_counter |
| 7 import telemetry.core.timeline.thread as tracing_thread | 7 import telemetry.core.timeline.thread as tracing_thread |
| 8 | 8 |
| 9 class Process(event_container.TimelineEventContainer): | 9 class Process(event_container.TimelineEventContainer): |
| 10 ''' The Process represents a single userland process in the trace. | 10 ''' The Process represents a single userland process in the trace. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 for thread in self._threads.itervalues(): | 27 for thread in self._threads.itervalues(): |
| 28 yield thread | 28 yield thread |
| 29 for counter in self._counters.itervalues(): | 29 for counter in self._counters.itervalues(): |
| 30 yield counter | 30 yield counter |
| 31 | 31 |
| 32 def IterAllSlicesOfName(self, name): | 32 def IterAllSlicesOfName(self, name): |
| 33 for thread in self._threads.itervalues(): | 33 for thread in self._threads.itervalues(): |
| 34 for s in thread.IterAllSlicesOfName(name): | 34 for s in thread.IterAllSlicesOfName(name): |
| 35 yield s | 35 yield s |
| 36 | 36 |
| 37 def IterAllAsyncSlicesOfName(self, name): |
| 38 for thread in self._threads.itervalues(): |
| 39 for s in thread.IterAllAsyncSlicesOfName(name): |
| 40 yield s |
| 41 |
| 37 def IterEventsInThisContainer(self): | 42 def IterEventsInThisContainer(self): |
| 38 return | 43 return |
| 39 yield # pylint: disable=W0101 | 44 yield # pylint: disable=W0101 |
| 40 | 45 |
| 41 def GetOrCreateThread(self, tid): | 46 def GetOrCreateThread(self, tid): |
| 42 thread = self.threads.get(tid, None) | 47 thread = self.threads.get(tid, None) |
| 43 if thread: | 48 if thread: |
| 44 return thread | 49 return thread |
| 45 thread = tracing_thread.Thread(self, tid) | 50 thread = tracing_thread.Thread(self, tid) |
| 46 self._threads[tid] = thread | 51 self._threads[tid] = thread |
| (...skipping 16 matching lines...) Expand all Loading... |
| 63 | 68 |
| 64 def AutoCloseOpenSlices(self, max_timestamp, thread_time_bounds): | 69 def AutoCloseOpenSlices(self, max_timestamp, thread_time_bounds): |
| 65 for thread in self._threads.itervalues(): | 70 for thread in self._threads.itervalues(): |
| 66 thread.AutoCloseOpenSlices(max_timestamp, thread_time_bounds[thread].max) | 71 thread.AutoCloseOpenSlices(max_timestamp, thread_time_bounds[thread].max) |
| 67 | 72 |
| 68 def FinalizeImport(self): | 73 def FinalizeImport(self): |
| 69 for thread in self._threads.itervalues(): | 74 for thread in self._threads.itervalues(): |
| 70 thread.FinalizeImport() | 75 thread.FinalizeImport() |
| 71 for counter in self._counters.itervalues(): | 76 for counter in self._counters.itervalues(): |
| 72 counter.FinalizeImport() | 77 counter.FinalizeImport() |
| OLD | NEW |