Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(12)

Issue 4000007: Improve sampler resolution on Linux. (Closed)

Created:
9 years, 8 months ago by mnaganov (inactive)
Modified:
9 years, 1 month ago
Reviewers:
Vitaly Repeshko
CC:
v8-dev
Visibility:
Public.

Description

Improve sampler resolution on Linux. Instead of relying on itimer signals from kernel, send them ourselves from a separate thread. This disables an ability to profile multiple VM threads on Linux, but it anyway doesn't work on other platforms, so we need a common solution for it (issue 913 created to track this). Committed: http://code.google.com/p/v8/source/detail?r=5711

Patch Set 1 #

Total comments: 19

Patch Set 2 : comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -44 lines) Patch
M src/platform-linux.cc View 1 6 chunks +49 lines, -42 lines 0 comments Download
M test/cctest/test-log.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
mnaganov (inactive)
9 years, 8 months ago (2010-10-25 16:24:16 UTC) #1
Vitaly Repeshko
http://codereview.chromium.org/4000007/diff/1/2 File src/platform-linux.cc (right): http://codereview.chromium.org/4000007/diff/1/2#newcode801 src/platform-linux.cc:801: vm_thread_pid_(syscall (SYS_gettid)) { Please document that libc doesn't provide ...
9 years, 8 months ago (2010-10-25 16:57:25 UTC) #2
mnaganov (inactive)
BTW, I tested on ARM, it works, too, with sampling rate close to 1ms (1.17) ...
9 years, 8 months ago (2010-10-26 10:01:58 UTC) #3
Vitaly Repeshko
9 years, 8 months ago (2010-10-26 13:40:36 UTC) #4
LGTM

http://codereview.chromium.org/4000007/diff/1/2
File src/platform-linux.cc (right):

http://codereview.chromium.org/4000007/diff/1/2#newcode807
src/platform-linux.cc:807: for ( ; sampler_->IsActive();
usleep(sampler_->interval_ * 1000 - 100)) {
On 2010/10/26 10:01:58, Michail Naganov wrote:
> On 2010/10/25 16:57:25, Vitaly wrote:
> > I think "while" loop is more readable here. Also we should check that usleep
> > returns 0 or EINTR, everything else is a bug.
> 
> Converted to while. But I'm not sure what to do, if usleep fails.

Something like:
int ret = usleep(...);
ASSERT(ret == 0 || ret == EINTR);
USE(ret);  // To avoid release mode warnings.

Powered by Google App Engine
This is Rietveld 408576698