Closed Bug 1643637 Opened 4 years ago Closed 3 years ago

Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units, e.g. "64MB"

Categories

(Core :: Gecko Profiler, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: mozbugz, Assigned: neel)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

MOZ_PROFILER_STARTUP_ENTRIES takes a number of "entries", and converts them to bytes (8 per entry).
With the big buffer we want these days, and this entry-to-bytes conversion, it can be difficult to quickly enter a size.
E.g., 512MB: MOZ_PROFILER_STARTUP_ENTRIES=67108864.

I think it should be possible to parse numbers with some expected units, e.g.: "512MB", "512MiB" (currently these will be equivalent because we round up to the next power of 2), "2GB"...

I don't think we need to have a unit for entries, like "64M" could be interpreted as 64 million entries (which equals 512 megabytes), I want to make "entries" obsolete eventually.

Optional: Consider having a new env-var called "MOZ_PROFILER_STARTUP_MAX_BUFFER_SIZE", which would be more correct, as we don't allocate all of it at once anymore.

And bonus: Convert these big numbers back to numbers-with-units strings, this could be used to show friendly defaults in MOZ_PROFILER_HELP=1.

Assignee: nobody → neel
Status: NEW → ASSIGNED
Attachment #9250452 - Attachment description: Bug 1643637: Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units → WIP: Bug 1643637: Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units
Attachment #9250452 - Attachment description: WIP: Bug 1643637: Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units → Bug 1643637: Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units
Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5e6c082f582e
Make MOZ_PROFILER_STARTUP_ENTRIES understand sizes with units r=gerald
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: