Closed Bug 1692631 Opened 3 years ago Closed 3 years ago

Fix profiler markers for IPC messages on Windows

Categories

(Core :: IPC, defect)

defect

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: jld, Assigned: jld)

Details

Attachments

(2 files)

While profiling IPC on Windows, I found two issues with the markers for message transmission, which are simple enough to fix that I didn't think it was worth making separate bugs:

  1. We appear to add an eSending/TransferStart marker for every segment of the message, not just the first; this causes the profiler marker code to take enough time to show up in the profile itself for large messages. The frontend seems to use only the first — the displayed time intervals seem to be correct — but this is wasteful.

  2. The eReceiving marker is TransferStart, but it appears to be at the end of the receiving the message (and in general we can't do eReceiving/TransferStart with this interface, because we don't have the Message object until after at least the first segment is read; the Unix version doesn't attempt to create such a marker). This causes two of the four times displayed in the marker chart to read as “unknown”.

I have patches.

Currently, we add an eSending/TransferStart marker every time we
send data as part of a message, rather than only the first time. The
profiler frontend appears to ignore the extra markers (the displayed time
intervals look reasonable), but it's wasteful: on large messages it can
consume enough CPU time to appear in the profile itself.

This point in the code is the end of receiving a message, not the start
(note the if (partial) { break; } above), so it should be marked
accordingly. The profiler frontend is expecting the end marker;
currently two of the four reported time intervals are unknown on
Windows, and this patch fixes that.

(Recording the receiving start time is complicated, because we don't
have a Messsage object until we've read the buffer with the (end of
the) header, and it might make more sense to timestamp it before the
first receive operation. Currently, neither channel implementation
attempts this.)

Pushed by jedavis@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/29dfbb189483
Add only one sending start profiler marker per message on Windows. r=gerald
https://hg.mozilla.org/integration/autoland/rev/44f15834eff0
Fix the profiler marker for IPC message reception on Windows. r=gerald
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: