Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: base/trace_event/trace_event_impl.cc

Issue 1152553011: Allow binding point to be specified on flow end events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unittests for flow events Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
756 // Instant events also output their scope. 759 // Instant events also output their scope.
757 if (phase_ == TRACE_EVENT_PHASE_INSTANT) { 760 if (phase_ == TRACE_EVENT_PHASE_INSTANT) {
758 char scope = '?'; 761 char scope = '?';
759 switch (flags_ & TRACE_EVENT_FLAG_SCOPE_MASK) { 762 switch (flags_ & TRACE_EVENT_FLAG_SCOPE_MASK) {
760 case TRACE_EVENT_SCOPE_GLOBAL: 763 case TRACE_EVENT_SCOPE_GLOBAL:
761 scope = TRACE_EVENT_SCOPE_NAME_GLOBAL; 764 scope = TRACE_EVENT_SCOPE_NAME_GLOBAL;
762 break; 765 break;
763 766
764 case TRACE_EVENT_SCOPE_PROCESS: 767 case TRACE_EVENT_SCOPE_PROCESS:
765 scope = TRACE_EVENT_SCOPE_NAME_PROCESS; 768 scope = TRACE_EVENT_SCOPE_NAME_PROCESS;
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 } 2362 }
2360 2363
2361 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { 2364 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() {
2362 if (*category_group_enabled_) { 2365 if (*category_group_enabled_) {
2363 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, 2366 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_,
2364 name_, event_handle_); 2367 name_, event_handle_);
2365 } 2368 }
2366 } 2369 }
2367 2370
2368 } // namespace trace_event_internal 2371 } // namespace trace_event_internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698