Closed Bug 1763176 Opened 3 years ago Closed 2 years ago

The memory tracks are missing on startup profiles

Categories

(Core :: Gecko Profiler, defect, P1)

defect

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox99 --- wontfix
firefox100 --- wontfix
firefox101 --- fixed

People

(Reporter: florian, Assigned: mozbugz)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Here's a startup profile captured today on my local build: https://share.firefox.dev/3DK9rMk

It doesn't have the memory tracks.

A random non-startup profile captured using the same build has memory tracks: https://share.firefox.dev/3j95AiI

Random guess: could this be a regression from when we merged the base profiler tracks?

The two profiles above are from my M1 macbook pro, I haven't verified if the bug reproduces on other platforms.

The severity field is not set for this bug.
:gerald, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(gsquelart)

Sorry I didn't look at this earlier.

This was actually triggered by added the per-process CPU counter, but the root cause is that the counter-streaming code cannot handle two counters next to each other, which now happens because the sampler loop samples both counters (by chance process cpu then memory) together.

Assignee: nobody → gsquelart
Severity: -- → S4
Flags: needinfo?(gsquelart)
Priority: -- → P1

I'll register bug 1744670 as "regressed by" bug, because even though that's not where the root cause is, that's the point where this bug started happening (so Firefox 98), and when it should have been caught.

Workaround if needed: Note that it can be avoided by manually turning off the per-process CPU feature.

If the sampler records more than one counter (e.g.: memory and per-process CPU), both counters could appear right next to each other in the buffer.
But then the current streaming code goes something like this:

  1. Read entry
  2. If entry is a counter, go to the next entry (which should be a timestamp) and output the full counter.
  3. Go to the next entry.
    4: Return to step 1 (until there are no more entries).

The problem is this unconditional 3rd step:
If we've just read a counter at step 2, we're located at the entry past that counter's data, which could be the start of the next counter, that the 3rd step now effectively skips!

Has Regression Range: --- → yes
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e81e897d7209 Don't move to the next entry after streaming a counter, as it would skip an immediately-adjacent counter - r=canaltinova
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: