Investigate usleep failure on Linux. Add more debug output.

BUG=crbug.com/54592
TEST=none

Review URL: http://codereview.chromium.org/4391001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5763 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ce9a7396
...@@ -828,8 +828,17 @@ class Sampler::PlatformData : public Malloced { ...@@ -828,8 +828,17 @@ class Sampler::PlatformData : public Malloced {
syscall(SYS_tgkill, vm_tgid_, vm_tid_, SIGPROF); syscall(SYS_tgkill, vm_tgid_, vm_tid_, SIGPROF);
// Convert ms to us and subtract 100 us to compensate delays // Convert ms to us and subtract 100 us to compensate delays
// occuring during signal delivery. // occuring during signal delivery.
int result = usleep(sampler_->interval_ * 1000 - 100); const useconds_t interval = sampler_->interval_ * 1000 - 100;
ASSERT(result == 0 || errno == EINTR); int result = usleep(interval);
#ifdef DEBUG
if (result != 0 && errno != EINTR) {
fprintf(stderr,
"SignalSender usleep error; interval = %u, errno = %d\n",
interval,
errno);
ASSERT(result == 0 || errno == EINTR);
}
#endif
USE(result); USE(result);
} }
} }
...@@ -862,6 +871,7 @@ Sampler::Sampler(int interval, bool profiling) ...@@ -862,6 +871,7 @@ Sampler::Sampler(int interval, bool profiling)
Sampler::~Sampler() { Sampler::~Sampler() {
ASSERT(!data_->signal_sender_launched_);
delete data_; delete data_;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment