OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #include "webrtc/base/event_tracer.h" | 10 #include "webrtc/base/event_tracer.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 trace_events_.clear(); | 153 trace_events_.clear(); |
154 } | 154 } |
155 // Enable event logging (fast-path). This should be disabled since starting | 155 // Enable event logging (fast-path). This should be disabled since starting |
156 // shouldn't be done twice. | 156 // shouldn't be done twice. |
157 RTC_CHECK_EQ(0, | 157 RTC_CHECK_EQ(0, |
158 rtc::AtomicOps::CompareAndSwap(&g_event_logging_active, 0, 1)); | 158 rtc::AtomicOps::CompareAndSwap(&g_event_logging_active, 0, 1)); |
159 | 159 |
160 // Finally start, everything should be set up now. | 160 // Finally start, everything should be set up now. |
161 logging_thread_.Start(); | 161 logging_thread_.Start(); |
162 TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Start"); | 162 TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Start"); |
| 163 logging_thread_.SetPriority(kLowPriority); |
163 } | 164 } |
164 | 165 |
165 void Stop() { | 166 void Stop() { |
166 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 167 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
167 TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Stop"); | 168 TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Stop"); |
168 // Try to stop. Abort if we're not currently logging. | 169 // Try to stop. Abort if we're not currently logging. |
169 if (rtc::AtomicOps::CompareAndSwap(&g_event_logging_active, 1, 0) == 0) | 170 if (rtc::AtomicOps::CompareAndSwap(&g_event_logging_active, 1, 0) == 0) |
170 return; | 171 return; |
171 | 172 |
172 // Wake up logging thread to finish writing. | 173 // Wake up logging thread to finish writing. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 RTC_DCHECK(old_logger); | 266 RTC_DCHECK(old_logger); |
266 RTC_CHECK(rtc::AtomicOps::CompareAndSwapPtr( | 267 RTC_CHECK(rtc::AtomicOps::CompareAndSwapPtr( |
267 &g_event_logger, old_logger, | 268 &g_event_logger, old_logger, |
268 static_cast<EventLogger*>(nullptr)) == old_logger); | 269 static_cast<EventLogger*>(nullptr)) == old_logger); |
269 delete old_logger; | 270 delete old_logger; |
270 webrtc::SetupEventTracer(nullptr, nullptr); | 271 webrtc::SetupEventTracer(nullptr, nullptr); |
271 } | 272 } |
272 | 273 |
273 } // namespace tracing | 274 } // namespace tracing |
274 } // namespace rtc | 275 } // namespace rtc |
OLD | NEW |