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

Unified Diff: runtime/vm/profiler_service.cc

Issue 2773073003: Revert "Added page to Observatory to display native memory allocation information." (Closed)
Patch Set: Created 3 years, 9 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 | « runtime/vm/profiler_service.h ('k') | runtime/vm/profiler_test.cc » ('j') | 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 c329c8048f7fbbb74de810eddfca9d6dfd89bc71..e750b2c573ed036de4a197b2490653a12a83d956 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -7,7 +7,6 @@
#include "vm/growable_array.h"
#include "vm/hash_map.h"
#include "vm/log.h"
-#include "vm/malloc_hooks.h"
#include "vm/native_symbol.h"
#include "vm/object.h"
#include "vm/os.h"
@@ -864,12 +863,7 @@ class ProfileCodeTable : public ZoneAllocated {
ProfileTrieNode::ProfileTrieNode(intptr_t table_index)
- : table_index_(table_index),
- count_(0),
- exclusive_allocations_(0),
- inclusive_allocations_(0),
- children_(0),
- frame_id_(-1) {
+ : table_index_(table_index), count_(0), children_(0), frame_id_(-1) {
ASSERT(table_index_ >= 0);
}
@@ -877,12 +871,6 @@ ProfileTrieNode::ProfileTrieNode(intptr_t table_index)
ProfileTrieNode::~ProfileTrieNode() {}
-void ProfileTrieNode::Tick(ProcessedSample* sample, bool exclusive) {
- count_++;
- IncrementAllocation(sample->native_allocation_size_bytes(), exclusive);
-}
-
-
void ProfileTrieNode::SortChildren() {
children_.Sort(ProfileTrieNodeCompare);
// Recurse.
@@ -916,10 +904,6 @@ class ProfileCodeTrieNode : public ProfileTrieNode {
// Write number of children.
intptr_t child_count = NumChildren();
array->AddValue(child_count);
- // Write inclusive allocations.
- array->AddValue64(inclusive_allocations_);
- // Write exclusive allocations.
- array->AddValue64(exclusive_allocations_);
// Recurse.
for (intptr_t i = 0; i < child_count; i++) {
children_[i]->PrintToJSONArray(array);
@@ -981,10 +965,6 @@ class ProfileFunctionTrieNode : public ProfileTrieNode {
array->AddValue(table_index());
// Write count.
array->AddValue(count());
- // Write inclusive allocations.
- array->AddValue64(inclusive_allocations_);
- // Write exclusive allocations.
- array->AddValue64(exclusive_allocations_);
// Write number of code objects.
intptr_t code_count = code_objects_.length();
array->AddValue(code_count);
@@ -1343,7 +1323,7 @@ class ProfileBuilder : public ValueObject {
code->Tick(pc, IsExecutingFrame(sample, frame_index), sample_index);
}
- TickExitFrame(sample->vm_tag(), sample_index, sample);
+ TickExitFrame(sample->vm_tag(), sample_index);
}
SanitizeMinMaxTimes();
}
@@ -1429,17 +1409,16 @@ class ProfileBuilder : public ValueObject {
// Tick the root.
ProfileCodeTrieNode* current = root;
- current->Tick(sample);
+ current->Tick();
// VM & User tags.
- current =
- AppendTags(sample->vm_tag(), sample->user_tag(), current, sample);
+ current = AppendTags(sample->vm_tag(), sample->user_tag(), current);
ResetKind();
// Truncated tag.
if (sample->truncated()) {
- current = AppendTruncatedTag(current, sample);
+ current = AppendTruncatedTag(current);
}
// Walk the sampled PCs.
@@ -1454,13 +1433,13 @@ class ProfileBuilder : public ValueObject {
GetProfileCode(sample->At(frame_index), sample->timestamp());
ASSERT(profile_code->code_table_index() == index);
code ^= profile_code->code();
- current = AppendKind(code, current, sample);
+ current = AppendKind(code, current);
current = current->GetChild(index);
- current->Tick(sample, (frame_index == 0));
+ current->Tick();
}
if (!sample->first_frame_executing()) {
- current = AppendExitFrame(sample->vm_tag(), current, sample);
+ current = AppendExitFrame(sample->vm_tag(), current);
}
}
}
@@ -1474,15 +1453,15 @@ class ProfileBuilder : public ValueObject {
// Tick the root.
ProfileCodeTrieNode* current = root;
- current->Tick(sample);
+ current->Tick();
+
// VM & User tags.
- current =
- AppendTags(sample->vm_tag(), sample->user_tag(), current, sample);
+ current = AppendTags(sample->vm_tag(), sample->user_tag(), current);
ResetKind();
if (!sample->first_frame_executing()) {
- current = AppendExitFrame(sample->vm_tag(), current, sample);
+ current = AppendExitFrame(sample->vm_tag(), current);
}
// Walk the sampled PCs.
@@ -1499,13 +1478,13 @@ class ProfileBuilder : public ValueObject {
code ^= profile_code->code();
current = current->GetChild(index);
if (ShouldTickNode(sample, frame_index)) {
- current->Tick(sample, (frame_index == 0));
+ current->Tick();
}
- current = AppendKind(code, current, sample);
+ current = AppendKind(code, current);
}
// Truncated tag.
if (sample->truncated()) {
- current = AppendTruncatedTag(current, sample);
+ current = AppendTruncatedTag(current);
}
}
}
@@ -1536,14 +1515,14 @@ class ProfileBuilder : public ValueObject {
// Tick the root.
ProfileFunctionTrieNode* current = root;
- current->Tick(sample);
+ current->Tick();
+
// VM & User tags.
- current =
- AppendTags(sample->vm_tag(), sample->user_tag(), current, sample);
+ current = AppendTags(sample->vm_tag(), sample->user_tag(), current);
// Truncated tag.
if (sample->truncated()) {
- current = AppendTruncatedTag(current, sample);
+ current = AppendTruncatedTag(current);
}
// Walk the sampled PCs.
@@ -1554,7 +1533,7 @@ class ProfileBuilder : public ValueObject {
}
if (!sample->first_frame_executing()) {
- current = AppendExitFrame(sample->vm_tag(), current, sample);
+ current = AppendExitFrame(sample->vm_tag(), current);
}
sample->set_timeline_trie(current);
@@ -1571,15 +1550,15 @@ class ProfileBuilder : public ValueObject {
// Tick the root.
ProfileFunctionTrieNode* current = root;
- current->Tick(sample);
+ current->Tick();
+
// VM & User tags.
- current =
- AppendTags(sample->vm_tag(), sample->user_tag(), current, sample);
+ current = AppendTags(sample->vm_tag(), sample->user_tag(), current);
ResetKind();
if (!sample->first_frame_executing()) {
- current = AppendExitFrame(sample->vm_tag(), current, sample);
+ current = AppendExitFrame(sample->vm_tag(), current);
}
// Walk the sampled PCs.
@@ -1593,8 +1572,8 @@ class ProfileBuilder : public ValueObject {
// Truncated tag.
if (sample->truncated()) {
- current = AppendTruncatedTag(current, sample);
- InclusiveTickTruncatedTag(sample);
+ current = AppendTruncatedTag(current);
+ InclusiveTickTruncatedTag();
}
}
}
@@ -1632,12 +1611,12 @@ class ProfileBuilder : public ValueObject {
(inlined_functions->length() <= 1)) {
// No inlined functions.
if (inclusive_tree_) {
- current = AppendKind(code, current, sample);
+ current = AppendKind(code, current);
}
current = ProcessFunction(current, sample_index, sample, frame_index,
function, token_position, code_index);
if (!inclusive_tree_) {
- current = AppendKind(code, current, sample);
+ current = AppendKind(code, current);
}
return current;
}
@@ -1652,19 +1631,19 @@ class ProfileBuilder : public ValueObject {
TokenPosition inlined_token_position = (*inlined_token_positions)[i];
const bool inliner = i == 0;
if (inliner) {
- current = AppendKind(code, current, sample);
+ current = AppendKind(code, current);
}
current = ProcessInlinedFunction(current, sample_index, sample,
frame_index, inlined_function,
inlined_token_position, code_index);
if (inliner) {
- current = AppendKind(kInlineStart, current, sample);
+ current = AppendKind(kInlineStart, current);
}
}
- current = AppendKind(kInlineFinish, current, sample);
+ current = AppendKind(kInlineFinish, current);
} else {
// Append the inlined children.
- current = AppendKind(kInlineFinish, current, sample);
+ current = AppendKind(kInlineFinish, current);
for (intptr_t i = inlined_functions->length() - 1; i >= 0; i--) {
const Function* inlined_function = (*inlined_functions)[i];
ASSERT(inlined_function != NULL);
@@ -1672,13 +1651,13 @@ class ProfileBuilder : public ValueObject {
TokenPosition inlined_token_position = (*inlined_token_positions)[i];
const bool inliner = i == 0;
if (inliner) {
- current = AppendKind(kInlineStart, current, sample);
+ current = AppendKind(kInlineStart, current);
}
current = ProcessInlinedFunction(current, sample_index, sample,
frame_index + i, inlined_function,
inlined_token_position, code_index);
if (inliner) {
- current = AppendKind(code, current, sample);
+ current = AppendKind(code, current);
}
}
}
@@ -1733,14 +1712,14 @@ class ProfileBuilder : public ValueObject {
function->AddProfileCode(code_index);
current = current->GetChild(function->table_index());
if (ShouldTickNode(sample, frame_index)) {
- current->Tick(sample, (frame_index == 0));
+ current->Tick();
}
current->AddCodeObjectIndex(code_index);
return current;
}
// Tick the truncated tag's inclusive tick count.
- void InclusiveTickTruncatedTag(ProcessedSample* sample) {
+ void InclusiveTickTruncatedTag() {
ProfileCodeTable* tag_table = profile_->tag_code_;
intptr_t index = tag_table->FindCodeIndexForPC(VMTag::kTruncatedTagId);
ASSERT(index >= 0);
@@ -1757,54 +1736,49 @@ class ProfileBuilder : public ValueObject {
// ProfileCodeTrieNode
ProfileCodeTrieNode* AppendUserTag(uword user_tag,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* current) {
intptr_t user_tag_index = GetProfileCodeTagIndex(user_tag);
if (user_tag_index >= 0) {
current = current->GetChild(user_tag_index);
- current->Tick(sample);
+ current->Tick();
}
return current;
}
- ProfileCodeTrieNode* AppendTruncatedTag(ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* AppendTruncatedTag(ProfileCodeTrieNode* current) {
intptr_t truncated_tag_index =
GetProfileCodeTagIndex(VMTag::kTruncatedTagId);
ASSERT(truncated_tag_index >= 0);
current = current->GetChild(truncated_tag_index);
- current->Tick(sample);
+ current->Tick();
return current;
}
- ProfileCodeTrieNode* AppendVMTag(uword vm_tag,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* AppendVMTag(uword vm_tag, ProfileCodeTrieNode* current) {
if (VMTag::IsNativeEntryTag(vm_tag)) {
// Insert a dummy kNativeTagId node.
intptr_t tag_index = GetProfileCodeTagIndex(VMTag::kNativeTagId);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
} else if (VMTag::IsRuntimeEntryTag(vm_tag)) {
// Insert a dummy kRuntimeTagId node.
intptr_t tag_index = GetProfileCodeTagIndex(VMTag::kRuntimeTagId);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
} else {
intptr_t tag_index = GetProfileCodeTagIndex(vm_tag);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
}
return current;
}
ProfileCodeTrieNode* AppendSpecificNativeRuntimeEntryVMTag(
uword vm_tag,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* current) {
// Only Native and Runtime entries have a second VM tag.
if (!VMTag::IsNativeEntryTag(vm_tag) && !VMTag::IsRuntimeEntryTag(vm_tag)) {
return current;
@@ -1812,7 +1786,7 @@ class ProfileBuilder : public ValueObject {
intptr_t tag_index = GetProfileCodeTagIndex(vm_tag);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
return current;
}
@@ -1837,8 +1811,7 @@ class ProfileBuilder : public ValueObject {
}
ProfileCodeTrieNode* AppendKind(ProfileInfoKind kind,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* current) {
if (!TagsEnabled(ProfilerService::kCodeTransitionTagsBit)) {
// Only emit if debug tags are requested.
return current;
@@ -1848,32 +1821,30 @@ class ProfileBuilder : public ValueObject {
intptr_t tag_index = GetProfileCodeTagIndex(ProfileInfoKindToVMTag(kind));
ASSERT(tag_index >= 0);
current = current->GetChild(tag_index);
- current->Tick(sample);
+ current->Tick();
}
return current;
}
ProfileCodeTrieNode* AppendKind(const Code& code,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* current) {
if (code.IsNull()) {
- return AppendKind(kNone, current, sample);
+ return AppendKind(kNone, current);
} else if (code.is_optimized()) {
- return AppendKind(kOptimized, current, sample);
+ return AppendKind(kOptimized, current);
} else {
- return AppendKind(kUnoptimized, current, sample);
+ return AppendKind(kUnoptimized, current);
}
}
ProfileCodeTrieNode* AppendVMTags(uword vm_tag,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
- current = AppendVMTag(vm_tag, current, sample);
- current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current, sample);
+ ProfileCodeTrieNode* current) {
+ current = AppendVMTag(vm_tag, current);
+ current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current);
return current;
}
- void TickExitFrame(uword vm_tag, intptr_t serial, ProcessedSample* sample) {
+ void TickExitFrame(uword vm_tag, intptr_t serial) {
if (FLAG_profile_vm) {
return;
}
@@ -1902,8 +1873,7 @@ class ProfileBuilder : public ValueObject {
}
ProfileCodeTrieNode* AppendExitFrame(uword vm_tag,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* current) {
if (FLAG_profile_vm) {
return current;
}
@@ -1913,20 +1883,19 @@ class ProfileBuilder : public ValueObject {
}
if (VMTag::IsNativeEntryTag(vm_tag) || VMTag::IsRuntimeEntryTag(vm_tag)) {
- current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current, sample);
+ current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current);
} else {
intptr_t tag_index = GetProfileCodeTagIndex(vm_tag);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
}
return current;
}
ProfileCodeTrieNode* AppendTags(uword vm_tag,
uword user_tag,
- ProfileCodeTrieNode* current,
- ProcessedSample* sample) {
+ ProfileCodeTrieNode* current) {
if (FLAG_profile_vm) {
// None.
if (tag_order() == Profile::kNoTags) {
@@ -1935,37 +1904,36 @@ class ProfileBuilder : public ValueObject {
// User first.
if ((tag_order() == Profile::kUserVM) ||
(tag_order() == Profile::kUser)) {
- current = AppendUserTag(user_tag, current, sample);
+ current = AppendUserTag(user_tag, current);
// Only user.
if (tag_order() == Profile::kUser) {
return current;
}
- return AppendVMTags(vm_tag, current, sample);
+ return AppendVMTags(vm_tag, current);
}
// VM first.
ASSERT((tag_order() == Profile::kVMUser) ||
(tag_order() == Profile::kVM));
- current = AppendVMTags(vm_tag, current, sample);
+ current = AppendVMTags(vm_tag, current);
// Only VM.
if (tag_order() == Profile::kVM) {
return current;
}
- return AppendUserTag(user_tag, current, sample);
+ return AppendUserTag(user_tag, current);
}
if (tag_order() == Profile::kNoTags) {
return current;
}
- return AppendUserTag(user_tag, current, sample);
+ return AppendUserTag(user_tag, current);
}
// ProfileFunctionTrieNode
void ResetKind() { info_kind_ = kNone; }
ProfileFunctionTrieNode* AppendKind(ProfileInfoKind kind,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* current) {
if (!TagsEnabled(ProfilerService::kCodeTransitionTagsBit)) {
// Only emit if debug tags are requested.
return current;
@@ -1976,72 +1944,68 @@ class ProfileBuilder : public ValueObject {
GetProfileFunctionTagIndex(ProfileInfoKindToVMTag(kind));
ASSERT(tag_index >= 0);
current = current->GetChild(tag_index);
- current->Tick(sample);
+ current->Tick();
}
return current;
}
ProfileFunctionTrieNode* AppendKind(const Code& code,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* current) {
if (code.IsNull()) {
- return AppendKind(kNone, current, sample);
+ return AppendKind(kNone, current);
} else if (code.is_optimized()) {
- return AppendKind(kOptimized, current, sample);
+ return AppendKind(kOptimized, current);
} else {
- return AppendKind(kUnoptimized, current, sample);
+ return AppendKind(kUnoptimized, current);
}
}
ProfileFunctionTrieNode* AppendUserTag(uword user_tag,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* current) {
intptr_t user_tag_index = GetProfileFunctionTagIndex(user_tag);
if (user_tag_index >= 0) {
current = current->GetChild(user_tag_index);
- current->Tick(sample);
+ current->Tick();
}
return current;
}
- ProfileFunctionTrieNode* AppendTruncatedTag(ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* AppendTruncatedTag(
+ ProfileFunctionTrieNode* current) {
intptr_t truncated_tag_index =
GetProfileFunctionTagIndex(VMTag::kTruncatedTagId);
ASSERT(truncated_tag_index >= 0);
current = current->GetChild(truncated_tag_index);
- current->Tick(sample);
+ current->Tick();
return current;
}
ProfileFunctionTrieNode* AppendVMTag(uword vm_tag,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* current) {
if (VMTag::IsNativeEntryTag(vm_tag)) {
// Insert a dummy kNativeTagId node.
intptr_t tag_index = GetProfileFunctionTagIndex(VMTag::kNativeTagId);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
} else if (VMTag::IsRuntimeEntryTag(vm_tag)) {
// Insert a dummy kRuntimeTagId node.
intptr_t tag_index = GetProfileFunctionTagIndex(VMTag::kRuntimeTagId);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
} else {
intptr_t tag_index = GetProfileFunctionTagIndex(vm_tag);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
}
return current;
}
ProfileFunctionTrieNode* AppendSpecificNativeRuntimeEntryVMTag(
uword vm_tag,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* current) {
// Only Native and Runtime entries have a second VM tag.
if (!VMTag::IsNativeEntryTag(vm_tag) && !VMTag::IsRuntimeEntryTag(vm_tag)) {
return current;
@@ -2049,21 +2013,19 @@ class ProfileBuilder : public ValueObject {
intptr_t tag_index = GetProfileFunctionTagIndex(vm_tag);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
return current;
}
ProfileFunctionTrieNode* AppendVMTags(uword vm_tag,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
- current = AppendVMTag(vm_tag, current, sample);
- current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current, sample);
+ ProfileFunctionTrieNode* current) {
+ current = AppendVMTag(vm_tag, current);
+ current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current);
return current;
}
ProfileFunctionTrieNode* AppendExitFrame(uword vm_tag,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* current) {
if (FLAG_profile_vm) {
return current;
}
@@ -2072,20 +2034,19 @@ class ProfileBuilder : public ValueObject {
return current;
}
if (VMTag::IsNativeEntryTag(vm_tag) || VMTag::IsRuntimeEntryTag(vm_tag)) {
- current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current, sample);
+ current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current);
} else {
intptr_t tag_index = GetProfileFunctionTagIndex(vm_tag);
current = current->GetChild(tag_index);
// Give the tag a tick.
- current->Tick(sample);
+ current->Tick();
}
return current;
}
ProfileFunctionTrieNode* AppendTags(uword vm_tag,
uword user_tag,
- ProfileFunctionTrieNode* current,
- ProcessedSample* sample) {
+ ProfileFunctionTrieNode* current) {
if (FLAG_profile_vm) {
// None.
if (tag_order() == Profile::kNoTags) {
@@ -2094,29 +2055,29 @@ class ProfileBuilder : public ValueObject {
// User first.
if ((tag_order() == Profile::kUserVM) ||
(tag_order() == Profile::kUser)) {
- current = AppendUserTag(user_tag, current, sample);
+ current = AppendUserTag(user_tag, current);
// Only user.
if (tag_order() == Profile::kUser) {
return current;
}
- return AppendVMTags(vm_tag, current, sample);
+ return AppendVMTags(vm_tag, current);
}
// VM first.
ASSERT((tag_order() == Profile::kVMUser) ||
(tag_order() == Profile::kVM));
- current = AppendVMTags(vm_tag, current, sample);
+ current = AppendVMTags(vm_tag, current);
// Only VM.
if (tag_order() == Profile::kVM) {
return current;
}
- return AppendUserTag(user_tag, current, sample);
+ return AppendUserTag(user_tag, current);
}
if (tag_order() == Profile::kNoTags) {
return current;
}
- return AppendUserTag(user_tag, current, sample);
+ return AppendUserTag(user_tag, current);
}
intptr_t GetProfileCodeTagIndex(uword tag) {
@@ -2599,22 +2560,6 @@ intptr_t ProfileTrieWalker::CurrentExclusiveTicks() {
}
-intptr_t ProfileTrieWalker::CurrentInclusiveAllocations() {
- if (current_ == NULL) {
- return -1;
- }
- return current_->inclusive_allocations();
-}
-
-
-intptr_t ProfileTrieWalker::CurrentExclusiveAllocations() {
- if (current_ == NULL) {
- return -1;
- }
- return current_->exclusive_allocations();
-}
-
-
const char* ProfileTrieWalker::CurrentToken() {
if (current_ == NULL) {
return NULL;
@@ -2780,6 +2725,21 @@ class ClassAllocationSampleFilter : public SampleFilter {
};
+class NativeAllocationSampleFilter : public SampleFilter {
+ public:
+ NativeAllocationSampleFilter(intptr_t thread_task_mask,
+ int64_t time_origin_micros,
+ int64_t time_extent_micros)
+ : SampleFilter(ILLEGAL_PORT,
+ thread_task_mask,
+ time_origin_micros,
+ time_extent_micros) {}
+ bool FilterSample(Sample* sample) {
+ return sample->is_native_allocation_sample();
+ }
+};
+
+
void ProfilerService::PrintAllocationJSON(JSONStream* stream,
Profile::TagOrder tag_order,
const Class& cls,
@@ -2800,7 +2760,11 @@ void ProfilerService::PrintNativeAllocationJSON(JSONStream* stream,
int64_t time_origin_micros,
int64_t time_extent_micros) {
Thread* thread = Thread::Current();
- NativeAllocationSampleFilter filter(time_origin_micros, time_extent_micros);
+ const intptr_t thread_task_mask = Thread::kMutatorTask |
+ Thread::kCompilerTask |
+ Thread::kSweeperTask | Thread::kMarkerTask;
+ NativeAllocationSampleFilter filter(thread_task_mask, time_origin_micros,
+ time_extent_micros);
const bool as_timeline = false;
PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter, as_timeline);
}
« no previous file with comments | « runtime/vm/profiler_service.h ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698