Chromium Code Reviews| 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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1231 | 1231 |
| 1232 // Walk the sampled PCs. | 1232 // Walk the sampled PCs. |
| 1233 for (intptr_t j = sample->length() - 1; j >= 0; j--) { | 1233 for (intptr_t j = sample->length() - 1; j >= 0; j--) { |
| 1234 ASSERT(sample->At(j) != 0); | 1234 ASSERT(sample->At(j) != 0); |
| 1235 current = ProcessFunctionPC( | 1235 current = ProcessFunctionPC( |
| 1236 sample->At(j), | 1236 sample->At(j), |
| 1237 sample->timestamp(), | 1237 sample->timestamp(), |
| 1238 current, | 1238 current, |
| 1239 i, | 1239 i, |
| 1240 (j == 0), | 1240 (j == 0), |
| 1241 sample->first_frame_executing(), | 1241 sample->first_frame_executing() || (sample->allocation_cid() > 0), |
|
rmacnak
2015/07/14 17:20:29
is_allocation_sample()
Cutch
2015/07/14 20:02:57
Done.
| |
| 1242 true); | 1242 true); |
| 1243 } | 1243 } |
| 1244 } | 1244 } |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 void BuildExclusiveFunctionTrie(ProfileFunctionTrieNode* root) { | 1247 void BuildExclusiveFunctionTrie(ProfileFunctionTrieNode* root) { |
| 1248 ScopeTimer sw("ProfileBuilder::BuildExclusiveFunctionTrie", | 1248 ScopeTimer sw("ProfileBuilder::BuildExclusiveFunctionTrie", |
| 1249 FLAG_trace_profiler); | 1249 FLAG_trace_profiler); |
| 1250 for (intptr_t i = 0; i < samples_->length(); i++) { | 1250 for (intptr_t i = 0; i < samples_->length(); i++) { |
| 1251 ProcessedSample* sample = samples_->At(i); | 1251 ProcessedSample* sample = samples_->At(i); |
| 1252 | 1252 |
| 1253 // Tick the root. | 1253 // Tick the root. |
| 1254 ProfileFunctionTrieNode* current = root; | 1254 ProfileFunctionTrieNode* current = root; |
| 1255 current->Tick(); | 1255 current->Tick(); |
| 1256 | 1256 |
| 1257 // VM & User tags. | 1257 // VM & User tags. |
| 1258 current = AppendTags(sample->vm_tag(), sample->user_tag(), current); | 1258 current = AppendTags(sample->vm_tag(), sample->user_tag(), current); |
| 1259 | 1259 |
| 1260 // Walk the sampled PCs. | 1260 // Walk the sampled PCs. |
| 1261 for (intptr_t j = 0; j < sample->length(); j++) { | 1261 for (intptr_t j = 0; j < sample->length(); j++) { |
| 1262 ASSERT(sample->At(j) != 0); | 1262 ASSERT(sample->At(j) != 0); |
| 1263 current = ProcessFunctionPC( | 1263 current = ProcessFunctionPC( |
| 1264 sample->At(j), | 1264 sample->At(j), |
| 1265 sample->timestamp(), | 1265 sample->timestamp(), |
| 1266 current, | 1266 current, |
| 1267 i, | 1267 i, |
| 1268 (j == 0), | 1268 (j == 0), |
| 1269 sample->first_frame_executing(), | 1269 sample->first_frame_executing() || (sample->allocation_cid() > 0), |
|
rmacnak
2015/07/14 17:20:29
is_allocation_sample()
Cutch
2015/07/14 20:02:57
Done.
| |
| 1270 false); | 1270 false); |
| 1271 } | 1271 } |
| 1272 | 1272 |
| 1273 // Truncated tag. | 1273 // Truncated tag. |
| 1274 if (sample->truncated()) { | 1274 if (sample->truncated()) { |
| 1275 current = AppendTruncatedTag(current); | 1275 current = AppendTruncatedTag(current); |
| 1276 } | 1276 } |
| 1277 } | 1277 } |
| 1278 } | 1278 } |
| 1279 | 1279 |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2020 ASSERT(sample_buffer != NULL); | 2020 ASSERT(sample_buffer != NULL); |
| 2021 | 2021 |
| 2022 ClearProfileVisitor clear_profile(isolate); | 2022 ClearProfileVisitor clear_profile(isolate); |
| 2023 sample_buffer->VisitSamples(&clear_profile); | 2023 sample_buffer->VisitSamples(&clear_profile); |
| 2024 | 2024 |
| 2025 // Enable profile interrupts. | 2025 // Enable profile interrupts. |
| 2026 Profiler::BeginExecution(isolate); | 2026 Profiler::BeginExecution(isolate); |
| 2027 } | 2027 } |
| 2028 | 2028 |
| 2029 } // namespace dart | 2029 } // namespace dart |
| OLD | NEW |