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

Side by Side Diff: runtime/vm/profiler_service.cc

Issue 1258783005: Fix profiler exclusive code tree node counts (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/profiler_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 // VM & User tags. 1173 // VM & User tags.
1174 current = AppendTags(sample->vm_tag(), sample->user_tag(), current); 1174 current = AppendTags(sample->vm_tag(), sample->user_tag(), current);
1175 1175
1176 // Walk the sampled PCs. 1176 // Walk the sampled PCs.
1177 for (intptr_t j = 0; j < sample->length(); j++) { 1177 for (intptr_t j = 0; j < sample->length(); j++) {
1178 ASSERT(sample->At(j) != 0); 1178 ASSERT(sample->At(j) != 0);
1179 intptr_t index = 1179 intptr_t index =
1180 GetProfileCodeIndex(sample->At(j), sample->timestamp()); 1180 GetProfileCodeIndex(sample->At(j), sample->timestamp());
1181 ASSERT(index >= 0); 1181 ASSERT(index >= 0);
1182 current = current->GetChild(index); 1182 current = current->GetChild(index);
1183
1184 if (j == 0) {
1185 // Executing PC.
1186 if (!sample->first_frame_executing() || vm_tags_emitted()) {
1187 // Only tick if this isn't an exit frame or VM tags are emitted.
1188 current->Tick();
1189 }
1190 } else {
1191 // Caller PCs.
1192 current->Tick();
1193 }
1194
1195 current->Tick(); 1183 current->Tick();
1196 } 1184 }
1197 1185
1198 // Truncated tag. 1186 // Truncated tag.
1199 if (sample->truncated()) { 1187 if (sample->truncated()) {
1200 current = AppendTruncatedTag(current); 1188 current = AppendTruncatedTag(current);
1201 } 1189 }
1202 } 1190 }
1203 } 1191 }
1204 1192
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 ASSERT(sample_buffer != NULL); 2089 ASSERT(sample_buffer != NULL);
2102 2090
2103 ClearProfileVisitor clear_profile(isolate); 2091 ClearProfileVisitor clear_profile(isolate);
2104 sample_buffer->VisitSamples(&clear_profile); 2092 sample_buffer->VisitSamples(&clear_profile);
2105 2093
2106 // Enable profile interrupts. 2094 // Enable profile interrupts.
2107 Profiler::BeginExecution(isolate); 2095 Profiler::BeginExecution(isolate);
2108 } 2096 }
2109 2097
2110 } // namespace dart 2098 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698