Closed Bug 1779685 Opened 1 month ago Closed 27 days ago

Add events to profile.profileGatheringLog

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: gerald, Assigned: gerald)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Since bug 1676271, profiles contain a profileGatheringLog, but currently it only stores the start and end timestamps.
We want to capture the most useful events that happen during this phase, e.g.: profile requests and responses, progress, errors, etc.

This will be useful for fixes to bug 1758643 and bug 1779367, to document why we need to discard some data because of issues during the gathering process.

Here's an example profile with the new data: https://share.firefox.dev/3cfxrO2 , open the web console and inspect profile.profileGatheringLog, it should look like this:

{
  "91168": {
    "events": [
      [ 762491.7001, "Generated parent process profile, size:", 89156614 ],
      [ 762522.4514, "Added exit profiles, total size so far:", 89156631 ],
      [ 762533.0517, "Waiting for pending profile, pid:", 77304 ],
      [ 762533.0774, "Waiting for pending profile, pid:", 94216 ],
      [ 762754.0895, "Got profile from pid, with size:", 77304, 53061201 ],
      [ 763810.0778, "Requested progress from pid:", 94216 ],
      [ 763810.6212, "Got response from pid, with progress:", 94216, 73.29 ],
      [ 764810.7392, "Requested progress from pid:", 94216 ],
      [ 764811.1027, "Got response from pid, with progress:", 94216, 97.89 ],
      [ 765003.995, "Got profile from pid, with size:", 94216, 90143930 ],
      [ 765097.7483, "Finished gathering, total size:", 405950395 ]
    ],
    "profileGatheringLogBegin_TSms": 757591.8512,
    "profileGatheringLogEnd_TSms": 765145.2974
  }
}

This will be useful to see how big profiles get during gathering, and
potentially to avoid making them too big if possible.

This may be useful to advanced profiler users, to see how the multi-process
profile gathering went.

(Some information, like missing processes, could be useful to expose to all
users, but this should be done in future tasks, with corresponding front-end
work.)

Note: There are no direct tests, as this is intended for advanced human users,
and the format is not guaranteed to stay stable.

Depends on D151901

Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/42b6aac07798
Factor ChunkedJSONWriteFunc::Length() out of CopyDataIntoLazilyAllocatedBuffer() - r=florian
https://hg.mozilla.org/integration/autoland/rev/2b1c4f14a2cf
Add useful information to profile.profileGatheringLog.events - r=florian
Status: NEW → RESOLVED
Closed: 27 days ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Blocks: 1752930
You need to log in before you can comment on or make changes to this bug.