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

Unified Diff: runtime/vm/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/vm/timeline.h ('k') | runtime/vm/timeline_analysis.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timeline.cc
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index 3317acc868c4c27b9eeaac544fc3d0260f706b93..8ab8cb53f934088bc592d42ae5b43abdd237cc98 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -100,7 +100,6 @@ DEFINE_FLAG(charp,
// |TimelineEventRecorder::lock_|
//
-
static TimelineEventRecorder* CreateTimelineRecorder() {
// Some flags require that we use the endless recorder.
const bool use_endless_recorder =
@@ -150,7 +149,6 @@ static TimelineEventRecorder* CreateTimelineRecorder() {
return new TimelineEventRingRecorder();
}
-
// Returns a caller freed array of stream names in FLAG_timeline_streams.
static MallocGrowableArray<char*>* GetEnabledByDefaultTimelineStreams() {
MallocGrowableArray<char*>* result = new MallocGrowableArray<char*>();
@@ -170,7 +168,6 @@ static MallocGrowableArray<char*>* GetEnabledByDefaultTimelineStreams() {
return result;
}
-
// Frees the result of |GetEnabledByDefaultTimelineStreams|.
static void FreeEnabledByDefaultTimelineStreams(
MallocGrowableArray<char*>* streams) {
@@ -183,7 +180,6 @@ static void FreeEnabledByDefaultTimelineStreams(
delete streams;
}
-
// Returns true if |streams| contains |stream| or "all". Not case sensitive.
static bool HasStream(MallocGrowableArray<char*>* streams, const char* stream) {
if ((FLAG_timeline_dir != NULL) || FLAG_timing || FLAG_complete_timeline ||
@@ -200,7 +196,6 @@ static bool HasStream(MallocGrowableArray<char*>* streams, const char* stream) {
return false;
}
-
void Timeline::InitOnce() {
ASSERT(recorder_ == NULL);
recorder_ = CreateTimelineRecorder();
@@ -218,7 +213,6 @@ void Timeline::InitOnce() {
}
}
-
void Timeline::StreamStateChange(const char* stream_name,
bool prev,
bool curr) {
@@ -234,7 +228,6 @@ void Timeline::StreamStateChange(const char* stream_name,
}
}
-
void Timeline::Shutdown() {
ASSERT(recorder_ != NULL);
@@ -260,12 +253,10 @@ void Timeline::Shutdown() {
}
}
-
TimelineEventRecorder* Timeline::recorder() {
return recorder_;
}
-
void Timeline::ReclaimCachedBlocksFromThreads() {
TimelineEventRecorder* recorder = Timeline::recorder();
if (recorder == NULL) {
@@ -287,7 +278,6 @@ void Timeline::ReclaimCachedBlocksFromThreads() {
}
}
-
void Timeline::PrintFlagsToJSON(JSONStream* js) {
JSONObject obj(js);
obj.AddProperty("type", "TimelineFlags");
@@ -314,7 +304,6 @@ void Timeline::PrintFlagsToJSON(JSONStream* js) {
}
}
-
void Timeline::Clear() {
TimelineEventRecorder* recorder = Timeline::recorder();
if (recorder == NULL) {
@@ -324,7 +313,6 @@ void Timeline::Clear() {
recorder->Clear();
}
-
TimelineEventRecorder* Timeline::recorder_ = NULL;
MallocGrowableArray<char*>* Timeline::enabled_streams_ = NULL;
Dart_EmbedderTimelineStartRecording Timeline::start_recording_cb_ = NULL;
@@ -348,12 +336,10 @@ TimelineEvent::TimelineEvent()
thread_(OSThread::kInvalidThreadId),
isolate_id_(ILLEGAL_PORT) {}
-
TimelineEvent::~TimelineEvent() {
Reset();
}
-
void TimelineEvent::Reset() {
if (owns_label() && label_ != NULL) {
free(const_cast<char*>(label_));
@@ -369,7 +355,6 @@ void TimelineEvent::Reset() {
set_owns_label(false);
}
-
void TimelineEvent::AsyncBegin(const char* label,
int64_t async_id,
int64_t micros) {
@@ -379,7 +364,6 @@ void TimelineEvent::AsyncBegin(const char* label,
set_timestamp1(async_id);
}
-
void TimelineEvent::AsyncInstant(const char* label,
int64_t async_id,
int64_t micros) {
@@ -389,7 +373,6 @@ void TimelineEvent::AsyncInstant(const char* label,
set_timestamp1(async_id);
}
-
void TimelineEvent::AsyncEnd(const char* label,
int64_t async_id,
int64_t micros) {
@@ -399,7 +382,6 @@ void TimelineEvent::AsyncEnd(const char* label,
set_timestamp1(async_id);
}
-
void TimelineEvent::DurationBegin(const char* label,
int64_t micros,
int64_t thread_micros) {
@@ -408,20 +390,17 @@ void TimelineEvent::DurationBegin(const char* label,
set_thread_timestamp0(thread_micros);
}
-
void TimelineEvent::DurationEnd(int64_t micros, int64_t thread_micros) {
ASSERT(timestamp1_ == 0);
set_timestamp1(micros);
set_thread_timestamp1(thread_micros);
}
-
void TimelineEvent::Instant(const char* label, int64_t micros) {
Init(kInstant, label);
set_timestamp0(micros);
}
-
void TimelineEvent::Duration(const char* label,
int64_t start_micros,
int64_t end_micros,
@@ -434,7 +413,6 @@ void TimelineEvent::Duration(const char* label,
set_thread_timestamp1(thread_end_micros);
}
-
void TimelineEvent::Begin(const char* label,
int64_t micros,
int64_t thread_micros) {
@@ -443,7 +421,6 @@ void TimelineEvent::Begin(const char* label,
set_thread_timestamp0(thread_micros);
}
-
void TimelineEvent::End(const char* label,
int64_t micros,
int64_t thread_micros) {
@@ -452,19 +429,16 @@ void TimelineEvent::End(const char* label,
set_thread_timestamp0(thread_micros);
}
-
void TimelineEvent::Counter(const char* label, int64_t micros) {
Init(kCounter, label);
set_timestamp0(micros);
}
-
void TimelineEvent::Metadata(const char* label, int64_t micros) {
Init(kMetadata, label);
set_timestamp0(micros);
}
-
void TimelineEvent::CompleteWithPreSerializedJSON(const char* json) {
set_pre_serialized_json(true);
SetNumArguments(1);
@@ -472,7 +446,6 @@ void TimelineEvent::CompleteWithPreSerializedJSON(const char* json) {
Complete();
}
-
void TimelineEvent::SetNumArguments(intptr_t length) {
// Cannot call this twice.
ASSERT(arguments_ == NULL);
@@ -485,7 +458,6 @@ void TimelineEvent::SetNumArguments(intptr_t length) {
calloc(sizeof(TimelineEventArgument), length));
}
-
void TimelineEvent::SetArgument(intptr_t i, const char* name, char* argument) {
ASSERT(i >= 0);
ASSERT(i < arguments_length_);
@@ -493,7 +465,6 @@ void TimelineEvent::SetArgument(intptr_t i, const char* name, char* argument) {
arguments_[i].value = argument;
}
-
void TimelineEvent::FormatArgument(intptr_t i,
const char* name,
const char* fmt,
@@ -514,23 +485,19 @@ void TimelineEvent::FormatArgument(intptr_t i,
SetArgument(i, name, buffer);
}
-
void TimelineEvent::CopyArgument(intptr_t i,
const char* name,
const char* argument) {
SetArgument(i, name, strdup(argument));
}
-
void TimelineEvent::StealArguments(intptr_t arguments_length,
TimelineEventArgument* arguments) {
arguments_length_ = arguments_length;
arguments_ = arguments;
}
-
#if defined(HOST_OS_FUCHSIA)
-
// TODO(zra): The functions below emit Dart's timeline events all as category
// "dart". Instead, we could have finer-grained categories that make use of
// the name of the timeline stream, e.g. "VM", "GC", etc.
@@ -583,7 +550,6 @@ FUCHSIA_EVENT_ARGS_LIST(EMIT_FUCHSIA_EVENT)
FUCHSIA_EVENT_ID_ARGS_LIST(EMIT_FUCHSIA_EVENT)
#undef EMIT_FUCHSIA_EVENT
-
void TimelineEvent::EmitFuchsiaEvent() {
switch (event_type()) {
case kBegin:
@@ -616,7 +582,6 @@ void TimelineEvent::EmitFuchsiaEvent() {
}
#endif
-
intptr_t TimelineEvent::PrintSystrace(char* buffer, intptr_t buffer_size) {
ASSERT(buffer != NULL);
ASSERT(buffer_size > 0);
@@ -644,7 +609,6 @@ intptr_t TimelineEvent::PrintSystrace(char* buffer, intptr_t buffer_size) {
return length;
}
-
void TimelineEvent::Complete() {
TimelineEventRecorder* recorder = Timeline::recorder();
if (recorder != NULL) {
@@ -652,7 +616,6 @@ void TimelineEvent::Complete() {
}
}
-
void TimelineEvent::FreeArguments() {
if (arguments_ == NULL) {
return;
@@ -665,7 +628,6 @@ void TimelineEvent::FreeArguments() {
arguments_length_ = 0;
}
-
void TimelineEvent::StreamInit(TimelineStream* stream) {
if (stream != NULL) {
category_ = stream->name();
@@ -674,7 +636,6 @@ void TimelineEvent::StreamInit(TimelineStream* stream) {
}
}
-
void TimelineEvent::Init(EventType event_type, const char* label) {
ASSERT(label != NULL);
state_ = 0;
@@ -698,7 +659,6 @@ void TimelineEvent::Init(EventType event_type, const char* label) {
set_owns_label(false);
}
-
bool TimelineEvent::Within(int64_t time_origin_micros,
int64_t time_extent_micros) {
if ((time_origin_micros == -1) || (time_extent_micros == -1)) {
@@ -720,7 +680,6 @@ bool TimelineEvent::Within(int64_t time_origin_micros,
return (delta >= 0) && (delta <= time_extent_micros);
}
-
const char* TimelineEvent::GetSerializedJSON() const {
ASSERT(pre_serialized_json());
ASSERT(arguments_length_ == 1);
@@ -728,7 +687,6 @@ const char* TimelineEvent::GetSerializedJSON() const {
return arguments_[0].value;
}
-
void TimelineEvent::PrintJSON(JSONStream* stream) const {
if (!FLAG_support_service) {
return;
@@ -803,22 +761,18 @@ void TimelineEvent::PrintJSON(JSONStream* stream) const {
}
}
-
int64_t TimelineEvent::TimeOrigin() const {
return timestamp0_;
}
-
int64_t TimelineEvent::AsyncId() const {
return timestamp1_;
}
-
int64_t TimelineEvent::LowTime() const {
return timestamp0_;
}
-
int64_t TimelineEvent::HighTime() const {
if (event_type() == kDuration) {
return timestamp1_;
@@ -827,7 +781,6 @@ int64_t TimelineEvent::HighTime() const {
}
}
-
int64_t TimelineEvent::TimeDuration() const {
if (timestamp1_ == 0) {
// This duration is still open, use current time as end.
@@ -836,18 +789,15 @@ int64_t TimelineEvent::TimeDuration() const {
return timestamp1_ - timestamp0_;
}
-
bool TimelineEvent::HasThreadCPUTime() const {
return (thread_timestamp0_ != -1);
}
-
int64_t TimelineEvent::ThreadCPUTimeOrigin() const {
ASSERT(HasThreadCPUTime());
return thread_timestamp0_;
}
-
int64_t TimelineEvent::ThreadCPUTimeDuration() const {
ASSERT(HasThreadCPUTime());
if (thread_timestamp1_ == -1) {
@@ -857,16 +807,13 @@ int64_t TimelineEvent::ThreadCPUTimeDuration() const {
return thread_timestamp1_ - thread_timestamp0_;
}
-
TimelineStream::TimelineStream() : name_(NULL), enabled_(false) {}
-
void TimelineStream::Init(const char* name, bool enabled) {
name_ = name;
enabled_ = enabled;
}
-
TimelineEvent* TimelineStream::StartEvent() {
TimelineEventRecorder* recorder = Timeline::recorder();
if (!enabled() || (recorder == NULL)) {
@@ -880,7 +827,6 @@ TimelineEvent* TimelineStream::StartEvent() {
return event;
}
-
TimelineEventScope::TimelineEventScope(TimelineStream* stream,
const char* label)
: StackResource(reinterpret_cast<Thread*>(NULL)),
@@ -892,7 +838,6 @@ TimelineEventScope::TimelineEventScope(TimelineStream* stream,
Init();
}
-
TimelineEventScope::TimelineEventScope(Thread* thread,
TimelineStream* stream,
const char* label)
@@ -905,12 +850,10 @@ TimelineEventScope::TimelineEventScope(Thread* thread,
Init();
}
-
TimelineEventScope::~TimelineEventScope() {
FreeArguments();
}
-
void TimelineEventScope::Init() {
ASSERT(enabled_ == false);
ASSERT(label_ != NULL);
@@ -922,7 +865,6 @@ void TimelineEventScope::Init() {
enabled_ = true;
}
-
void TimelineEventScope::SetNumArguments(intptr_t length) {
if (!enabled()) {
return;
@@ -937,7 +879,6 @@ void TimelineEventScope::SetNumArguments(intptr_t length) {
calloc(sizeof(TimelineEventArgument), length));
}
-
// |name| must be a compile time constant. Takes ownership of |argumentp|.
void TimelineEventScope::SetArgument(intptr_t i,
const char* name,
@@ -951,7 +892,6 @@ void TimelineEventScope::SetArgument(intptr_t i,
arguments_[i].value = argument;
}
-
// |name| must be a compile time constant. Copies |argument|.
void TimelineEventScope::CopyArgument(intptr_t i,
const char* name,
@@ -962,7 +902,6 @@ void TimelineEventScope::CopyArgument(intptr_t i,
SetArgument(i, name, strdup(argument));
}
-
void TimelineEventScope::FormatArgument(intptr_t i,
const char* name,
const char* fmt,
@@ -984,7 +923,6 @@ void TimelineEventScope::FormatArgument(intptr_t i,
SetArgument(i, name, buffer);
}
-
void TimelineEventScope::FreeArguments() {
if (arguments_ == NULL) {
return;
@@ -997,7 +935,6 @@ void TimelineEventScope::FreeArguments() {
arguments_length_ = 0;
}
-
void TimelineEventScope::StealArguments(TimelineEvent* event) {
if (event == NULL) {
return;
@@ -1007,7 +944,6 @@ void TimelineEventScope::StealArguments(TimelineEvent* event) {
arguments_ = NULL;
}
-
TimelineDurationScope::TimelineDurationScope(TimelineStream* stream,
const char* label)
: TimelineEventScope(stream, label) {
@@ -1022,7 +958,6 @@ TimelineDurationScope::TimelineDurationScope(TimelineStream* stream,
#endif
}
-
TimelineDurationScope::TimelineDurationScope(Thread* thread,
TimelineStream* stream,
const char* label)
@@ -1038,7 +973,6 @@ TimelineDurationScope::TimelineDurationScope(Thread* thread,
#endif
}
-
TimelineDurationScope::~TimelineDurationScope() {
if (!FLAG_support_timeline) {
return;
@@ -1063,7 +997,6 @@ TimelineDurationScope::~TimelineDurationScope() {
#endif
}
-
TimelineBeginEndScope::TimelineBeginEndScope(TimelineStream* stream,
const char* label)
: TimelineEventScope(stream, label) {
@@ -1073,7 +1006,6 @@ TimelineBeginEndScope::TimelineBeginEndScope(TimelineStream* stream,
EmitBegin();
}
-
TimelineBeginEndScope::TimelineBeginEndScope(Thread* thread,
TimelineStream* stream,
const char* label)
@@ -1084,7 +1016,6 @@ TimelineBeginEndScope::TimelineBeginEndScope(Thread* thread,
EmitBegin();
}
-
TimelineBeginEndScope::~TimelineBeginEndScope() {
if (!FLAG_support_timeline) {
return;
@@ -1092,7 +1023,6 @@ TimelineBeginEndScope::~TimelineBeginEndScope() {
EmitEnd();
}
-
void TimelineBeginEndScope::EmitBegin() {
if (!FLAG_support_timeline) {
return;
@@ -1112,7 +1042,6 @@ void TimelineBeginEndScope::EmitBegin() {
event->Complete();
}
-
void TimelineBeginEndScope::EmitEnd() {
if (!FLAG_support_timeline) {
return;
@@ -1133,7 +1062,6 @@ void TimelineBeginEndScope::EmitEnd() {
event->Complete();
}
-
TimelineEventFilter::TimelineEventFilter(int64_t time_origin_micros,
int64_t time_extent_micros)
: time_origin_micros_(time_origin_micros),
@@ -1142,10 +1070,8 @@ TimelineEventFilter::TimelineEventFilter(int64_t time_origin_micros,
ASSERT(time_extent_micros_ >= -1);
}
-
TimelineEventFilter::~TimelineEventFilter() {}
-
IsolateTimelineEventFilter::IsolateTimelineEventFilter(
Dart_Port isolate_id,
int64_t time_origin_micros,
@@ -1153,11 +1079,9 @@ IsolateTimelineEventFilter::IsolateTimelineEventFilter(
: TimelineEventFilter(time_origin_micros, time_extent_micros),
isolate_id_(isolate_id) {}
-
TimelineEventRecorder::TimelineEventRecorder()
: async_id_(0), time_low_micros_(0), time_high_micros_(0) {}
-
void TimelineEventRecorder::PrintJSONMeta(JSONArray* events) const {
if (!FLAG_support_service) {
return;
@@ -1184,7 +1108,6 @@ void TimelineEventRecorder::PrintJSONMeta(JSONArray* events) const {
}
}
-
TimelineEvent* TimelineEventRecorder::ThreadBlockStartEvent() {
// Grab the current thread.
OSThread* thread = OSThread::Current();
@@ -1233,13 +1156,11 @@ TimelineEvent* TimelineEventRecorder::ThreadBlockStartEvent() {
return NULL;
}
-
void TimelineEventRecorder::ResetTimeTracking() {
time_high_micros_ = 0;
time_low_micros_ = kMaxInt64;
}
-
void TimelineEventRecorder::ReportTime(int64_t micros) {
if (time_high_micros_ < micros) {
time_high_micros_ = micros;
@@ -1249,7 +1170,6 @@ void TimelineEventRecorder::ReportTime(int64_t micros) {
}
}
-
int64_t TimelineEventRecorder::TimeOriginMicros() const {
if (time_high_micros_ == 0) {
return 0;
@@ -1257,7 +1177,6 @@ int64_t TimelineEventRecorder::TimeOriginMicros() const {
return time_low_micros_;
}
-
int64_t TimelineEventRecorder::TimeExtentMicros() const {
if (time_high_micros_ == 0) {
return 0;
@@ -1265,7 +1184,6 @@ int64_t TimelineEventRecorder::TimeExtentMicros() const {
return time_high_micros_ - time_low_micros_;
}
-
void TimelineEventRecorder::ThreadBlockCompleteEvent(TimelineEvent* event) {
if (event == NULL) {
return;
@@ -1285,7 +1203,6 @@ void TimelineEventRecorder::ThreadBlockCompleteEvent(TimelineEvent* event) {
thread_block_lock->Unlock();
}
-
void TimelineEventRecorder::WriteTo(const char* directory) {
if (!FLAG_support_service) {
return;
@@ -1325,7 +1242,6 @@ void TimelineEventRecorder::WriteTo(const char* directory) {
return;
}
-
int64_t TimelineEventRecorder::GetNextAsyncId() {
// TODO(johnmccutchan): Gracefully handle wrap around.
uint32_t next =
@@ -1333,7 +1249,6 @@ int64_t TimelineEventRecorder::GetNextAsyncId() {
return static_cast<int64_t>(next);
}
-
void TimelineEventRecorder::FinishBlock(TimelineEventBlock* block) {
if (block == NULL) {
return;
@@ -1342,13 +1257,11 @@ void TimelineEventRecorder::FinishBlock(TimelineEventBlock* block) {
block->Finish();
}
-
TimelineEventBlock* TimelineEventRecorder::GetNewBlock() {
MutexLocker ml(&lock_);
return GetNewBlockLocked();
}
-
TimelineEventFixedBufferRecorder::TimelineEventFixedBufferRecorder(
intptr_t capacity)
: blocks_(NULL), capacity_(capacity), num_blocks_(0), block_cursor_(0) {
@@ -1368,7 +1281,6 @@ TimelineEventFixedBufferRecorder::TimelineEventFixedBufferRecorder(
}
}
-
TimelineEventFixedBufferRecorder::~TimelineEventFixedBufferRecorder() {
// Delete all blocks.
for (intptr_t i = 0; i < num_blocks_; i++) {
@@ -1378,7 +1290,6 @@ TimelineEventFixedBufferRecorder::~TimelineEventFixedBufferRecorder() {
free(blocks_);
}
-
void TimelineEventFixedBufferRecorder::PrintJSONEvents(
JSONArray* events,
TimelineEventFilter* filter) {
@@ -1411,7 +1322,6 @@ void TimelineEventFixedBufferRecorder::PrintJSONEvents(
}
}
-
void TimelineEventFixedBufferRecorder::PrintJSON(JSONStream* js,
TimelineEventFilter* filter) {
if (!FLAG_support_service) {
@@ -1428,7 +1338,6 @@ void TimelineEventFixedBufferRecorder::PrintJSON(JSONStream* js,
topLevel.AddPropertyTimeMicros("timeExtentMicros", TimeExtentMicros());
}
-
void TimelineEventFixedBufferRecorder::PrintTraceEvent(
JSONStream* js,
TimelineEventFilter* filter) {
@@ -1440,12 +1349,10 @@ void TimelineEventFixedBufferRecorder::PrintTraceEvent(
PrintJSONEvents(&events, filter);
}
-
TimelineEventBlock* TimelineEventFixedBufferRecorder::GetHeadBlockLocked() {
return blocks_[0];
}
-
void TimelineEventFixedBufferRecorder::Clear() {
MutexLocker ml(&lock_);
for (intptr_t i = 0; i < num_blocks_; i++) {
@@ -1454,7 +1361,6 @@ void TimelineEventFixedBufferRecorder::Clear() {
}
}
-
intptr_t TimelineEventFixedBufferRecorder::FindOldestBlockIndex() const {
int64_t earliest_time = kMaxInt64;
intptr_t earliest_index = -1;
@@ -1472,12 +1378,10 @@ intptr_t TimelineEventFixedBufferRecorder::FindOldestBlockIndex() const {
return earliest_index;
}
-
TimelineEvent* TimelineEventFixedBufferRecorder::StartEvent() {
return ThreadBlockStartEvent();
}
-
void TimelineEventFixedBufferRecorder::CompleteEvent(TimelineEvent* event) {
if (event == NULL) {
return;
@@ -1485,7 +1389,6 @@ void TimelineEventFixedBufferRecorder::CompleteEvent(TimelineEvent* event) {
ThreadBlockCompleteEvent(event);
}
-
TimelineEventSystraceRecorder::TimelineEventSystraceRecorder(intptr_t capacity)
: TimelineEventFixedBufferRecorder(capacity), systrace_fd_(-1) {
#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
@@ -1502,7 +1405,6 @@ TimelineEventSystraceRecorder::TimelineEventSystraceRecorder(intptr_t capacity)
#endif
}
-
TimelineEventSystraceRecorder::~TimelineEventSystraceRecorder() {
#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
if (systrace_fd_ >= 0) {
@@ -1511,7 +1413,6 @@ TimelineEventSystraceRecorder::~TimelineEventSystraceRecorder() {
#endif
}
-
TimelineEventBlock* TimelineEventSystraceRecorder::GetNewBlockLocked() {
// TODO(johnmccutchan): This function should only hand out blocks
// which have been marked as finished.
@@ -1524,7 +1425,6 @@ TimelineEventBlock* TimelineEventSystraceRecorder::GetNewBlockLocked() {
return block;
}
-
void TimelineEventSystraceRecorder::CompleteEvent(TimelineEvent* event) {
if (event == NULL) {
return;
@@ -1548,7 +1448,6 @@ void TimelineEventSystraceRecorder::CompleteEvent(TimelineEvent* event) {
ThreadBlockCompleteEvent(event);
}
-
#if defined(HOST_OS_FUCHSIA)
TimelineEventFuchsiaRecorder::TimelineEventFuchsiaRecorder(intptr_t capacity)
: TimelineEventFixedBufferRecorder(capacity) {}
@@ -1566,7 +1465,6 @@ TimelineEventBlock* TimelineEventFuchsiaRecorder::GetNewBlockLocked() {
return block;
}
-
void TimelineEventFuchsiaRecorder::CompleteEvent(TimelineEvent* event) {
if (event == NULL) {
return;
@@ -1576,7 +1474,6 @@ void TimelineEventFuchsiaRecorder::CompleteEvent(TimelineEvent* event) {
}
#endif // defined(HOST_OS_FUCHSIA)
-
TimelineEventBlock* TimelineEventRingRecorder::GetNewBlockLocked() {
// TODO(johnmccutchan): This function should only hand out blocks
// which have been marked as finished.
@@ -1589,7 +1486,6 @@ TimelineEventBlock* TimelineEventRingRecorder::GetNewBlockLocked() {
return block;
}
-
TimelineEventBlock* TimelineEventStartupRecorder::GetNewBlockLocked() {
if (block_cursor_ == num_blocks_) {
return NULL;
@@ -1600,13 +1496,10 @@ TimelineEventBlock* TimelineEventStartupRecorder::GetNewBlockLocked() {
return block;
}
-
TimelineEventCallbackRecorder::TimelineEventCallbackRecorder() {}
-
TimelineEventCallbackRecorder::~TimelineEventCallbackRecorder() {}
-
void TimelineEventCallbackRecorder::PrintJSON(JSONStream* js,
TimelineEventFilter* filter) {
if (!FLAG_support_service) {
@@ -1620,7 +1513,6 @@ void TimelineEventCallbackRecorder::PrintJSON(JSONStream* js,
}
}
-
void TimelineEventCallbackRecorder::PrintTraceEvent(
JSONStream* js,
TimelineEventFilter* filter) {
@@ -1630,19 +1522,16 @@ void TimelineEventCallbackRecorder::PrintTraceEvent(
JSONArray events(js);
}
-
TimelineEvent* TimelineEventCallbackRecorder::StartEvent() {
TimelineEvent* event = new TimelineEvent();
return event;
}
-
void TimelineEventCallbackRecorder::CompleteEvent(TimelineEvent* event) {
OnEvent(event);
delete event;
}
-
TimelineEventEndlessRecorder::TimelineEventEndlessRecorder()
: head_(NULL), block_index_(0) {}
@@ -1673,7 +1562,6 @@ void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js,
topLevel.AddPropertyTimeMicros("timeExtentMicros", TimeExtentMicros());
}
-
void TimelineEventEndlessRecorder::PrintTraceEvent(
JSONStream* js,
TimelineEventFilter* filter) {
@@ -1685,17 +1573,14 @@ void TimelineEventEndlessRecorder::PrintTraceEvent(
PrintJSONEvents(&events, filter);
}
-
TimelineEventBlock* TimelineEventEndlessRecorder::GetHeadBlockLocked() {
return head_;
}
-
TimelineEvent* TimelineEventEndlessRecorder::StartEvent() {
return ThreadBlockStartEvent();
}
-
void TimelineEventEndlessRecorder::CompleteEvent(TimelineEvent* event) {
if (event == NULL) {
return;
@@ -1703,7 +1588,6 @@ void TimelineEventEndlessRecorder::CompleteEvent(TimelineEvent* event) {
ThreadBlockCompleteEvent(event);
}
-
TimelineEventBlock* TimelineEventEndlessRecorder::GetNewBlockLocked() {
TimelineEventBlock* block = new TimelineEventBlock(block_index_++);
block->set_next(head_);
@@ -1720,7 +1604,6 @@ static int TimelineEventBlockCompare(TimelineEventBlock* const* a,
return (*a)->LowerTimeBound() - (*b)->LowerTimeBound();
}
-
void TimelineEventEndlessRecorder::PrintJSONEvents(
JSONArray* events,
TimelineEventFilter* filter) {
@@ -1762,7 +1645,6 @@ void TimelineEventEndlessRecorder::PrintJSONEvents(
}
}
-
void TimelineEventEndlessRecorder::Clear() {
TimelineEventBlock* current = head_;
while (current != NULL) {
@@ -1776,7 +1658,6 @@ void TimelineEventEndlessRecorder::Clear() {
thread->set_timeline_block(NULL);
}
-
TimelineEventBlock::TimelineEventBlock(intptr_t block_index)
: next_(NULL),
length_(0),
@@ -1784,12 +1665,10 @@ TimelineEventBlock::TimelineEventBlock(intptr_t block_index)
thread_id_(OSThread::kInvalidThreadId),
in_use_(false) {}
-
TimelineEventBlock::~TimelineEventBlock() {
Reset();
}
-
void TimelineEventBlock::PrintJSON(JSONStream* js) const {
ASSERT(!in_use());
JSONArray events(js);
@@ -1799,7 +1678,6 @@ void TimelineEventBlock::PrintJSON(JSONStream* js) const {
}
}
-
TimelineEvent* TimelineEventBlock::StartEvent() {
ASSERT(!IsFull());
if (FLAG_trace_timeline) {
@@ -1811,7 +1689,6 @@ TimelineEvent* TimelineEventBlock::StartEvent() {
return &events_[length_++];
}
-
int64_t TimelineEventBlock::LowerTimeBound() const {
if (length_ == 0) {
return kMaxInt64;
@@ -1820,7 +1697,6 @@ int64_t TimelineEventBlock::LowerTimeBound() const {
return events_[0].TimeOrigin();
}
-
bool TimelineEventBlock::CheckBlock() {
if (length() == 0) {
return true;
@@ -1844,7 +1720,6 @@ bool TimelineEventBlock::CheckBlock() {
return true;
}
-
void TimelineEventBlock::Reset() {
for (intptr_t i = 0; i < kBlockSize; i++) {
// Clear any extra data.
@@ -1855,7 +1730,6 @@ void TimelineEventBlock::Reset() {
in_use_ = false;
}
-
void TimelineEventBlock::Open() {
OSThread* os_thread = OSThread::Current();
ASSERT(os_thread != NULL);
@@ -1863,7 +1737,6 @@ void TimelineEventBlock::Open() {
in_use_ = true;
}
-
void TimelineEventBlock::Finish() {
if (FLAG_trace_timeline) {
OS::Print("Finish block %p\n", this);
@@ -1876,19 +1749,16 @@ void TimelineEventBlock::Finish() {
}
}
-
TimelineEventBlockIterator::TimelineEventBlockIterator(
TimelineEventRecorder* recorder)
: current_(NULL), recorder_(NULL) {
Reset(recorder);
}
-
TimelineEventBlockIterator::~TimelineEventBlockIterator() {
Reset(NULL);
}
-
void TimelineEventBlockIterator::Reset(TimelineEventRecorder* recorder) {
// Clear current.
current_ = NULL;
@@ -1906,12 +1776,10 @@ void TimelineEventBlockIterator::Reset(TimelineEventRecorder* recorder) {
current_ = recorder_->GetHeadBlockLocked();
}
-
bool TimelineEventBlockIterator::HasNext() const {
return current_ != NULL;
}
-
TimelineEventBlock* TimelineEventBlockIterator::Next() {
ASSERT(current_ != NULL);
TimelineEventBlock* r = current_;
« no previous file with comments | « runtime/vm/timeline.h ('k') | runtime/vm/timeline_analysis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698