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

Unified Diff: base/debug/trace_event_impl.cc

Issue 821033002: Tweak tracing JSON output formatting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index 45912865b1511c8b39ee31df8fe6cf5374331106..137cb02b4aa771c75fc94903074b9bd6fdb3ddfe 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -701,13 +701,13 @@ void TraceEvent::AppendAsJSON(std::string* out) const {
// Category group checked at category creation time.
DCHECK(!strchr(name_, '"'));
StringAppendF(out,
- "{\"cat\":\"%s\",\"pid\":%i,\"tid\":%i,\"ts\":%" PRId64 ","
- "\"ph\":\"%c\",\"name\":\"%s\",\"args\":{",
- TraceLog::GetCategoryGroupName(category_group_enabled_),
+ "{\"pid\":%i,\"tid\":%i,\"ts\":%" PRId64 ","
+ "\"ph\":\"%c\",\"cat\":\"%s\",\"name\":\"%s\",\"args\":{",
process_id,
thread_id_,
time_int64,
phase_,
+ TraceLog::GetCategoryGroupName(category_group_enabled_),
name_);
// Output argument names and values, stop at first NULL argument name.
@@ -1760,7 +1760,7 @@ void TraceLog::ConvertTraceEventsToTraceFormat(
}
for (size_t j = 0; j < chunk->size(); ++j) {
if (i > 0 || j > 0)
- json_events_str_ptr->data().append(",");
+ json_events_str_ptr->data().append(",\n");
chunk->GetEventAt(j)->AppendAsJSON(&(json_events_str_ptr->data()));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698