OLD | NEW |
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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 } | 1008 } |
1009 | 1009 |
1010 LOG(WARNING) | 1010 LOG(WARNING) |
1011 << "The following threads haven't finished flush in time. " | 1011 << "The following threads haven't finished flush in time. " |
1012 "If this happens stably for some thread, please call " | 1012 "If this happens stably for some thread, please call " |
1013 "TraceLog::GetInstance()->SetCurrentThreadBlocksMessageLoop() from " | 1013 "TraceLog::GetInstance()->SetCurrentThreadBlocksMessageLoop() from " |
1014 "the thread to avoid its trace events from being lost."; | 1014 "the thread to avoid its trace events from being lost."; |
1015 for (hash_set<MessageLoop*>::const_iterator it = | 1015 for (hash_set<MessageLoop*>::const_iterator it = |
1016 thread_message_loops_.begin(); | 1016 thread_message_loops_.begin(); |
1017 it != thread_message_loops_.end(); ++it) { | 1017 it != thread_message_loops_.end(); ++it) { |
1018 LOG(WARNING) << "Thread: " << (*it)->thread_name(); | 1018 LOG(WARNING) << "Thread: " << (*it)->task_runner()->GetThreadName(); |
1019 } | 1019 } |
1020 } | 1020 } |
1021 FinishFlush(generation, discard_events); | 1021 FinishFlush(generation, discard_events); |
1022 } | 1022 } |
1023 | 1023 |
1024 void TraceLog::UseNextTraceBuffer() { | 1024 void TraceLog::UseNextTraceBuffer() { |
1025 logged_events_.reset(CreateTraceBuffer()); | 1025 logged_events_.reset(CreateTraceBuffer()); |
1026 subtle::NoBarrier_AtomicIncrement(&generation_, 1); | 1026 subtle::NoBarrier_AtomicIncrement(&generation_, 1); |
1027 thread_shared_chunk_.reset(); | 1027 thread_shared_chunk_.reset(); |
1028 thread_shared_chunk_index_ = 0; | 1028 thread_shared_chunk_index_ = 0; |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 } | 1744 } |
1745 | 1745 |
1746 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1746 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1747 if (*category_group_enabled_) { | 1747 if (*category_group_enabled_) { |
1748 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1748 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1749 event_handle_); | 1749 event_handle_); |
1750 } | 1750 } |
1751 } | 1751 } |
1752 | 1752 |
1753 } // namespace trace_event_internal | 1753 } // namespace trace_event_internal |
OLD | NEW |