| 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 default: | 384 default: |
| 385 NOTREACHED() << "More than one of the ID flags are set"; | 385 NOTREACHED() << "More than one of the ID flags are set"; |
| 386 break; | 386 break; |
| 387 } | 387 } |
| 388 } | 388 } |
| 389 | 389 |
| 390 if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) | 390 if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) |
| 391 StringAppendF(out, ",\"bp\":\"e\""); | 391 StringAppendF(out, ",\"bp\":\"e\""); |
| 392 | 392 |
| 393 if ((flags_ & TRACE_EVENT_FLAG_FLOW_OUT) || | 393 if ((flags_ & TRACE_EVENT_FLAG_FLOW_OUT) || |
| 394 (flags_ & TRACE_EVENT_FLAG_FLOW_IN) || | 394 (flags_ & TRACE_EVENT_FLAG_FLOW_IN)) { |
| 395 phase_ == TRACE_EVENT_PHASE_BIND_IDS) { | |
| 396 StringAppendF(out, ",\"bind_id\":\"0x%" PRIx64 "\"", | 395 StringAppendF(out, ",\"bind_id\":\"0x%" PRIx64 "\"", |
| 397 static_cast<uint64_t>(bind_id_)); | 396 static_cast<uint64_t>(bind_id_)); |
| 398 } | 397 } |
| 399 if (flags_ & TRACE_EVENT_FLAG_FLOW_IN) | 398 if (flags_ & TRACE_EVENT_FLAG_FLOW_IN) |
| 400 StringAppendF(out, ",\"flow_in\":true"); | 399 StringAppendF(out, ",\"flow_in\":true"); |
| 401 if (flags_ & TRACE_EVENT_FLAG_FLOW_OUT) | 400 if (flags_ & TRACE_EVENT_FLAG_FLOW_OUT) |
| 402 StringAppendF(out, ",\"flow_out\":true"); | 401 StringAppendF(out, ",\"flow_out\":true"); |
| 403 | 402 |
| 404 // Instant events also output their scope. | 403 // Instant events also output their scope. |
| 405 if (phase_ == TRACE_EVENT_PHASE_INSTANT) { | 404 if (phase_ == TRACE_EVENT_PHASE_INSTANT) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); | 440 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); |
| 442 | 441 |
| 443 *out << value_as_text; | 442 *out << value_as_text; |
| 444 } | 443 } |
| 445 *out << "}"; | 444 *out << "}"; |
| 446 } | 445 } |
| 447 } | 446 } |
| 448 | 447 |
| 449 } // namespace trace_event | 448 } // namespace trace_event |
| 450 } // namespace base | 449 } // namespace base |
| OLD | NEW |