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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } | 365 } |
366 | 366 |
367 if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) | 367 if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) |
368 StringAppendF(out, ",\"bp\":\"e\""); | 368 StringAppendF(out, ",\"bp\":\"e\""); |
369 | 369 |
370 if ((flags_ & TRACE_EVENT_FLAG_FLOW_OUT) || | 370 if ((flags_ & TRACE_EVENT_FLAG_FLOW_OUT) || |
371 (flags_ & TRACE_EVENT_FLAG_FLOW_IN)) { | 371 (flags_ & TRACE_EVENT_FLAG_FLOW_IN) || |
| 372 phase_ == TRACE_EVENT_PHASE_BIND_IDS) { |
372 StringAppendF(out, ",\"bind_id\":\"0x%" PRIx64 "\"", | 373 StringAppendF(out, ",\"bind_id\":\"0x%" PRIx64 "\"", |
373 static_cast<uint64_t>(bind_id_)); | 374 static_cast<uint64_t>(bind_id_)); |
374 } | 375 } |
375 if (flags_ & TRACE_EVENT_FLAG_FLOW_IN) | 376 if (flags_ & TRACE_EVENT_FLAG_FLOW_IN) |
376 StringAppendF(out, ",\"flow_in\":true"); | 377 StringAppendF(out, ",\"flow_in\":true"); |
377 if (flags_ & TRACE_EVENT_FLAG_FLOW_OUT) | 378 if (flags_ & TRACE_EVENT_FLAG_FLOW_OUT) |
378 StringAppendF(out, ",\"flow_out\":true"); | 379 StringAppendF(out, ",\"flow_out\":true"); |
379 | 380 |
380 // Instant events also output their scope. | 381 // Instant events also output their scope. |
381 if (phase_ == TRACE_EVENT_PHASE_INSTANT) { | 382 if (phase_ == TRACE_EVENT_PHASE_INSTANT) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); | 418 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); |
418 | 419 |
419 *out << value_as_text; | 420 *out << value_as_text; |
420 } | 421 } |
421 *out << "}"; | 422 *out << "}"; |
422 } | 423 } |
423 } | 424 } |
424 | 425 |
425 } // namespace trace_event | 426 } // namespace trace_event |
426 } // namespace base | 427 } // namespace base |
OLD | NEW |