Closed Bug 1827214 Opened 3 years ago Closed 2 years ago

Make --enable-perf work on macOS

Categories

(Core :: JavaScript Engine: JIT, task, P1)

All
macOS
task

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

samply is getting support for Jitdump on macOS, so we should make --enable-perf / PerfSpewer work on macOS.

Note that, with these patches applied, --enable-perf builds will crash on Apple Silicon macOS due to bug 1827213, because --enable-perf turns on interpreter entry stubs by default. In the meantime, they can be disabled with --no-emit-interpreter-entry.

Emitting Jitdump files on macOS will be useful once the samply profiler
supports Jitdump on macOS.

These flushes cause a fair amount of overhead and aren't really necessary.
Both perf and samply will look at jitdump files once the process has stopped running.

Flushing frequently does have the advantage that the overhead is relatively
evenly distributed over all the places that write to the file; avoiding the
flush just means there will be an automatic flush at an arbitrary point. So
when we look at profiles we'll still have to remove samples in Jitdump file
writing from the profile, to avoid skewing the runtime of the functions which
happened to incur the actual flush. However, the overall flushing time should
be less.

There is another case where frequent flushing would be beneficial: If the
information in the Jitdump file was needed for accurate stack walking, i.e.
if we were using JIT_CODE_UNWINDING_INFO records. But we don't use those
records (we walk the stack using frame pointers), so this doesn't apply.

Depends on D175045

On Linux, this mmap is needed so that the perf.data file contains MMAP2
records with the filename.
On macOS, samply hooks the open (and fopen) function to observe the
jitdump path, and no mmap is needed.

Depends on D175046

Severity: -- → N/A
Priority: -- → P1
Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/663b5e3ebfbc Make PerfSpewer.cpp compile on macOS, and allow --enable-perf on macOS. r=dpalmeiro https://hg.mozilla.org/integration/autoland/rev/edd14c1eb849 Don't flush after every jitdump record. r=dpalmeiro https://hg.mozilla.org/integration/autoland/rev/2969fa3d6880 Avoid unnecessary (and slow) jitdump mmap on macOS. r=dpalmeiro
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: