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

Unified Diff: runtime/vm/profiler_win.cc

Issue 85333006: Profiler fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/vm/profiler_macos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_win.cc
diff --git a/runtime/vm/profiler_win.cc b/runtime/vm/profiler_win.cc
index 61aa28bed839af7c12912d308d9eb1f02d969e7b..81aa49838322e1eb669dfe75cf150559b884442f 100644
--- a/runtime/vm/profiler_win.cc
+++ b/runtime/vm/profiler_win.cc
@@ -20,7 +20,9 @@ static void CollectSample(IsolateProfilerData* profiler_data,
uintptr_t stack_lower,
uintptr_t stack_upper) {
uintptr_t sp = stack_lower;
+ ASSERT(profiler_data != NULL);
SampleBuffer* sample_buffer = profiler_data->sample_buffer();
+ ASSERT(sample_buffer != NULL);
Sample* sample = sample_buffer->ReserveSample();
ASSERT(sample != NULL);
sample->timestamp = OS::GetCurrentTimeMicros();
@@ -101,7 +103,11 @@ int64_t ProfilerManager::SampleAndRescheduleIsolates(int64_t current_time) {
Isolate* isolate = isolates_[i];
ScopedMutex isolate_lock(isolate->profiler_data_mutex());
IsolateProfilerData* profiler_data = isolate->profiler_data();
- ASSERT(profiler_data != NULL);
+ if ((profiler_data == NULL) || !profiler_data->CanExpire() ||
+ (profiler_data->sample_buffer() == NULL)) {
+ // Descheduled.
+ continue;
+ }
if (profiler_data->ShouldSample(current_time)) {
SuspendAndSample(isolate, profiler_data);
Reschedule(profiler_data);
« no previous file with comments | « runtime/vm/profiler_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698