1. 13 Feb, 2019 1 commit
  2. 21 Jan, 2019 3 commits
    • Peter Marshall's avatar
      [cpu-profiler] Remove registration and sampling depth from Sampler · 1f1bd71d
      Peter Marshall authored
      Simplify the internal state of Sampler a bit. There are basically two
      users of Sampler - the CpuSampler used by the CpuProfiler and the
      Ticker used by log.cc. Ticker calls Start/Stop to manage the Sampler
      lifetime, but CpuProfiler does not. This leads to much confusion and
      overlap of functionality.
      
      Fix that here by removing the distinction between active, registered
      and isProfiling states. These are now all the same thing and are
      represented by IsActive(). The state is set to active when Start is
      called, and set inactive when Stop is called. Both users of Sampler
      now call Start and Stop at appropriate times.
      
      The concept of profiling depth was not used - each Sampler would
      only ever have a sampling depth of 1. We still need to call
      SignalHandler::IncreaseSamplerCount(), so we do that in Start
      and the corresponding DecreaseSamplerCount() in Stop.
      
      Change-Id: I16a9435d26169a7dd00b1c7876e66af45f12e4b0
      Reviewed-on: https://chromium-review.googlesource.com/c/1424337
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58955}
      1f1bd71d
    • Peter Marshall's avatar
      [cpu-profiler] Cleanup and use std atomics in Sampler · ba565577
      Peter Marshall authored
      There's no reason to use our self-baked atomics anymore. Also
      
      - Changes two boolean values to use a boolean instead of an int
      - Uses a unique ptr for data_
      - Removes has_processing_thread_ which is not used
      - Moves most initialization inline into the class
      - Removes SetUp/TearDown which weren't needed
      
      Change-Id: I8f50133636961502d56351abd2fb17196603a01a
      Reviewed-on: https://chromium-review.googlesource.com/c/1422918
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58950}
      ba565577
    • Peter Marshall's avatar
      [cpu-profiler] Add tests for sampler.cc · 5aa361ff
      Peter Marshall authored
      Moved class definitions into header
      
      Change-Id: I2d3e5ec6f8f5068284cdbaa6900797950fc7e01a
      Reviewed-on: https://chromium-review.googlesource.com/c/1422739
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58946}
      5aa361ff
  3. 14 Sep, 2018 1 commit
  4. 01 Sep, 2016 1 commit
  5. 10 Aug, 2016 1 commit
  6. 11 Jul, 2016 1 commit
  7. 08 Jul, 2016 2 commits
  8. 26 May, 2016 1 commit
    • lpy's avatar
      Reland: Create libsampler as V8 sampler library. · a0198c0f
      lpy authored
      This patch does five things:
      
      1. Extracts sampler as libsampler to provide sampling functionality support.
      2. Makes SampleStack virtual so embedders can override the behaviour of sample collecting.
      3. Removes sampler.[h|cc].
      4. Moves sampling thread into log.cc as workaround to keep the --prof functionality.
      5. Creates SamplerManager to manage the relationship between samplers and threads.
      
      The reason we port hashmap.h is that in debug mode, STL containers are using
      mutexes from a mutex pool, which may lead to deadlock when using asynchronously
      signal handler.
      
      Currently libsampler is used in V8 temporarily.
      
      BUG=v8:4789
      LOG=n
      
      Committed: https://crrev.com/06cc9b7c176a6223971deaa9fbcafe1a05058c7b
      Cr-Commit-Position: refs/heads/master@{#36527}
      
      Review-Url: https://codereview.chromium.org/1922303002
      Cr-Commit-Position: refs/heads/master@{#36532}
      a0198c0f
  9. 25 May, 2016 2 commits
    • lpy's avatar
      Revert of Create libsampler as V8 sampler library. (patchset #24 id:460001 of... · 636f1e8e
      lpy authored
      Revert of Create libsampler as V8 sampler library. (patchset #24 id:460001 of https://codereview.chromium.org/1922303002/ )
      
      Reason for revert:
      V8 Linux64 TSAN failure because ThreadSanitizer indicated data race.
      
      Original issue's description:
      > Create libsampler as V8 sampler library.
      >
      > This patch does five things:
      >
      > 1. Extracts sampler as libsampler to provide sampling functionality support.
      > 2. Makes SampleStack virtual so embedders can override the behaviour of sample collecting.
      > 3. Removes sampler.[h|cc].
      > 4. Moves sampling thread into log.cc as workaround to keep the --prof functionality.
      > 5. Creates SamplerManager to manage the relationship between samplers and threads.
      >
      > The reason we port hashmap.h is that in debug mode, STL containers are using
      > mutexes from a mutex pool, which may lead to deadlock when using asynchronously
      > signal handler.
      >
      > Currently libsampler is used in V8 temporarily.
      >
      > BUG=v8:4789
      > LOG=n
      >
      > Committed: https://crrev.com/06cc9b7c176a6223971deaa9fbcafe1a05058c7b
      > Cr-Commit-Position: refs/heads/master@{#36527}
      
      TBR=jochen@chromium.org,alph@chromium.org,fmeawad@chromium.org,yangguo@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:4789
      
      Review-Url: https://codereview.chromium.org/2000323007
      Cr-Commit-Position: refs/heads/master@{#36529}
      636f1e8e
    • lpy's avatar
      Create libsampler as V8 sampler library. · 06cc9b7c
      lpy authored
      This patch does five things:
      
      1. Extracts sampler as libsampler to provide sampling functionality support.
      2. Makes SampleStack virtual so embedders can override the behaviour of sample collecting.
      3. Removes sampler.[h|cc].
      4. Moves sampling thread into log.cc as workaround to keep the --prof functionality.
      5. Creates SamplerManager to manage the relationship between samplers and threads.
      
      The reason we port hashmap.h is that in debug mode, STL containers are using
      mutexes from a mutex pool, which may lead to deadlock when using asynchronously
      signal handler.
      
      Currently libsampler is used in V8 temporarily.
      
      BUG=v8:4789
      LOG=n
      
      Review-Url: https://codereview.chromium.org/1922303002
      Cr-Commit-Position: refs/heads/master@{#36527}
      06cc9b7c