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

Unified Diff: runtime/lib/timeline.cc

Issue 2468093007: clang-format runtime/lib (Closed)
Patch Set: Created 4 years, 1 month 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 | « runtime/lib/string.cc ('k') | runtime/lib/typed_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/timeline.cc
diff --git a/runtime/lib/timeline.cc b/runtime/lib/timeline.cc
index 300d6e302d9ec9aa4a13beb2fe56bb32b36a07e8..18b89e925ad17acc014425f9d32390a7f8575568 100644
--- a/runtime/lib/timeline.cc
+++ b/runtime/lib/timeline.cc
@@ -85,32 +85,26 @@ DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) {
// Convert phase to a C string and perform a sanity check.
const char* phase_string = phase.ToCString();
ASSERT(phase_string != NULL);
- ASSERT((phase_string[0] == 'n') ||
- (phase_string[0] == 'b') ||
+ ASSERT((phase_string[0] == 'n') || (phase_string[0] == 'b') ||
(phase_string[0] == 'e'));
ASSERT(phase_string[1] == '\0');
- char* json = OS::SCreate(zone,
- "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
- "\"ts\":%" Pd64 ",\"ph\":\"%s\",\"id\":%" Pd64 ", \"args\":%s}",
- name.ToCString(),
- category.ToCString(),
- tid,
- pid,
- start.AsInt64Value(),
- phase_string,
- id.AsInt64Value(),
- args.ToCString());
+ char* json = OS::SCreate(
+ zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+ ","
+ "\"ts\":%" Pd64 ",\"ph\":\"%s\",\"id\":%" Pd64 ", \"args\":%s}",
+ name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
+ phase_string, id.AsInt64Value(), args.ToCString());
switch (phase_string[0]) {
case 'n':
event->AsyncInstant("", id.AsInt64Value(), start.AsInt64Value());
- break;
+ break;
case 'b':
event->AsyncBegin("", id.AsInt64Value(), start.AsInt64Value());
- break;
+ break;
case 'e':
event->AsyncEnd("", id.AsInt64Value(), start.AsInt64Value());
- break;
+ break;
default:
UNREACHABLE();
}
@@ -156,36 +150,25 @@ DEFINE_NATIVE_ENTRY(Timeline_reportCompleteEvent, 5) {
char* json = NULL;
if ((start_cpu.AsInt64Value() != -1) && (end_cpu != -1)) {
- json = OS::SCreate(zone,
- "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
- "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64 ","
- "\"tdur\":%" Pd64 ",\"args\":%s}",
- name.ToCString(),
- category.ToCString(),
- tid,
- pid,
- start.AsInt64Value(),
- duration,
- duration_cpu,
- args.ToCString());
+ json = OS::SCreate(
+ zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+ ","
+ "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64
+ ","
+ "\"tdur\":%" Pd64 ",\"args\":%s}",
+ name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
+ duration, duration_cpu, args.ToCString());
} else {
- json = OS::SCreate(zone,
- "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
- "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64 ",\"args\":%s}",
- name.ToCString(),
- category.ToCString(),
- tid,
- pid,
- start.AsInt64Value(),
- duration,
- args.ToCString());
+ json = OS::SCreate(
+ zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+ ","
+ "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64 ",\"args\":%s}",
+ name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
+ duration, args.ToCString());
}
ASSERT(json != NULL);
- event->Duration("",
- start.AsInt64Value(),
- end,
- start_cpu.AsInt64Value(),
+ event->Duration("", start.AsInt64Value(), end, start_cpu.AsInt64Value(),
end_cpu);
// json was allocated in the zone and a copy will be stored in event.
event->CompleteWithPreSerializedJSON(json);
@@ -220,14 +203,11 @@ DEFINE_NATIVE_ENTRY(Timeline_reportInstantEvent, 4) {
ASSERT(os_thread != NULL);
int64_t tid = OSThread::ThreadIdToIntPtr(os_thread->trace_id());
- char* json = OS::SCreate(zone,
- "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
- "\"ts\":%" Pd64 ",\"ph\":\"I\",\"args\":%s}",
- name.ToCString(),
- category.ToCString(),
- tid,
- pid,
- start.AsInt64Value(),
+ char* json = OS::SCreate(
+ zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+ ","
+ "\"ts\":%" Pd64 ",\"ph\":\"I\",\"args\":%s}",
+ name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
args.ToCString());
event->Instant("", start.AsInt64Value());
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/lib/typed_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698