Index: src/cpu-profiler.cc |
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc |
index 34bebb8eca1bfe8cd220240ff297fa972d8430f4..35fe7888646c0e37adcc5944947d3f15feaeabf4 100644 |
--- a/src/cpu-profiler.cc |
+++ b/src/cpu-profiler.cc |
@@ -363,6 +363,8 @@ void CpuProfiler::SetterCallbackEvent(Name* name, Address entry_point) { |
CpuProfiler::CpuProfiler(Isolate* isolate) |
: isolate_(isolate), |
+ sampling_interval_(TimeDelta::FromMicroseconds( |
+ FLAG_cpu_profiler_sampling_interval)), |
profiles_(new CpuProfilesCollection()), |
next_profile_uid_(1), |
generator_(NULL), |
@@ -376,6 +378,8 @@ CpuProfiler::CpuProfiler(Isolate* isolate, |
ProfileGenerator* test_generator, |
ProfilerEventsProcessor* test_processor) |
: isolate_(isolate), |
+ sampling_interval_(TimeDelta::FromMicroseconds( |
+ FLAG_cpu_profiler_sampling_interval)), |
profiles_(test_profiles), |
next_profile_uid_(1), |
generator_(test_generator), |
@@ -390,6 +394,12 @@ CpuProfiler::~CpuProfiler() { |
} |
+void CpuProfiler::set_sampling_interval(TimeDelta value) { |
+ ASSERT(!is_profiling_); |
+ sampling_interval_ = value; |
+} |
+ |
+ |
void CpuProfiler::ResetProfiles() { |
delete profiles_; |
profiles_ = new CpuProfilesCollection(); |
@@ -418,8 +428,7 @@ void CpuProfiler::StartProcessorIfNotStarted() { |
generator_ = new ProfileGenerator(profiles_); |
Sampler* sampler = logger->sampler(); |
processor_ = new ProfilerEventsProcessor( |
- generator_, sampler, |
- TimeDelta::FromMicroseconds(FLAG_cpu_profiler_sampling_interval)); |
+ generator_, sampler, sampling_interval_); |
is_profiling_ = true; |
// Enumerate stuff we already have in the heap. |
ASSERT(isolate_->heap()->HasBeenSetUp()); |