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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // Output async tts marker field if flag is set. | 746 // Output async tts marker field if flag is set. |
747 if (flags_ & TRACE_EVENT_FLAG_ASYNC_TTS) { | 747 if (flags_ & TRACE_EVENT_FLAG_ASYNC_TTS) { |
748 StringAppendF(out, ", \"use_async_tts\":1"); | 748 StringAppendF(out, ", \"use_async_tts\":1"); |
749 } | 749 } |
750 | 750 |
751 // If id_ is set, print it out as a hex string so we don't loose any | 751 // If id_ is set, print it out as a hex string so we don't loose any |
752 // bits (it might be a 64-bit pointer). | 752 // bits (it might be a 64-bit pointer). |
753 if (flags_ & TRACE_EVENT_FLAG_HAS_ID) | 753 if (flags_ & TRACE_EVENT_FLAG_HAS_ID) |
754 StringAppendF(out, ",\"id\":\"0x%" PRIx64 "\"", static_cast<uint64>(id_)); | 754 StringAppendF(out, ",\"id\":\"0x%" PRIx64 "\"", static_cast<uint64>(id_)); |
755 | 755 |
756 if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) | |
757 StringAppendF(out, ",\"bp\":\"e\""); | |
758 | |
759 // Instant events also output their scope. | 756 // Instant events also output their scope. |
760 if (phase_ == TRACE_EVENT_PHASE_INSTANT) { | 757 if (phase_ == TRACE_EVENT_PHASE_INSTANT) { |
761 char scope = '?'; | 758 char scope = '?'; |
762 switch (flags_ & TRACE_EVENT_FLAG_SCOPE_MASK) { | 759 switch (flags_ & TRACE_EVENT_FLAG_SCOPE_MASK) { |
763 case TRACE_EVENT_SCOPE_GLOBAL: | 760 case TRACE_EVENT_SCOPE_GLOBAL: |
764 scope = TRACE_EVENT_SCOPE_NAME_GLOBAL; | 761 scope = TRACE_EVENT_SCOPE_NAME_GLOBAL; |
765 break; | 762 break; |
766 | 763 |
767 case TRACE_EVENT_SCOPE_PROCESS: | 764 case TRACE_EVENT_SCOPE_PROCESS: |
768 scope = TRACE_EVENT_SCOPE_NAME_PROCESS; | 765 scope = TRACE_EVENT_SCOPE_NAME_PROCESS; |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2362 } | 2359 } |
2363 | 2360 |
2364 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 2361 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
2365 if (*category_group_enabled_) { | 2362 if (*category_group_enabled_) { |
2366 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, | 2363 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, |
2367 name_, event_handle_); | 2364 name_, event_handle_); |
2368 } | 2365 } |
2369 } | 2366 } |
2370 | 2367 |
2371 } // namespace trace_event_internal | 2368 } // namespace trace_event_internal |
OLD | NEW |