Closed Bug 1985382 Opened 9 months ago Closed 9 months ago

Add IONPERF=ir-graph for dumping iongraph.json to perf JitDump

Categories

(Core :: JavaScript Engine: JIT, task)

task

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: rhunt, Assigned: rhunt)

References

(Blocks 2 open bugs)

Details

Attachments

(6 files, 4 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

We'd like to integrate Ben's iongraph-web visualizer into the profiler. To do this, we'll need to dump the JSON for each function into the perf JitDump file.

GraphSpewer delegates all of the graph spewing to JSONSpewer,
and only really exists to dump the result to JITSpew.

JSONSpewer is what actually prints the graph JSON and is what
I need to use for dumping to the JitDump stream.

Rename GraphSpewer -> JitSpewGraphSpewer, and
JSONSpewer -> GraphSpewer.

This is not used at all and seems to be an artifact of
the IonPerfSpewer support added to wasm.

PerfSpewer entagles two separate concepts:

  1. The JitDump debug entries that map from PC -> line/column
  2. The IR opcodes we generate when IONPERF=ir that are printed
    to a temp file and linked to from the debug entries.

This is a problem when trying to support printing the iongraph.json
to jitdump, as we don't want to use the IR opcode feature of PerfSpewer
but we do want to have debug entries that reference the JSON.

This commit refactors PerfSpewer so that it only holds a collection
of debug entries that will be written into JitDump later. The IR
file is now opened eagerly when we begin recording, and all writes
to the file also add to the debug entries vector.

This split makes IONPERF=src cleaner, as it only needs to add
debug entries. This will also simplify iongraph integration as
we can now just have the GraphSpewer write directly into the
file and avoid an extra buffer.

BaselineInterpreterPerfSpewer keeps a version of the Op struct
as it makes a late decision about whether to generate multiple
JitDump entries or just a single one for the loop, and it's
easiest to just have the IR in memory for this.

As far as I can tell, this static boolean isn't used in any way.

GraphSpewer delegates all of the graph spewing to JSONSpewer,
and only really exists to dump the result to JITSpew.

JSONSpewer is what actually prints the graph JSON and is what
I need to use for dumping to the JitDump stream.

Rename GraphSpewer -> JitSpewGraphSpewer, and
JSONSpewer -> GraphSpewer.

This is not used at all and seems to be an artifact of
the IonPerfSpewer support added to wasm.

PerfSpewer entagles two separate concepts:

  1. The JitDump debug entries that map from PC -> line/column
  2. The IR opcodes we generate when IONPERF=ir that are printed
    to a temp file and linked to from the debug entries.

This is a problem when trying to support printing the iongraph.json
to jitdump, as we don't want to use the IR opcode feature of PerfSpewer
but we do want to have debug entries that reference the JSON.

This commit refactors PerfSpewer so that it only holds a collection
of debug entries that will be written into JitDump later. The IR
file is now opened eagerly when we begin recording, and all writes
to the file also add to the debug entries vector.

This split makes IONPERF=src cleaner, as it only needs to add
debug entries. This will also simplify iongraph integration as
we can now just have the GraphSpewer write directly into the
file and avoid an extra buffer.

BaselineInterpreterPerfSpewer keeps a version of the Op struct
as it makes a late decision about whether to generate multiple
JitDump entries or just a single one for the loop, and it's
easiest to just have the IR in memory for this.

As far as I can tell, this static boolean isn't used in any way.

If IONPERF=ir-graph, IonPerfSpewer will now dump the iongraph.json
into a temporary file, and link to it from debug entries in JitDump.
Instead of mapping a PC to a line/column, we map it to LIR node ID's
so that the graph visualizer can use this to display sample counts.

IonPerfSpewer is moved from CodeGenerator to MIRGenerator and
lives next to JitSpewGraphSpewer. Methods are added to spew
passes to both of these. The JitSpew StartFunction/EndFunction
methods are also moved to MIRGenerator.

iongraph-web needs loopDepth information. Indentation also consumes
a ton of space and is not necessary, disable it.

See Also: → 1825001
Attachment #9509652 - Attachment is obsolete: true
Attachment #9509651 - Attachment is obsolete: true
Attachment #9509650 - Attachment is obsolete: true
Attachment #9509649 - Attachment is obsolete: true
QA Whiteboard: [qa-triage-done-c145/b144]
Blocks: iongraph
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: