Closed Bug 1630872 Opened 5 years ago Closed 5 years ago

Replace BlocksRingBuffer with ProfileChunkedBuffer

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

Details

Attachments

(8 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

After bug 1626837, ProfileChunkedBuffer is complete and can now replace BlocksRingBuffer.

Instead of a potentially-null pointer to a ProfileBufferEntryWriter, we are
now providing a Maybe<ProfileBufferEntryWriter>, which is safer.

Same as with BlocksRingBuffer: Instead of a potentially-null pointer to a
ProfileBufferEntryWriter, we are now providing a
Maybe<ProfileBufferEntryWriter>, which is safer.

Depends on D71286

explicit operator bool() and operator!() were cute ways to make InChunkBuffer quack like a pointer when testing if it's effectively null.
But after some experience, and since InChunkPointer will not be used in generic code where pointers would be accepted, I now think that it's better to be clearer about it and use an explicit IsNull().

Depends on D71287

Renamed some variables to be more generic. Their type is going to change in the next patch, and that type doesn't need to be in the names; also it will make the next patch easier to review.

Depends on D71499

As opposed to ProfileBufferIndex (no "Block"), ProfileBufferBlockIndex is only supposed to point at a valid block start.
If we trust this assumption, it allows for quick access to the given block index inside the buffer, as we don't need to read blocks one by one until we reach the given position.

There are still safety checks (MOZ_ASSERTs in DEBUG builds) to verify that block indices are correctly used.

Depends on D71501

Attachment #9141597 - Attachment description: Bug 1630872 - Removed 'BlocksRingBuffer' from some platform variables - r?canaltinova!,gregtatum → Bug 1630872 - Removed 'BlocksRingBuffer' from some Gecko Profiler platform variables - r?canaltinova!,gregtatum
Attachment #9141599 - Attachment description: Bug 1630872 - Replace uses of BlocksRingBuffer with ProfileChunkedBuffer - r?canaltinova!,gregtatum → Bug 1630872 - Replace uses of BlocksRingBuffer with ProfileChunkedBuffer in Gecko Profiler - r?canaltinova!,gregtatum

Renamed some variables to be more generic. Their type is going to change in the next patch, and that type doesn't need to be in the names; also it will make the next patch easier to review.

Depends on D71501

Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/488d57eb1da7 BlockRingBuffer Put* functions provide a Maybe<ProfileBufferEntryWriter> - r=canaltinova https://hg.mozilla.org/integration/autoland/rev/79cc6c708645 ProfileChunkedBuffer Put* functions provide a Maybe<ProfileBufferEntryWriter> - r=canaltinova https://hg.mozilla.org/integration/autoland/rev/ad1644ba541d Replace InChunkBuffer::operator bool() and operator!() with IsNull() - r=canaltinova https://hg.mozilla.org/integration/autoland/rev/1c27b4d14959 Removed 'BlocksRingBuffer' from some Gecko Profiler platform variables - r=canaltinova https://hg.mozilla.org/integration/autoland/rev/d09fce7cef49 Replace uses of BlocksRingBuffer with ProfileChunkedBuffer in Gecko Profiler - r=canaltinova https://hg.mozilla.org/integration/autoland/rev/7f832cccb66e Removed 'BlocksRingBuffer' from some Base Profiler platform variables - r=canaltinova https://hg.mozilla.org/integration/autoland/rev/c38f6467377d Replace uses of BlocksRingBuffer with ProfileChunkedBuffer in Base Profiler - r=canaltinova https://hg.mozilla.org/integration/autoland/rev/1416b0415a5e Quick-moving InChunkPointer with `ProfileBufferBlockIndex` - r=canaltinova
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: