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

Unified Diff: runtime/vm/profiler_service.cc

Issue 1260753005: Restore first frame tick exception in exclusive trees (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 376da1aee95dffbb56cf3eaa7f769dad1faddc4a..fc6acf98a5cc65483d4cd8373e4b944a639d8eab 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -1195,9 +1195,10 @@ class ProfileBuilder : public ValueObject {
GetProfileCodeIndex(sample->At(frame_index), sample->timestamp());
ASSERT(index >= 0);
current = current->GetChild(index);
- current->Tick();
+ if (ShouldTickNode(sample, frame_index)) {
+ current->Tick();
+ }
}
-
// Truncated tag.
if (sample->truncated()) {
current = AppendTruncatedTag(current);
@@ -1361,6 +1362,15 @@ class ProfileBuilder : public ValueObject {
code_index);
}
+ bool ShouldTickNode(ProcessedSample* sample, intptr_t frame_index) {
+ if (frame_index != 0) {
+ return true;
+ }
+ // Only tick the first frame's node, if we are executing OR
+ // vm tags have been emitted.
+ return IsExecutingFrame(sample, frame_index) || vm_tags_emitted();
+ }
+
ProfileFunctionTrieNode* ProcessFunction(ProfileFunctionTrieNode* current,
intptr_t sample_index,
ProcessedSample* sample,
@@ -1372,8 +1382,10 @@ class ProfileBuilder : public ValueObject {
}
function->AddProfileCode(code_index);
current = current->GetChild(function->table_index());
+ if (ShouldTickNode(sample, frame_index)) {
+ current->Tick();
+ }
current->AddCodeObjectIndex(code_index);
- current->Tick();
return current;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698