1. 07 Dec, 2021 1 commit
    • Corentin Pescheloche's avatar
      Reland "[profiler] Surface VM & Embedder State" · e155881f
      Corentin Pescheloche authored
      This is a reland of 2d087f23
      
      The changes are :
      * Fix redundant reinterpret_cast in test file for MSVC failure
      https://crbug.com/v8/12476
      * Fix flaky test
      https://crbug.com/v8/12475
      If a sample is captured during a GC, no embedder context is obtained
      defaulting to EMPTY. This is the expected behavior, made it in clear
      in implementation and in test.
      * Synchronized the embedder context filter behavior with existing
      native context filter.
      
      Original change's description:
      
      > Add APIs to surface VMState and new EmbedderState to CpuProfile samples.
      >
      > EmbedderState:
      > * An EmbedderState is defined as a value uint8_t and a v8::context used
      > for filtering.
      > * EmbedderStates are stack allocated by the embedder, construction and
      > destruction set/unset the state to the isolate thread local top.
      > * A v8::context is used to filter states that are added to a CpuProfile,
      > if the CpuProfile do not have a ContextFilter set or if contexts do not
      > match, state defaults to Empty.
      >
      > * v8:StateTag is already propagated all the way to a Sample, simply add
      > an API to surface it.
      >
      > VMState:
      > Change-Id: I7eed08907360b99b0ad20ddcff59c95c7076c85e
      > Bug: chromium:1263871
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3188072
      > Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
      > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Reviewed-by: Igor Sheludko <ishell@chromium.org>
      > Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78250}
      
      Bug: chromium:1263871
      Change-Id: Ief891b05da99c695e9fb70f94ed7ebdecc6c3b7b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3320037
      Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78281}
      e155881f
  2. 06 Dec, 2021 2 commits
    • Camillo Bruni's avatar
      Revert "[profiler] Surface VM & Embedder State" · 480a917d
      Camillo Bruni authored
      This reverts commit 2d087f23.
      
      Reason for revert: 
      - Causing MSVC build failures: https://crbug.com/v8/12476
      - Causing flaky failures: https://crbug.com/v8/12475
      
      Original change's description:
      > [profiler] Surface VM & Embedder State
      >
      > Add APIs to surface VMState and new EmbedderState to CpuProfile samples.
      >
      > EmbedderState:
      > * An EmbedderState is defined as a value uint8_t and a v8::context used
      > for filtering.
      > * EmbedderStates are stack allocated by the embedder, construction and
      > destruction set/unset the state to the isolate thread local top.
      > * A v8::context is used to filter states that are added to a CpuProfile,
      > if the CpuProfile do not have a ContextFilter set or if contexts do not
      > match, state defaults to Empty.
      >
      > * v8:StateTag is already propagated all the way to a Sample, simply add
      > an API to surface it.
      >
      > VMState: 
      > Change-Id: I7eed08907360b99b0ad20ddcff59c95c7076c85e
      > Bug: chromium:1263871
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3188072
      > Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
      > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Reviewed-by: Igor Sheludko <ishell@chromium.org>
      > Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78250}
      
      Bug: chromium:1263871, v8:12475, v8:12476
      Change-Id: I02670b1ed3bb863033208369227642a7419fce00
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3315444
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78256}
      480a917d
    • Corentin Pescheloche's avatar
      [profiler] Surface VM & Embedder State · 2d087f23
      Corentin Pescheloche authored
      Add APIs to surface VMState and new EmbedderState to CpuProfile samples.
      
      EmbedderState:
      * An EmbedderState is defined as a value uint8_t and a v8::context used
      for filtering.
      * EmbedderStates are stack allocated by the embedder, construction and
      destruction set/unset the state to the isolate thread local top.
      * A v8::context is used to filter states that are added to a CpuProfile,
      if the CpuProfile do not have a ContextFilter set or if contexts do not
      match, state defaults to Empty.
      
      * v8:StateTag is already propagated all the way to a Sample, simply add
      an API to surface it.
      
      VMState: 
      Change-Id: I7eed08907360b99b0ad20ddcff59c95c7076c85e
      Bug: chromium:1263871
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3188072
      Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78250}
      2d087f23
  3. 23 Aug, 2021 1 commit
    • Corentin Pescheloche's avatar
      [cpu-profiler] Add method to estimate mem size of ProfilerCodeObserver · 731fd3f5
      Corentin Pescheloche authored
      This patchset introduces instrumentation of the memory usage of the
      datatructures maintained by the CPU profiler.
      It captures:
      * The total size of the strings held in StringsStorage for CodeEntries
      * Estimated size held by CodeMap's entries.
      
      The target is to surface that metric through telemetry to get better
      visibility into the memory profile of CpuProfiler.
      
      For now, STL containers overhead is ignored as it is implementation
      specific.
      
      Change-Id: I8c6a0cd4f14348fe8832dec1f24861befc67d700
      Bug: chromium:1241491
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3101580
      Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
      Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#76438}
      731fd3f5
  4. 02 Jul, 2021 1 commit
  5. 16 Jun, 2021 1 commit
  6. 15 Jun, 2021 2 commits
  7. 14 Jun, 2021 1 commit
  8. 07 Jun, 2021 1 commit
  9. 21 Apr, 2021 1 commit
  10. 22 Mar, 2021 1 commit
  11. 16 Feb, 2021 1 commit
  12. 12 Feb, 2021 1 commit
  13. 26 Jan, 2021 2 commits
  14. 22 Jan, 2021 1 commit
    • Peter Marshall's avatar
      Reland "[cpu-profiler] Use base::LeakyObject for static CodeEntry objects" · 93f8a867
      Peter Marshall authored
      This is a reland of c594a20e
      
      Moved the getters to the .cc file to avoid link problems as they
      are not performance critical anyway.
      
      Moved ProfileNode::source_type to cc as it uses the _entry() functions
      which are no longer inline.
      
      Original change's description:
      > [cpu-profiler] Use base::LeakyObject for static CodeEntry objects
      >
      > This is preferred over the older LazyInstance based stuff, and has
      > a lot less boilerplate and is easier to follow.
      >
      > Bug: v8:8600
      > Change-Id: I7c5c5ae04c064b0fc598dc01f1ed5442dc21a17b
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640475
      > Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#72224}
      
      Bug: v8:8600
      Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng
      Change-Id: I0ad9118e6d3bd087707609714b20aee1cbc4f459
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2642252
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72254}
      93f8a867
  15. 21 Jan, 2021 2 commits
  16. 20 Jan, 2021 1 commit
  17. 11 Jan, 2021 1 commit
  18. 22 Dec, 2020 1 commit
  19. 10 Dec, 2020 1 commit
  20. 11 Nov, 2020 1 commit
  21. 27 Oct, 2020 2 commits
    • Nicolas Dubus's avatar
      [cpu-profiler] Return CpuStartProfilingStatus when starting profiling · a5490e39
      Nicolas Dubus authored
       - Created status enum with statuses kStarted, kAlreadyStarted and
      kErrorTooManyProfilers, returning when StartProfiling is invoked
       - Tests spin up one profiler, check kStarted returned; spin up
      another with same name, check kAlreadyStarted returned; Spin up 99
      more profilers (100 total), check each returning kStarted, and
      one more, expecting 101st to return kErrorTooManyProfilers
      
      R=acomminos@fb.com, petermarshall@chromium.org, ulan@chromium.org
      
      Change-Id: I64e2e6396775f90f9f49f75331a075a47efa7fca
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2486240Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70808}
      a5490e39
    • Peter Marshall's avatar
      [cpu-profiler] Clear the CodeMap after the last profile to stop leak · 73a94290
      Peter Marshall authored
      We kept the CodeMap filled with entries between profiles, even in
      kLazyLogging mode which will re-fill the CodeMap when profiling starts
      again. See the bug for more details.
      
      This fix manually clears the CodeMap after the last profile is deleted.
      We already call DisableLogging() when the last profile is stopped. At
      this point we still need the CodeMap alive because the profile object
      we expose via the API is backed by the CodeEntry objects in the CodeMap.
      Once the last profile is deleted though, we can empty the CodeMap.
      
      There is still another bug, which is that we never delete CodeEntry
      objects for deleted code, as there are no CodeDeleteEvents from the GC.
      We will work on that separately, but this fix should stop those leaks
      accumulating between profiles as we wipe the CodeMap entirely between
      profiles (at least for kLazyLogging mode). kEagerLogging mode still has
      this problem and will only be fixed by introducing CodeDelete events or
      similar.
      
      Bug: v8:11051
      Change-Id: Iab9570747d17c657e6e318d434f935af8047d05f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2491033
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70792}
      73a94290
  22. 03 Oct, 2020 1 commit
  23. 01 Oct, 2020 1 commit
    • Peter Marshall's avatar
      [cpu-profiler] Refactor ProfileGenerator · 82efa4bd
      Peter Marshall authored
      Rename it to Symbolizer because it does exactly that.
      
      Change the SymbolizeTickSample method to return the symbolized state
      rather than pass it on to the ProfilesCollection. This makes it easier
      to test as now it only relies on the CodeMap provided to it.
      
      Make EntryForVMState a free-floating function as it doesn't rely on
      state and then we can avoid importing the StateTag definition in the
      header.
      
      Remove the UNREACHABLE from EntryForVMState as the compiler got smarter
      and doesn't need it anymore.
      
      Pass the CpuProfilesCollection to SamplingEventsProcessor instead,
      as it is now responsible for putting the symbolized samples into the
      collection to be sorted into the appropriate profiles.
      
      Change-Id: I104290eff22b7d94a1bd34ba904036badccf4e13
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440522
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70248}
      82efa4bd
  24. 14 Sep, 2020 1 commit
  25. 01 Sep, 2020 1 commit
  26. 18 May, 2020 1 commit
  27. 27 Apr, 2020 1 commit
  28. 29 Jan, 2020 1 commit
  29. 22 Jan, 2020 1 commit
  30. 27 Nov, 2019 1 commit
  31. 15 Nov, 2019 1 commit
  32. 20 Aug, 2019 1 commit
  33. 26 Jul, 2019 1 commit
  34. 27 May, 2019 1 commit
    • Clemens Hammacher's avatar
      [cleanup] Replace simple typedefs by using · a335f2ae
      Clemens Hammacher authored
      This replaces all typedefs that define types and not functions by the
      equivalent "using" declaration.
      
      This was done mostly automatically using this command:
      ag -l '\btypedef\b' src test | xargs -L1 \
           perl -i -p0e 's/typedef ([^*;{}]+) (\w+);/using \2 = \1;/sg'
      
      Patchset 2 then adds some manual changes for typedefs for pointer types,
      where the regular expression did not match.
      
      R=mstarzinger@chromium.org
      TBR=yangguo@chromium.org, jarin@chromium.org
      
      Bug: v8:9183
      Change-Id: I6f6ee28d1793b7ac34a58f980b94babc21874b78
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631409
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61849}
      a335f2ae
  35. 23 May, 2019 1 commit