Chromium Code Reviews| Index: base/trace_event/trace_event_impl.cc |
| diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc |
| index 510cc2ffac6b32add118eb53ed4147b4b70369d9..eb24e918164ece034efc2949f9e9af07a1f04a23 100644 |
| --- a/base/trace_event/trace_event_impl.cc |
| +++ b/base/trace_event/trace_event_impl.cc |
| @@ -358,10 +358,17 @@ void TraceEvent::AppendAsJSON( |
| // If id_ is set, print it out as a hex string so we don't loose any |
| // bits (it might be a 64-bit pointer). |
| - if (flags_ & TRACE_EVENT_FLAG_HAS_ID) { |
| + unsigned int id_flags = flags_ & TRACE_EVENT_FLAG_ID_MASK; |
| + if (id_flags != TRACE_EVENT_FLAG_NONE) { |
| if (scope_ != trace_event_internal::kGlobalScope) |
| StringAppendF(out, ",\"scope\":\"%s\"", scope_); |
| - StringAppendF(out, ",\"id\":\"0x%" PRIx64 "\"", static_cast<uint64_t>(id_)); |
| + std::string id_field_name = "id"; |
| + if (id_flags == TRACE_EVENT_FLAG_HAS_LOCAL_ID) |
| + id_field_name = "local_id"; |
|
Primiano Tucci (use gerrit)
2016/08/31 19:11:22
instead of changing the field name, which feels qu
chiniforooshan
2016/08/31 21:28:45
Done.
Note that this was originally due to Andrey
chiniforooshan
2016/09/02 19:37:37
Nat, Ben, can one of you please tell us your prefe
chiniforooshan
2016/09/09 14:40:37
+petrcermak maybe?
|
| + if (id_flags == TRACE_EVENT_FLAG_HAS_GLOBAL_ID) |
| + id_field_name = "global_id"; |
| + StringAppendF(out, ",\"%s\":\"0x%" PRIx64 "\"", |
| + id_field_name.c_str(), static_cast<uint64_t>(id_)); |
| } |
| if (flags_ & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) |