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

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

Issue 2381083003: The TRACE_LINK_IDS macro (Closed)
Patch Set: Created 4 years, 2 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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698