Closed Bug 1573111 Opened 5 years ago Closed 5 years ago

BlocksRingBuffer can switch underlying buffer

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

Details

Attachments

(1 file)

BlocksRingBuffer will be used both inside and outside ProfileBuffer:

  • Inside to serve as ProfileBuffer's main storage for stack traces,
  • Outside to allow marker storage even when ProfileBuffer is locked during
    stack sampling.

ProfileBuffer only exists while ActivePS is alive, but because of the
potential outside accesses above (due to small races between ProfileBuffer
shutdown, and thread-local IsBeingProfiled() flags), we cannot just do the same
for BlocksRingBuffer, and it must remain alive to gracefully deny these accesses
around the profiler startup and shutdown times.

To accomplish this, BlocksRingBuffer may be in different states.
This is done by enclosing the underlying ModuloBuffer and the entry deleter in
a Maybe, which may be Nothing when the profiler is not running.

BlocksRingBuffer will be used both inside and outside ProfileBuffer:

  • Inside to serve as ProfileBuffer's main storage for stack traces,
  • Outside to allow marker storage even when ProfileBuffer is locked during
    stack sampling.

ProfileBuffer only exists while ActivePS is alive, but because of the
potential outside accesses above (due to small races between ProfileBuffer
shutdown, and thread-local IsBeingProfiled() flags), we cannot just do the same
for BlocksRingBuffer, and it must remain alive to gracefully deny these accesses
around the profiler startup and shutdown times.

To accomplish this, BlocksRingBuffer may be in different states.
This is done by enclosing the underlying ModuloBuffer and the entry deleter in
a Maybe, which may be Nothing when the profiler is not running.

Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/58dd47c5aa51 BlocksRingBuffer can switch underlying buffer - r=gregtatum
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1970740a923d BlocksRingBuffer can switch underlying buffer - r=gregtatum
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

(forgot to clear NI -- fixed and landed now.)

Flags: needinfo?(gsquelart)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: