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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 rtc::CritScope lock(&crit_); | 112 rtc::CritScope lock(&crit_); |
113 trace_events_.swap(events); | 113 trace_events_.swap(events); |
114 } | 114 } |
115 for (const TraceEvent& e : events) { | 115 for (const TraceEvent& e : events) { |
116 fprintf(output_file_, | 116 fprintf(output_file_, |
117 "%s{ \"name\": \"%s\"" | 117 "%s{ \"name\": \"%s\"" |
118 ", \"cat\": \"%s\"" | 118 ", \"cat\": \"%s\"" |
119 ", \"ph\": \"%c\"" | 119 ", \"ph\": \"%c\"" |
120 ", \"ts\": %" PRIu64 | 120 ", \"ts\": %" PRIu64 |
121 ", \"pid\": %d" | 121 ", \"pid\": %d" |
122 ", \"tid\": %d}\n", | 122 #if defined(WEBRTC_WIN) |
| 123 ", \"tid\": %lu" |
| 124 #else |
| 125 ", \"tid\": %d" |
| 126 #endif // defined(WEBRTC_WIN) |
| 127 "}\n", |
123 has_logged_event ? "," : " ", e.name, e.category_enabled, | 128 has_logged_event ? "," : " ", e.name, e.category_enabled, |
124 e.phase, e.timestamp, e.pid, static_cast<int>(e.tid)); | 129 e.phase, e.timestamp, e.pid, e.tid); |
125 has_logged_event = true; | 130 has_logged_event = true; |
126 } | 131 } |
127 if (shutting_down) | 132 if (shutting_down) |
128 break; | 133 break; |
129 } | 134 } |
130 fprintf(output_file_, "]}\n"); | 135 fprintf(output_file_, "]}\n"); |
131 if (output_file_owned_) | 136 if (output_file_owned_) |
132 fclose(output_file_); | 137 fclose(output_file_); |
133 output_file_ = nullptr; | 138 output_file_ = nullptr; |
134 } | 139 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 RTC_DCHECK(old_logger); | 261 RTC_DCHECK(old_logger); |
257 RTC_CHECK(rtc::AtomicOps::CompareAndSwapPtr( | 262 RTC_CHECK(rtc::AtomicOps::CompareAndSwapPtr( |
258 &g_event_logger, old_logger, | 263 &g_event_logger, old_logger, |
259 static_cast<EventLogger*>(nullptr)) == old_logger); | 264 static_cast<EventLogger*>(nullptr)) == old_logger); |
260 delete old_logger; | 265 delete old_logger; |
261 webrtc::SetupEventTracer(nullptr, nullptr); | 266 webrtc::SetupEventTracer(nullptr, nullptr); |
262 } | 267 } |
263 | 268 |
264 } // namespace tracing | 269 } // namespace tracing |
265 } // namespace rtc | 270 } // namespace rtc |
OLD | NEW |