Index: base/trace_event/trace_log.cc |
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc |
index a0b12fbc5426fc1f357b4be8eb219a690ca2c647..09a5f85c72a471e3bf486b9d0a5b4df7f95d24be 100644 |
--- a/base/trace_event/trace_log.cc |
+++ b/base/trace_event/trace_log.cc |
@@ -223,6 +223,7 @@ class TraceLog::ThreadLocalEventBuffer |
} |
int generation() const { return generation_; } |
+ size_t chunk_index() { return chunk_index_; } |
private: |
// MessageLoop::DestructionObserver |
@@ -1254,6 +1255,11 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( |
lock.EnsureAcquired(); |
trace_event = AddEventToThreadSharedChunkWhileLocked(&handle, true); |
} |
+ if (strcmp(name, "SequencedWorkerPool::Inner::ThreadLoop") == 0) { |
+ LOG(ERROR) << "ssid adding event SequencedWorkerPool::Inner::ThreadLoop using " << (thread_local_event_buffer ? "thread_local " : "thread_shared ") << handle.chunk_seq << " " << handle.chunk_index << " " << handle.event_index << " " << name; |
+ |
+ LOG(ERROR) << "ssid sshared index " << thread_shared_chunk_index_ << " local index " << (thread_local_event_buffer? thread_local_event_buffer->chunk_index() : 0); |
+ } |
if (trace_event) { |
trace_event->Initialize(thread_id, |
@@ -1436,6 +1442,15 @@ void TraceLog::UpdateTraceEventDuration( |
TraceEvent* trace_event = GetEventByHandleInternal(handle, &lock); |
if (trace_event) { |
DCHECK(trace_event->phase() == TRACE_EVENT_PHASE_COMPLETE); |
+ if (trace_event->duration().ToInternalValue() != -1) { |
+ LOG(ERROR) << "ssid got event from " << (thread_local_event_buffer_.Get() ? "thread_local" : "thread_shared"); |
+ if (thread_shared_chunk_ && handle.chunk_index == thread_shared_chunk_index_) |
+ LOG(ERROR) << "ssid event if not local is from in flight shared chunk with index " << thread_shared_chunk_index_; |
+ else |
+ LOG(ERROR) << "ssid event if not local is from logged_events_"; |
+ LOG(ERROR) << "ssid duration set for handle " << handle.chunk_seq << " " << handle.chunk_index << " " << handle.event_index << " " << name; |
+ } |
+ CHECK_EQ(trace_event->name(), name); |
trace_event->UpdateDuration(now, thread_now); |
#if defined(OS_ANDROID) |
trace_event->SendToATrace(); |