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

Side by Side Diff: base/trace_event/trace_log.cc

Issue 1860653002: CL for testing on Win. Base URL: https://chromium.googlesource.com/chromium/src.git@task_file
Patch Set: more logs. Created 4 years, 8 months 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
« no previous file with comments | « base/trace_event/trace_event_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "base/trace_event/trace_log.h" 5 #include "base/trace_event/trace_log.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 TraceEvent* GetEventByHandle(TraceEventHandle handle) { 216 TraceEvent* GetEventByHandle(TraceEventHandle handle) {
217 if (!chunk_ || handle.chunk_seq != chunk_->seq() || 217 if (!chunk_ || handle.chunk_seq != chunk_->seq() ||
218 handle.chunk_index != chunk_index_) { 218 handle.chunk_index != chunk_index_) {
219 return nullptr; 219 return nullptr;
220 } 220 }
221 221
222 return chunk_->GetEventAt(handle.event_index); 222 return chunk_->GetEventAt(handle.event_index);
223 } 223 }
224 224
225 int generation() const { return generation_; } 225 int generation() const { return generation_; }
226 size_t chunk_index() { return chunk_index_; }
226 227
227 private: 228 private:
228 // MessageLoop::DestructionObserver 229 // MessageLoop::DestructionObserver
229 void WillDestroyCurrentMessageLoop() override; 230 void WillDestroyCurrentMessageLoop() override;
230 231
231 // MemoryDumpProvider implementation. 232 // MemoryDumpProvider implementation.
232 bool OnMemoryDump(const MemoryDumpArgs& args, 233 bool OnMemoryDump(const MemoryDumpArgs& args,
233 ProcessMemoryDump* pmd) override; 234 ProcessMemoryDump* pmd) override;
234 235
235 void FlushWhileLocked(); 236 void FlushWhileLocked();
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 if (*category_group_enabled & ENABLED_FOR_RECORDING) { 1248 if (*category_group_enabled & ENABLED_FOR_RECORDING) {
1248 OptionalAutoLock lock(&lock_); 1249 OptionalAutoLock lock(&lock_);
1249 1250
1250 TraceEvent* trace_event = NULL; 1251 TraceEvent* trace_event = NULL;
1251 if (thread_local_event_buffer) { 1252 if (thread_local_event_buffer) {
1252 trace_event = thread_local_event_buffer->AddTraceEvent(&handle); 1253 trace_event = thread_local_event_buffer->AddTraceEvent(&handle);
1253 } else { 1254 } else {
1254 lock.EnsureAcquired(); 1255 lock.EnsureAcquired();
1255 trace_event = AddEventToThreadSharedChunkWhileLocked(&handle, true); 1256 trace_event = AddEventToThreadSharedChunkWhileLocked(&handle, true);
1256 } 1257 }
1258 if (strcmp(name, "SequencedWorkerPool::Inner::ThreadLoop") == 0) {
1259 LOG(ERROR) << "ssid adding event SequencedWorkerPool::Inner::ThreadLoop us ing " << (thread_local_event_buffer ? "thread_local " : "thread_shared ") << han dle.chunk_seq << " " << handle.chunk_index << " " << handle.event_index << " " < < name;
1260
1261 LOG(ERROR) << "ssid sshared index " << thread_shared_chunk_index_ << " loc al index " << (thread_local_event_buffer? thread_local_event_buffer->chunk_index () : 0);
1262 }
1257 1263
1258 if (trace_event) { 1264 if (trace_event) {
1259 trace_event->Initialize(thread_id, 1265 trace_event->Initialize(thread_id,
1260 offset_event_timestamp, 1266 offset_event_timestamp,
1261 thread_now, 1267 thread_now,
1262 phase, 1268 phase,
1263 category_group_enabled, 1269 category_group_enabled,
1264 name, 1270 name,
1265 scope, 1271 scope,
1266 id, 1272 id,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 TraceEventETWExport::AddCompleteEndEvent(name); 1435 TraceEventETWExport::AddCompleteEndEvent(name);
1430 #endif // OS_WIN 1436 #endif // OS_WIN
1431 1437
1432 std::string console_message; 1438 std::string console_message;
1433 if (category_group_enabled_local & ENABLED_FOR_RECORDING) { 1439 if (category_group_enabled_local & ENABLED_FOR_RECORDING) {
1434 OptionalAutoLock lock(&lock_); 1440 OptionalAutoLock lock(&lock_);
1435 1441
1436 TraceEvent* trace_event = GetEventByHandleInternal(handle, &lock); 1442 TraceEvent* trace_event = GetEventByHandleInternal(handle, &lock);
1437 if (trace_event) { 1443 if (trace_event) {
1438 DCHECK(trace_event->phase() == TRACE_EVENT_PHASE_COMPLETE); 1444 DCHECK(trace_event->phase() == TRACE_EVENT_PHASE_COMPLETE);
1445 if (trace_event->duration().ToInternalValue() != -1) {
1446 LOG(ERROR) << "ssid got event from " << (thread_local_event_buffer_.Get () ? "thread_local" : "thread_shared");
1447 if (thread_shared_chunk_ && handle.chunk_index == thread_shared_chunk_in dex_)
1448 LOG(ERROR) << "ssid event if not local is from in flight shared chunk with index " << thread_shared_chunk_index_;
1449 else
1450 LOG(ERROR) << "ssid event if not local is from logged_events_";
1451 LOG(ERROR) << "ssid duration set for handle " << handle.chunk_seq << " " << handle.chunk_index << " " << handle.event_index << " " << name;
1452 }
1453 CHECK_EQ(trace_event->name(), name);
1439 trace_event->UpdateDuration(now, thread_now); 1454 trace_event->UpdateDuration(now, thread_now);
1440 #if defined(OS_ANDROID) 1455 #if defined(OS_ANDROID)
1441 trace_event->SendToATrace(); 1456 trace_event->SendToATrace();
1442 #endif 1457 #endif
1443 } 1458 }
1444 1459
1445 if (trace_options() & kInternalEchoToConsole) { 1460 if (trace_options() & kInternalEchoToConsole) {
1446 console_message = 1461 console_message =
1447 EventToConsoleMessage(TRACE_EVENT_PHASE_END, now, trace_event); 1462 EventToConsoleMessage(TRACE_EVENT_PHASE_END, now, trace_event);
1448 } 1463 }
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 } 1751 }
1737 1752
1738 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { 1753 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() {
1739 if (*category_group_enabled_) { 1754 if (*category_group_enabled_) {
1740 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, 1755 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_,
1741 event_handle_); 1756 event_handle_);
1742 } 1757 }
1743 } 1758 }
1744 1759
1745 } // namespace trace_event_internal 1760 } // namespace trace_event_internal
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698