Closed Bug 873128 Opened 11 years ago Closed 4 years ago

OdinMonkey: Feed source line number information to VTune

Categories

(Core :: JavaScript: WebAssembly, enhancement, P5)

x86_64
Linux
enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: sstangl, Unassigned)

References

Details

(Whiteboard: [gaming-tools])

Attachments

(4 files, 8 obsolete files)

OdinMonkey's VTune instrumentation is currently lacking source file and line number information.
Attached patch WIP patchSplinter Review
WIP patch from a while ago, which maps byte offset to (line, column) in CodeGenerator::visitSourceNote(). I plan to hook the information up to VTune when I'm back in the office and can test.
Attached patch WIP v1 (obsolete) — Splinter Review
Takes Sean's previous patch and hooks it into the VTune data. Right now, it still looks to be off by one line, but it's a start.
Attached patch WIP v1 (obsolete) — Splinter Review
Minor fix to previous
Attachment #752825 - Attachment is obsolete: true
Getting the patch actually updated this time.
Attachment #752830 - Attachment is obsolete: true
Attached patch Maybe fix off-by-one line error. (obsolete) — Splinter Review
This may fix the line numbering, by making it so that each LSourceNote is visited after the instruction it is bound to, instead of before: VTune apparently uses bounds in the opposite direction I expected it to.
Attachment #752997 - Attachment is obsolete: true
Yes, it appears your fix works; at least I can make sense of most of the lines that are in bullet.js and copy.js from the emscripten test suite.

There are some lines which aren't mapped to any asm. Is this expected?
Attached patch Rebased, with minor fix. (obsolete) — Splinter Review
Minor fix to visitSourceNote for the case in which the sourceLineVector_ is empty.  Also rebased.

Bug 873522 also needs asm.js source info for perf and currently crashes on asm.js code, and perhaps there is an opportunity to refactor.
The opcode offset passed to vtune seemed to be wrong, pointing to the start of the next instruction, rather than the last byte of the previous instruction.

The strategy of adding LIR SourceNote instructions was problematic for the last instruction in blocks and not working for these.  This patch tries a different approach.
Attachment #761424 - Attachment is obsolete: true
Attached patch Rebase. (obsolete) — Splinter Review
Attachment #761918 - Attachment is obsolete: true
Blocks: 891541
I was attempting to rebase the patch from Comment 10 on top of the recent Perf changes, but it looks like at least one file is missing (defining LineNumberInfo).
Flags: needinfo?(doug)
Attached patch Fix include files. (obsolete) — Splinter Review
Some of the include files seem to have been remove in another patch.  Perhaps this helps.
Flags: needinfo?(doug)
Attached patch Rebased, WIP. (obsolete) — Splinter Review
Here's my WIP in case it helps.  Note that there is an unresolved issue with the saving of a pointer to a JSAtom for the function name.  On the ARM this causes corruption (similar perf profiling support), and I have seem some crashes on the x86 and x64 too using vtune which this might have contributed to.  There is a hack workaround that malloc's storage for the name, but I intend to study up on the GC code and fix it appropriately - help would be appreciated.
Attachment #762631 - Attachment is obsolete: true
Support for noting more dynamic regions is being added for the 'perf' support, and this would help using vtune too.  For example: exit and entry trampolines etc, baseline code, asm.js entry and exits regions.
Attached patch Rebase.Splinter Review
Just a rebase.  Compiles. Not tested.  Assumes that the 'perf' support patch of bug 893363 has been applied.
Attachment #773013 - Attachment is obsolete: true
Attachment #773014 - Attachment is obsolete: true
I'm going to abandon this approach because:

* there is block level source info in the 'perf' support and perhaps it would better to use this for vtune.

* its not clear that the event counts are accurate to the instruction level.  Even if they were this accurate, vtune allows a side-by-side view of the source and the assembler code and gives the instruction level counts that can be manually related back to code in a block.

There is one more rebase in the pipeline that will be submitted after some other patches land.
Assignee: general → nobody
Priority: -- → P3
Whiteboard: [gaming-tools]
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Component: JavaScript Engine → Javascript: WebAssembly
Type: defect → enhancement
OS: All → Linux
Priority: P3 → P5
Hardware: All → x86_64

No action for six years and neither contributer is working on this any longer.

Status: REOPENED → RESOLVED
Closed: 6 years ago4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: