Author: mikhail.naga...@gmail.com
Date: Fri May 29 08:33:02 2009
New Revision: 2082

Modified:
    branches/bleeding_edge/test/cctest/test-log.cc

Log:
Fix wait interval calculation in ProfLazyMode test.

Also, add a small delay to be sure that all ticks are logged prior to  
leaving CheckThatProfilerWorks function.

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


Modified: branches/bleeding_edge/test/cctest/test-log.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-log.cc      (original)
+++ branches/bleeding_edge/test/cctest/test-log.cc      Fri May 29 08:33:02 2009
@@ -166,16 +166,18 @@
                    "for (var i = 0; i < 1000; ++i) { "
                    "(function(x) { return %d * x; })(i); }",
                    log_pos);
-  // Run code for 200 msecs to get some ticks. Use uint to always have
-  // non-negative delta.
-  const uint64_t started_us = i::OS::Ticks();
-  uint64_t delta;
-  while ((delta = i::OS::Ticks() - started_us) < 200 * 1000) {
+  // Run code for 200 msecs to get some ticks.
+  const double end_time = i::OS::TimeCurrentMillis() + 200;
+  while (i::OS::TimeCurrentMillis() < end_time) {
      CompileAndRunScript(script_src.start());
    }

    Logger::PauseProfiler();
    CHECK(!LoggerTestHelper::IsSamplerActive());
+
+  // Wait 50 msecs to allow Profiler thread to process the last
+  // tick sample it has got.
+  i::OS::Sleep(50);

    // Now we must have compiler and tick records.
    int log_size = GetLogLines(log_pos, &buffer);

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to