OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_event_impl.h" | 5 #include "base/trace_event/trace_event_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 if (flags_ & TRACE_EVENT_FLAG_ASYNC_TTS) { | 355 if (flags_ & TRACE_EVENT_FLAG_ASYNC_TTS) { |
356 StringAppendF(out, ", \"use_async_tts\":1"); | 356 StringAppendF(out, ", \"use_async_tts\":1"); |
357 } | 357 } |
358 | 358 |
359 // If id_ is set, print it out as a hex string so we don't loose any | 359 // If id_ is set, print it out as a hex string so we don't loose any |
360 // bits (it might be a 64-bit pointer). | 360 // bits (it might be a 64-bit pointer). |
361 if (flags_ & TRACE_EVENT_FLAG_HAS_ID) { | 361 if (flags_ & TRACE_EVENT_FLAG_HAS_ID) { |
362 if (scope_ != trace_event_internal::kGlobalScope) | 362 if (scope_ != trace_event_internal::kGlobalScope) |
363 StringAppendF(out, ",\"scope\":\"%s\"", scope_); | 363 StringAppendF(out, ",\"scope\":\"%s\"", scope_); |
364 StringAppendF(out, ",\"id\":\"0x%" PRIx64 "\"", static_cast<uint64_t>(id_)); | 364 StringAppendF(out, ",\"id\":\"0x%" PRIx64 "\"", static_cast<uint64_t>(id_)); |
| 365 if (flags_ & TRACE_EVENT_FLAG_ID_IS_GLOBAL) |
| 366 *out += ",\"id_is_global\":true"; |
365 } | 367 } |
366 | 368 |
367 if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) | 369 if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) |
368 StringAppendF(out, ",\"bp\":\"e\""); | 370 StringAppendF(out, ",\"bp\":\"e\""); |
369 | 371 |
370 if ((flags_ & TRACE_EVENT_FLAG_FLOW_OUT) || | 372 if ((flags_ & TRACE_EVENT_FLAG_FLOW_OUT) || |
371 (flags_ & TRACE_EVENT_FLAG_FLOW_IN) || | 373 (flags_ & TRACE_EVENT_FLAG_FLOW_IN) || |
372 phase_ == TRACE_EVENT_PHASE_BIND_IDS) { | 374 phase_ == TRACE_EVENT_PHASE_BIND_IDS) { |
373 StringAppendF(out, ",\"bind_id\":\"0x%" PRIx64 "\"", | 375 StringAppendF(out, ",\"bind_id\":\"0x%" PRIx64 "\"", |
374 static_cast<uint64_t>(bind_id_)); | 376 static_cast<uint64_t>(bind_id_)); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); | 420 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); |
419 | 421 |
420 *out << value_as_text; | 422 *out << value_as_text; |
421 } | 423 } |
422 *out << "}"; | 424 *out << "}"; |
423 } | 425 } |
424 } | 426 } |
425 | 427 |
426 } // namespace trace_event | 428 } // namespace trace_event |
427 } // namespace base | 429 } // namespace base |
OLD | NEW |