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

Unified Diff: runtime/vm/profiler_service.cc

Issue 2024223002: Fixes observatory crash for DBC (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 195149f37118ec718daadfbc791ab3e69c524934..cc0f89da871675fe8ff4481d8ffa68781f7d5963 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -1255,7 +1255,9 @@ class ProfileBuilder : public ValueObject {
void Build() {
ScopeTimer sw("ProfileBuilder::Build", FLAG_trace_profiler);
- FilterSamples();
+ if (!FilterSamples()) {
+ return;
+ }
Setup();
BuildCodeTable();
@@ -1297,15 +1299,16 @@ class ProfileBuilder : public ValueObject {
RegisterProfileCodeTag(VMTag::kInlineEndCodeTagId);
}
- void FilterSamples() {
+ bool FilterSamples() {
ScopeTimer sw("ProfileBuilder::FilterSamples", FLAG_trace_profiler);
SampleBuffer* sample_buffer = Profiler::sample_buffer();
if (sample_buffer == NULL) {
- return;
+ return false;
}
samples_ = sample_buffer->BuildProcessedSampleBuffer(filter_);
profile_->samples_ = samples_;
profile_->sample_count_ = samples_->length();
+ return true;
}
void UpdateMinMaxTimes(int64_t timestamp) {
@@ -2518,7 +2521,7 @@ void Profile::PrintTimelineJSON(JSONStream* stream) {
ProfileFunction* Profile::FindFunction(const Function& function) {
- return functions_->Lookup(function);
+ return (functions_ != NULL) ? functions_->Lookup(function) : NULL;
}
« 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