Chromium Code Reviews| Index: src/platform-linux.cc |
| diff --git a/src/platform-linux.cc b/src/platform-linux.cc |
| index e72d095b0aded82a47a8e71a399544971336cc51..d5b03be441e4c0e00fcbc0688a903567503cee3a 100644 |
| --- a/src/platform-linux.cc |
| +++ b/src/platform-linux.cc |
| @@ -1038,7 +1038,8 @@ class SignalSender : public Thread { |
| explicit SignalSender(int interval) |
| : Thread("SignalSender"), |
| vm_tgid_(getpid()), |
| - interval_(interval) {} |
| + interval_(interval), |
| + tick_count_(0) {} |
| static void InstallSignalHandler() { |
| struct sigaction sa; |
| @@ -1080,6 +1081,14 @@ class SignalSender : public Thread { |
| } |
| } |
| + static void ResetInterval(int interval) { |
| + ScopedLock lock(mutex_); |
| + if (instance_ != NULL) { |
| + instance_->interval_ = interval; |
| + instance_->tick_count_ = 0; |
| + } |
| + } |
| + |
| // Implement Thread::Run(). |
| virtual void Run() { |
| SamplerRegistry::State state; |
| @@ -1098,6 +1107,15 @@ class SignalSender : public Thread { |
| if (!cpu_profiling_enabled) { |
| if (rate_limiter_.SuspendIfNecessary()) continue; |
| } |
| +#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) |
| + // ARM and MIPS CPUs are typically slower than IA32/X64, so for them |
| + // the tick interval is increased to let them perform a more significant |
| + // amount of work between subsequent ticks. |
| + if (tick_count_ == 5) { |
|
danno
2011/12/07 13:21:52
Constants for these?
Jakob Kummerow
2011/12/12 10:02:38
Done.
|
| + interval_ = 5; |
| + } |
| + tick_count_++; |
| +#endif |
| if (cpu_profiling_enabled && runtime_profiler_enabled) { |
| if (!SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this)) { |
| return; |
| @@ -1165,7 +1183,8 @@ class SignalSender : public Thread { |
| } |
| const int vm_tgid_; |
| - const int interval_; |
| + int interval_; |
| + int tick_count_; |
| RuntimeProfilerRateLimiter rate_limiter_; |
| // Protects the process wide state below. |
| @@ -1213,5 +1232,9 @@ void Sampler::Stop() { |
| SetActive(false); |
| } |
| +void Sampler::ResetInterval(int interval) { |
| + SignalSender::ResetInterval(interval); |
| +} |
| + |
| } } // namespace v8::internal |