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

Unified Diff: runtime/vm/profiler.cc

Issue 1293383010: Revert "More allocation tracing unit tests" (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index c75f1362008c444430ae74f4c5ec4bf06fd66d88..e9ad1ccfa0de04fc67062c904699b5e00d6f3dba 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -965,6 +965,11 @@ void Profiler::RecordAllocation(Isolate* isolate, intptr_t cid) {
const bool exited_dart_code = ExitedDart(isolate);
+ if (!exited_dart_code && !FLAG_profile_vm) {
+ // No Dart frames on stack and we are not profiling the vm.
+ return;
+ }
+
SampleBuffer* sample_buffer = GetSampleBuffer(isolate);
if (sample_buffer == NULL) {
// Profiler not initialized.
@@ -1005,22 +1010,14 @@ void Profiler::RecordAllocation(Isolate* isolate, intptr_t cid) {
fp,
sp);
native_stack_walker.walk();
- } else if (exited_dart_code) {
+ } else {
+ ASSERT(exited_dart_code);
Sample* sample = SetupSample(isolate,
sample_buffer,
OSThread::GetCurrentThreadId());
sample->SetAllocationCid(cid);
ProfilerDartExitStackWalker dart_exit_stack_walker(isolate, sample);
dart_exit_stack_walker.walk();
- } else {
- // Fall back.
- uintptr_t pc = GetProgramCounter();
- Sample* sample = SetupSample(isolate,
- sample_buffer,
- OSThread::GetCurrentThreadId());
- sample->SetAllocationCid(cid);
- sample->set_vm_tag(VMTag::kEmbedderTagId);
- sample->SetAt(0, pc);
}
}
« 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