| 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/hash_map.h" | 8 #include "vm/hash_map.h" |
| 9 #include "vm/log.h" | 9 #include "vm/log.h" |
| 10 #include "vm/native_symbol.h" | 10 #include "vm/native_symbol.h" |
| (...skipping 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 } | 2327 } |
| 2328 | 2328 |
| 2329 | 2329 |
| 2330 void Profile::PrintHeaderJSON(JSONObject* obj) { | 2330 void Profile::PrintHeaderJSON(JSONObject* obj) { |
| 2331 obj->AddProperty("samplePeriod", | 2331 obj->AddProperty("samplePeriod", |
| 2332 static_cast<intptr_t>(FLAG_profile_period)); | 2332 static_cast<intptr_t>(FLAG_profile_period)); |
| 2333 obj->AddProperty("stackDepth", | 2333 obj->AddProperty("stackDepth", |
| 2334 static_cast<intptr_t>(FLAG_max_profile_depth)); | 2334 static_cast<intptr_t>(FLAG_max_profile_depth)); |
| 2335 obj->AddProperty("sampleCount", sample_count()); | 2335 obj->AddProperty("sampleCount", sample_count()); |
| 2336 obj->AddProperty("timeSpan", MicrosecondsToSeconds(GetTimeSpan())); | 2336 obj->AddProperty("timeSpan", MicrosecondsToSeconds(GetTimeSpan())); |
| 2337 obj->AddPropertyTimeMicros("timeOriginMicros", min_time()); |
| 2338 obj->AddPropertyTimeMicros("timeExtentMicros", GetTimeSpan()); |
| 2337 } | 2339 } |
| 2338 | 2340 |
| 2339 | 2341 |
| 2340 void Profile::PrintTimelineFrameJSON(JSONObject* frames, | 2342 void Profile::PrintTimelineFrameJSON(JSONObject* frames, |
| 2341 ProfileTrieNode* current, | 2343 ProfileTrieNode* current, |
| 2342 ProfileTrieNode* parent, | 2344 ProfileTrieNode* parent, |
| 2343 intptr_t* next_id) { | 2345 intptr_t* next_id) { |
| 2344 ASSERT(current->frame_id() == -1); | 2346 ASSERT(current->frame_id() == -1); |
| 2345 const intptr_t id = *next_id; | 2347 const intptr_t id = *next_id; |
| 2346 *next_id = id + 1; | 2348 *next_id = id + 1; |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 // Disable thread interrupts while processing the buffer. | 2748 // Disable thread interrupts while processing the buffer. |
| 2747 DisableThreadInterruptsScope dtis(thread); | 2749 DisableThreadInterruptsScope dtis(thread); |
| 2748 | 2750 |
| 2749 ClearProfileVisitor clear_profile(isolate); | 2751 ClearProfileVisitor clear_profile(isolate); |
| 2750 sample_buffer->VisitSamples(&clear_profile); | 2752 sample_buffer->VisitSamples(&clear_profile); |
| 2751 } | 2753 } |
| 2752 | 2754 |
| 2753 #endif // !PRODUCT | 2755 #endif // !PRODUCT |
| 2754 | 2756 |
| 2755 } // namespace dart | 2757 } // namespace dart |
| OLD | NEW |