Revision: 5763
Author: [email protected]
Date: Wed Nov  3 11:33:57 2010
Log: Investigate usleep failure on Linux. Add more debug output.

BUG=crbug.com/54592
TEST=none

Review URL: http://codereview.chromium.org/4391001
http://code.google.com/p/v8/source/detail?r=5763

Modified:
 /branches/bleeding_edge/src/platform-linux.cc

=======================================
--- /branches/bleeding_edge/src/platform-linux.cc       Tue Nov  2 01:26:33 2010
+++ /branches/bleeding_edge/src/platform-linux.cc       Wed Nov  3 11:33:57 2010
@@ -828,8 +828,17 @@
       syscall(SYS_tgkill, vm_tgid_, vm_tid_, SIGPROF);
       // Convert ms to us and subtract 100 us to compensate delays
       // occuring during signal delivery.
-      int result = usleep(sampler_->interval_ * 1000 - 100);
-      ASSERT(result == 0 || errno == EINTR);
+      const useconds_t interval = sampler_->interval_ * 1000 - 100;
+      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);
     }
   }
@@ -862,6 +871,7 @@


 Sampler::~Sampler() {
+  ASSERT(!data_->signal_sender_launched_);
   delete data_;
 }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to