| Index: src/platform-linux.cc
|
| diff --git a/src/platform-linux.cc b/src/platform-linux.cc
|
| index e72d095b0aded82a47a8e71a399544971336cc51..f10728c35fd50b9eb1a73ff6f4780b1d91cc36c7 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,19 @@ 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.
|
| +
|
| + static const int kNumberOfFastTicks = 5;
|
| + static const int kSlowTickIntervalMs = 5;
|
| +
|
| + if (tick_count_ == kNumberOfFastTicks) {
|
| + interval_ = kSlowTickIntervalMs;
|
| + }
|
| + tick_count_++;
|
| +#endif
|
| if (cpu_profiling_enabled && runtime_profiler_enabled) {
|
| if (!SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this)) {
|
| return;
|
| @@ -1165,7 +1187,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 +1236,9 @@ void Sampler::Stop() {
|
| SetActive(false);
|
| }
|
|
|
| +void Sampler::ResetInterval(int interval) {
|
| + SignalSender::ResetInterval(interval);
|
| +}
|
| +
|
|
|
| } } // namespace v8::internal
|
|
|