Check if timeout has expired after processing each sample
authoryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 6 Sep 2013 06:25:06 +0000 (06:25 +0000)
committeryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 6 Sep 2013 06:25:06 +0000 (06:25 +0000)
commit43780dbdc9658c0868db0e4e0cdb306dfc066273
treef4011f1c2d9e530218a5619abd082fed4db907cf
parentd1cfe6c8dd994c758ae55e7c4e30dd27c6dca87e
Check if timeout has expired after processing each sample

To avoid long intervals between taking samples due to processing all accumulated samples at once, the samples are processed one by one and we check if the sampling interval has elapsed after each step rather than after processing all the samples in the queue.

This is a modified version of r16549 whith a fix for test flakiness. The test flakiness introduced by the previous version of this changed was fixed by changing return type of ProfilerEventsProcessor::ProcessOneSample from bool to enum with 3 options. In the main profiling loop we decide that the next code event should be processed when sample with a greater ordinal number is encountered. When processing remaining samples we shouldn't wait for more samples and if the samples queue is empty we just process next code event.

BUG=v8:2814,v8:2871
R=bmeurer@chromium.org, loislo@chromium.org

Review URL: https://codereview.chromium.org/23455036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/cpu-profiler.cc
src/cpu-profiler.h