Closed Bug 1934663 Opened 1 year ago Closed 1 year ago

Report wasm function tier correctly to profiler with lazy tiering

Categories

(Core :: JavaScript: WebAssembly, task, P3)

task

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: rhunt, Assigned: jpages)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We use this function [1] when profiling wasm code to figure out which tier a function belongs to. It's a bit of a hack that uses the codeRange_ pointer that the ProfilingFrameIter [2] has lying around to figure out which tier it's on. It does this by searching all the CodeRangeVector's that the CodeBlock's on a Code have to find where the CodeRange pointer came from. It searches just the two 'complete' tiers that we have when we're not doing lazy tiering.

With lazy tiering we may have hundreds of code blocks, so searching through them all will not be efficient. We should rework this to support lazy tiering and just be faster too.

Here's an idea:

  1. Add a Category category_ field to ProfilingFrameIter
  2. Change all uses of wasm::LookupCode in ProfilingFrameIter to use wasm::LookupCodeBlock and then get a profiling category from the CodeBlock::kind field. Store that in the category_ field.
  3. Return this category field from the accessor.

[1] https://searchfox.org/mozilla-central/rev/6597dd03bad82c891d084eed25cafd0c85fb333e/js/src/wasm/WasmCode.cpp#1384
[2] https://searchfox.org/mozilla-central/rev/6597dd03bad82c891d084eed25cafd0c85fb333e/js/src/wasm/WasmFrameIter.cpp#2009

See Also: → 1939425

Added a patch for this issue, it seems to correctly display which compiler is used in https://bugzilla.mozilla.org/show_bug.cgi?id=1939425

Pushed by jpages@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a7d90f7358af Report wasm function tier correctly to profiler with lazy tiering. r=rhunt

Backed out for causing sm bustages in WasmFrameIter.cpp.

Flags: needinfo?(jpages)
Pushed by jpages@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e8b6d2719806 Report wasm function tier correctly to profiler with lazy tiering. r=rhunt
Flags: needinfo?(jpages)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: