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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 } | 1031 } |
1032 | 1032 |
1033 LOG(WARNING) | 1033 LOG(WARNING) |
1034 << "The following threads haven't finished flush in time. " | 1034 << "The following threads haven't finished flush in time. " |
1035 "If this happens stably for some thread, please call " | 1035 "If this happens stably for some thread, please call " |
1036 "TraceLog::GetInstance()->SetCurrentThreadBlocksMessageLoop() from " | 1036 "TraceLog::GetInstance()->SetCurrentThreadBlocksMessageLoop() from " |
1037 "the thread to avoid its trace events from being lost."; | 1037 "the thread to avoid its trace events from being lost."; |
1038 for (hash_set<MessageLoop*>::const_iterator it = | 1038 for (hash_set<MessageLoop*>::const_iterator it = |
1039 thread_message_loops_.begin(); | 1039 thread_message_loops_.begin(); |
1040 it != thread_message_loops_.end(); ++it) { | 1040 it != thread_message_loops_.end(); ++it) { |
1041 LOG(WARNING) << "Thread: " << (*it)->thread_name(); | 1041 LOG(WARNING) << "Thread: " << (*it)->GetThreadName(); |
1042 } | 1042 } |
1043 } | 1043 } |
1044 FinishFlush(generation, discard_events); | 1044 FinishFlush(generation, discard_events); |
1045 } | 1045 } |
1046 | 1046 |
1047 void TraceLog::UseNextTraceBuffer() { | 1047 void TraceLog::UseNextTraceBuffer() { |
1048 logged_events_.reset(CreateTraceBuffer()); | 1048 logged_events_.reset(CreateTraceBuffer()); |
1049 subtle::NoBarrier_AtomicIncrement(&generation_, 1); | 1049 subtle::NoBarrier_AtomicIncrement(&generation_, 1); |
1050 thread_shared_chunk_.reset(); | 1050 thread_shared_chunk_.reset(); |
1051 thread_shared_chunk_index_ = 0; | 1051 thread_shared_chunk_index_ = 0; |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 } | 1786 } |
1787 | 1787 |
1788 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1788 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1789 if (*category_group_enabled_) { | 1789 if (*category_group_enabled_) { |
1790 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1790 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1791 event_handle_); | 1791 event_handle_); |
1792 } | 1792 } |
1793 } | 1793 } |
1794 | 1794 |
1795 } // namespace trace_event_internal | 1795 } // namespace trace_event_internal |
OLD | NEW |