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

Unified Diff: runtime/lib/timeline.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 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 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 18b89e925ad17acc014425f9d32390a7f8575568..ce4b43f6d24e7bd2e70ab4055fb4234b73178d40 100644
--- a/runtime/lib/timeline.cc
+++ b/runtime/lib/timeline.cc
@@ -27,12 +27,10 @@ DEFINE_NATIVE_ENTRY(Timeline_isDartStreamEnabled, 0) {
return Bool::False().raw();
}
-
DEFINE_NATIVE_ENTRY(Timeline_getIsolateNum, 0) {
return Integer::New(static_cast<int64_t>(isolate->main_port()), Heap::kOld);
}
-
DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) {
if (!FLAG_support_timeline) {
return Integer::New(0);
@@ -44,17 +42,14 @@ DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) {
return Integer::New(recorder->GetNextAsyncId());
}
-
DEFINE_NATIVE_ENTRY(Timeline_getTraceClock, 0) {
return Integer::New(OS::GetCurrentMonotonicMicros(), Heap::kNew);
}
-
DEFINE_NATIVE_ENTRY(Timeline_getThreadCpuClock, 0) {
return Integer::New(OS::GetCurrentThreadCPUMicros(), Heap::kNew);
}
-
DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) {
#ifndef PRODUCT
if (!FLAG_support_timeline) {
@@ -89,9 +84,10 @@ DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) {
(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}",
+ 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());
@@ -115,7 +111,6 @@ DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) {
return Object::null();
}
-
DEFINE_NATIVE_ENTRY(Timeline_reportCompleteEvent, 5) {
#ifndef PRODUCT
if (!FLAG_support_timeline) {
@@ -151,18 +146,20 @@ DEFINE_NATIVE_ENTRY(Timeline_reportCompleteEvent, 5) {
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}",
+ 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}",
+ 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());
}
@@ -176,7 +173,6 @@ DEFINE_NATIVE_ENTRY(Timeline_reportCompleteEvent, 5) {
return Object::null();
}
-
DEFINE_NATIVE_ENTRY(Timeline_reportInstantEvent, 4) {
#ifndef PRODUCT
if (!FLAG_support_timeline) {
@@ -203,12 +199,13 @@ 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(),
- args.ToCString());
+ 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());
// json was allocated in the zone and a copy will be stored in event.
« 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