Closed
Bug 1006630
Opened 11 years ago
Closed 4 years ago
Emit TraceLogger events from wasm compilers
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
RESOLVED
INACTIVE
People
(Reporter: bbouvier, Unassigned)
References
Details
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
luke
:
feedback+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
luke
:
feedback+
|
Details | Diff | Splinter Review |
This bug takes care of Tracelogger integration in Odin, for more precise profiling.
Reporter | ||
Comment 1•11 years ago
|
||
TraceLogger, when creating a text identifier for a given function (to put in the scripts list), needs a filename at least. The text id is created with the CompileOptions. In case of dynamic linking failure, we don't provide a filename in the CompileOptions, text id creation crashes because it has an assertion that uses the filename. This one-liner fixes it.
Note that we don't provide lineno and colno either. More work could be made to retrieve it from the ScriptSource, I suppose, but that's an edge case so we shouldn't be too interested in this one.
Attachment #8418152 -
Flags: review?(hv1989)
Reporter | ||
Comment 2•11 years ago
|
||
With this, tracelogger is now capable of knowing when time is spent in:
- OdinMonkey compilation (redundant with the compilation time report)
- OdinMonkey, aka running under Odin.
Attachment #8418154 -
Flags: review?(hv1989)
Attachment #8418154 -
Flags: feedback?(luke)
Reporter | ||
Comment 3•11 years ago
|
||
This one adds support for logging:
- Odin linking.
- Odin entry trampoline calls (OdinEntry). Logging from the time we enter CallAsmJS, as splitting it into two parts (C++ CallAsmJS and later the assembly trampoline) didn't add more value in my opinion.
- Odin exit trampoline calls (into the interpreter and Ion).
These ones are less important, unless for very specific test cases. Thinking about it, I think we'd want them but maybe not enable them by default. Any thoughts?
Attachment #8418156 -
Flags: review?(hv1989)
Attachment #8418156 -
Flags: feedback?(luke)
Comment 4•11 years ago
|
||
Comment on attachment 8418154 [details] [diff] [review]
Main integration
Review of attachment 8418154 [details] [diff] [review]:
-----------------------------------------------------------------
So every engine currently reports:
LogStartScript
LogStartEngine (a.k.a. interpreter/baseline/ionmonkey)
LogStopEngine
LogStopScript
This is because the graphs groups the information per script. It should be better if we can log a filename/lineno so this get's grouped there...
Is that possible?
Else the patch looks good!
Attachment #8418154 -
Flags: review?(hv1989)
Comment 5•11 years ago
|
||
Comment on attachment 8418156 [details] [diff] [review]
Extra loggings
Review of attachment 8418156 [details] [diff] [review]:
-----------------------------------------------------------------
OdinLinking looks interesting for me. It might also be good to again have a TraceLoggerStartScript before that. So it get's grouped under the right filename:lineno:co
I'm don't really understanding the purpose of
- OdinEntry
- OdinFFIInterpreterExit
- OdinFFIIonExit
I think you want them to see how long the trampoline duration is?
In that case I would just create a "Trampoline" text id.
And start/stop in the right places?
It is easily visible about which trampoline is busy, by looking at which engine was running and to which engine we go...
I don't think we need to have specific names for these...
Attachment #8418156 -
Flags: review?(hv1989)
Updated•11 years ago
|
Attachment #8418152 -
Flags: review?(hv1989) → review+
Comment 6•11 years ago
|
||
Comment on attachment 8418154 [details] [diff] [review]
Main integration
Review of attachment 8418154 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/AsmJS.cpp
@@ +7100,5 @@
> + if (cx->isJSContext())
> + logger = TraceLoggerForMainThread(cx->asJSContext()->runtime());
> + else
> + logger = TraceLoggerForCurrentThread();
> + AutoTraceLog log(logger, TraceLogger::OdinCompilation);
Since it's the top-level of the whole process, I'd like to keep js::CompileAsmJS pretty tidy; perhaps you could wrap this logic in an AutoTraceLogAsmJS class so that js::CompileAsmJS contains only a single:
AutoTraceLogAsmJS log(cx);
?
Attachment #8418154 -
Flags: feedback?(luke) → feedback+
Comment 7•11 years ago
|
||
Comment on attachment 8418156 [details] [diff] [review]
Extra loggings
Review of attachment 8418156 [details] [diff] [review]:
-----------------------------------------------------------------
Nice!
::: js/src/vm/TraceLogging.h
@@ +121,5 @@
> _(IonLinking) \
> _(IonMonkey) \
> _(MinorGC) \
> _(OdinCompilation) \
> + _(OdinEntry) \
Oh, I forgot in the previous review too: I've generally avoided using "Odin" as a prefix anywhere in the code; can you use AsmJS as the prefix?
Attachment #8418156 -
Flags: feedback?(luke) → feedback+
Reporter | ||
Comment 8•11 years ago
|
||
Comment on attachment 8418152 [details] [diff] [review]
Fix link failure issue
Added this patch in bug 1009603, as it's part of the failures.
Attachment #8418152 -
Attachment is obsolete: true
Comment 9•9 years ago
|
||
Was just looking into some windows performance issue using tracelogger. Sadly it doesn't understand odinmonkey yet.
Would it be hard to refactor this to work on tip?
Reporter | ||
Comment 10•9 years ago
|
||
Not too hard (it needs to be entirely rewritten), but not on my radar right now. I can get back to it later, though.
Assignee: bbouvier → nobody
Status: ASSIGNED → NEW
Reporter | ||
Comment 11•8 years ago
|
||
Getting back on it these days. I've got a basic patch working, but I'd like to make it work for both baseline/ion compiled function, at the function level.
Assignee: nobody → bbouvier
Status: NEW → ASSIGNED
Flags: needinfo?(bbouvier)
Priority: -- → P3
Reporter | ||
Updated•8 years ago
|
Flags: needinfo?(bbouvier)
Reporter | ||
Updated•6 years ago
|
Assignee: bbouvier → nobody
Status: ASSIGNED → NEW
Summary: TraceLogger: Odin integration → TraceLogger: Baldr integration
Reporter | ||
Updated•5 years ago
|
Component: JavaScript Engine: JIT → Javascript: WebAssembly
Comment 12•5 years ago
|
||
No reason this should be restricted to Baldr.
I see a lot of AutoTraceLog usage in Ion, so maybe we can simply reuse that logic for the wasm compilers.
Summary: TraceLogger: Baldr integration → Emit TraceLogger events from wasm compilers
Updated•5 years ago
|
Type: defect → enhancement
Comment 13•4 years ago
|
||
We'll reopen this if better logging becomes desirable.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INACTIVE
You need to log in
before you can comment on or make changes to this bug.
Description
•