| OLD | NEW |
| 1 // Copyright 2009-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2009-2010 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/profiler/heap-profiler.h" | 5 #include "src/profiler/heap-profiler.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/profiler/allocation-tracker.h" | 9 #include "src/profiler/allocation-tracker.h" |
| 10 #include "src/profiler/heap-snapshot-generator-inl.h" | 10 #include "src/profiler/heap-snapshot-generator-inl.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 ids_->RemoveDeadEntries(); | 78 ids_->RemoveDeadEntries(); |
| 79 is_tracking_object_moves_ = true; | 79 is_tracking_object_moves_ = true; |
| 80 | 80 |
| 81 heap()->isolate()->debug()->feature_tracker()->Track( | 81 heap()->isolate()->debug()->feature_tracker()->Track( |
| 82 DebugFeatureTracker::kHeapSnapshot); | 82 DebugFeatureTracker::kHeapSnapshot); |
| 83 | 83 |
| 84 return result; | 84 return result; |
| 85 } | 85 } |
| 86 | 86 |
| 87 | 87 bool HeapProfiler::StartSamplingHeapProfiler( |
| 88 bool HeapProfiler::StartSamplingHeapProfiler(uint64_t sample_interval, | 88 uint64_t sample_interval, int stack_depth, |
| 89 int stack_depth) { | 89 v8::HeapProfiler::SamplingFlags flags) { |
| 90 if (sampling_heap_profiler_.get()) { | 90 if (sampling_heap_profiler_.get()) { |
| 91 return false; | 91 return false; |
| 92 } | 92 } |
| 93 sampling_heap_profiler_.Reset(new SamplingHeapProfiler( | 93 sampling_heap_profiler_.Reset(new SamplingHeapProfiler( |
| 94 heap(), names_.get(), sample_interval, stack_depth)); | 94 heap(), names_.get(), sample_interval, stack_depth, flags)); |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 | 98 |
| 99 void HeapProfiler::StopSamplingHeapProfiler() { | 99 void HeapProfiler::StopSamplingHeapProfiler() { |
| 100 sampling_heap_profiler_.Reset(nullptr); | 100 sampling_heap_profiler_.Reset(nullptr); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 v8::AllocationProfile* HeapProfiler::GetAllocationProfile() { | 104 v8::AllocationProfile* HeapProfiler::GetAllocationProfile() { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 ids_.Reset(new HeapObjectsMap(heap())); | 217 ids_.Reset(new HeapObjectsMap(heap())); |
| 218 if (!is_tracking_allocations()) is_tracking_object_moves_ = false; | 218 if (!is_tracking_allocations()) is_tracking_object_moves_ = false; |
| 219 } | 219 } |
| 220 | 220 |
| 221 | 221 |
| 222 Heap* HeapProfiler::heap() const { return ids_->heap(); } | 222 Heap* HeapProfiler::heap() const { return ids_->heap(); } |
| 223 | 223 |
| 224 | 224 |
| 225 } // namespace internal | 225 } // namespace internal |
| 226 } // namespace v8 | 226 } // namespace v8 |
| OLD | NEW |