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

Unified Diff: runtime/vm/profiler_service.cc

Issue 1412733008: Switch profiler from isolates to threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 64197073f9373f1d4a39df5e699f7959b845a972..39f863bbc6bfe7177f7875e97ef83a70cfd77520 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -1051,12 +1051,7 @@ class ProfileBuilder : public ValueObject {
void FilterSamples() {
ScopeTimer sw("ProfileBuilder::FilterSamples", FLAG_trace_profiler);
- MutexLocker profiler_data_lock(isolate_->profiler_data_mutex());
- IsolateProfilerData* profiler_data = isolate_->profiler_data();
- if (profiler_data == NULL) {
- return;
- }
- SampleBuffer* sample_buffer = profiler_data->sample_buffer();
+ SampleBuffer* sample_buffer = Profiler::sample_buffer();
if (sample_buffer == NULL) {
return;
}
@@ -2203,13 +2198,10 @@ void ProfilerService::PrintJSONImpl(Thread* thread,
// Disable profile interrupts while processing the buffer.
Profiler::EndExecution(isolate);
- {
- MutexLocker profiler_data_lock(isolate->profiler_data_mutex());
- IsolateProfilerData* profiler_data = isolate->profiler_data();
- if (profiler_data == NULL) {
- stream->PrintError(kFeatureDisabled, NULL);
- return;
- }
+ SampleBuffer* sample_buffer = Profiler::sample_buffer();
+ if (sample_buffer == NULL) {
+ stream->PrintError(kFeatureDisabled, NULL);
+ return;
}
{
@@ -2281,13 +2273,10 @@ void ProfilerService::ClearSamples() {
// Disable profile interrupts while processing the buffer.
Profiler::EndExecution(isolate);
- MutexLocker profiler_data_lock(isolate->profiler_data_mutex());
- IsolateProfilerData* profiler_data = isolate->profiler_data();
- if (profiler_data == NULL) {
+ SampleBuffer* sample_buffer = Profiler::sample_buffer();
+ if (sample_buffer == NULL) {
return;
}
- SampleBuffer* sample_buffer = profiler_data->sample_buffer();
- ASSERT(sample_buffer != NULL);
ClearProfileVisitor clear_profile(isolate);
sample_buffer->VisitSamples(&clear_profile);

Powered by Google App Engine
This is Rietveld 408576698