| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/profiler_service.h" | 5 #include "vm/profiler_service.h" |
| 6 | 6 |
| 7 #include "vm/growable_array.h" | 7 #include "vm/growable_array.h" |
| 8 #include "vm/native_symbol.h" | 8 #include "vm/native_symbol.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 }; | 2159 }; |
| 2160 | 2160 |
| 2161 | 2161 |
| 2162 void ProfilerService::PrintJSON(JSONStream* stream, TagOrder tag_order) { | 2162 void ProfilerService::PrintJSON(JSONStream* stream, TagOrder tag_order) { |
| 2163 Isolate* isolate = Isolate::Current(); | 2163 Isolate* isolate = Isolate::Current(); |
| 2164 // Disable profile interrupts while processing the buffer. | 2164 // Disable profile interrupts while processing the buffer. |
| 2165 Profiler::EndExecution(isolate); | 2165 Profiler::EndExecution(isolate); |
| 2166 MutexLocker profiler_data_lock(isolate->profiler_data_mutex()); | 2166 MutexLocker profiler_data_lock(isolate->profiler_data_mutex()); |
| 2167 IsolateProfilerData* profiler_data = isolate->profiler_data(); | 2167 IsolateProfilerData* profiler_data = isolate->profiler_data(); |
| 2168 if (profiler_data == NULL) { | 2168 if (profiler_data == NULL) { |
| 2169 stream->PrintError(kProfilingDisabled, NULL); | 2169 stream->PrintError(kFeatureDisabled, NULL); |
| 2170 return; | 2170 return; |
| 2171 } | 2171 } |
| 2172 SampleBuffer* sample_buffer = profiler_data->sample_buffer(); | 2172 SampleBuffer* sample_buffer = profiler_data->sample_buffer(); |
| 2173 ASSERT(sample_buffer != NULL); | 2173 ASSERT(sample_buffer != NULL); |
| 2174 ScopeTimer sw("ProfilerService::PrintJSON", FLAG_trace_profiler); | 2174 ScopeTimer sw("ProfilerService::PrintJSON", FLAG_trace_profiler); |
| 2175 { | 2175 { |
| 2176 StackZone zone(isolate); | 2176 StackZone zone(isolate); |
| 2177 HANDLESCOPE(isolate); | 2177 HANDLESCOPE(isolate); |
| 2178 { | 2178 { |
| 2179 // Live code holds Dart, Native, and Collected CodeRegions. | 2179 // Live code holds Dart, Native, and Collected CodeRegions. |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2362 ASSERT(sample_buffer != NULL); | 2362 ASSERT(sample_buffer != NULL); |
| 2363 | 2363 |
| 2364 ClearProfileVisitor clear_profile(isolate); | 2364 ClearProfileVisitor clear_profile(isolate); |
| 2365 sample_buffer->VisitSamples(&clear_profile); | 2365 sample_buffer->VisitSamples(&clear_profile); |
| 2366 | 2366 |
| 2367 // Enable profile interrupts. | 2367 // Enable profile interrupts. |
| 2368 Profiler::BeginExecution(isolate); | 2368 Profiler::BeginExecution(isolate); |
| 2369 } | 2369 } |
| 2370 | 2370 |
| 2371 } // namespace dart | 2371 } // namespace dart |
| OLD | NEW |