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