New issue
Advanced search Search tips

Issue 671716 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Support parallel collection of stack sample profiles.

Project Member Reported by bcwh...@chromium.org, Dec 6 2016

Issue description

The current StackSamplingProfiler supports only one at a time.

Support parallel samples without creating multiple sampling threads.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/69e964496800e75cb0e3cdd974436659bd24e9cf

commit 69e964496800e75cb0e3cdd974436659bd24e9cf
Author: bcwhite <bcwhite@chromium.org>
Date: Wed Apr 19 15:30:23 2017

Support parallel captures from the StackSamplingProfiler.

Previously, only one sampling operation could be running and it was
generally used to profile the startup of the browser.  To make it more
useful, it can now run against any thread and multiple profilers can
execute in parallel.

Sampling will continue until the desired number of samples has been
collected, it is manually stopped, or the controlling object gets
destructed.

The SamplingThread is a singleton base::Thread that is self-managing.
- It is started (via GetOrCreateTaskRunnerForAdd) on the calling
  thread when work arrives.
- It stops (via ShutdownTask) on its own thread when it has been
  idle for 1 minute.
- DetachFromSequence is called after both of these to allow for
  accessing the API from different threads.
- thread_execution_state_lock_ is held when doing Thread API calls to
  ensure that access is sequenced.

The sampled thread is expected to live at least as long as the
thread controlling the sampling.

BUG= 671716 

Review-Url: https://codereview.chromium.org/2554123002
Cr-Commit-Position: refs/heads/master@{#465614}

[modify] https://crrev.com/69e964496800e75cb0e3cdd974436659bd24e9cf/base/profiler/stack_sampling_profiler.cc
[modify] https://crrev.com/69e964496800e75cb0e3cdd974436659bd24e9cf/base/profiler/stack_sampling_profiler.h
[modify] https://crrev.com/69e964496800e75cb0e3cdd974436659bd24e9cf/base/profiler/stack_sampling_profiler_unittest.cc
[modify] https://crrev.com/69e964496800e75cb0e3cdd974436659bd24e9cf/base/threading/thread_restrictions.h

Status: Fixed (was: Started)

Sign in to add a comment