Closed
Bug 974700
Opened 11 years ago
Closed 11 years ago
cached asm.js doesn't cache profiled function info
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: vlad, Assigned: luke)
Details
Attachments
(1 file, 2 obsolete files)
20.53 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
If cached asm.js code is being used, Module._profiledFunctions is always empty, thus leading to no function data being sent to VTune.
I don't know if it would be prohibitive to cache the data that would be needed to build up profiledFunctions; that would be ideal so that we could recreate it. Alternatively, we can disable caching if vtune is connected... but that has the problem of not letting us actually profile cached startup reliably.
![]() |
Assignee | |
Comment 1•11 years ago
|
||
Oops, this isn't too hard to fix; just some extra members of the AsmJSModule that need to get serialized.
In the meantime, you can disable caching with javascript.options.parallel_parsing = false.
Reporter | ||
Comment 2•11 years ago
|
||
I don't think that's enough -- that would mean that the code would have to be cached while running under a profiler for that information to get serialized, since it's not saved normally.
My current source hack is to just disable cache loading if vtune profiling is enabled, which gets me around the problem, but would be nice to have a full fix for this so that people can use this without too much worry.
![]() |
Assignee | |
Comment 3•11 years ago
|
||
We can just take out the IsVTuneProfilingActive() check in GenerateCode() and then we'll always record the ProfiledFunction information when --enable-profiling.
![]() |
Assignee | |
Comment 4•11 years ago
|
||
Does this patch fix it? Note: there might be a few trivial compile errors on Windows+VTune; I only tested with --enable-profiling on Linux+perf (which mostly reuses the same code).
Comment 5•11 years ago
|
||
Might it be useful to add a flag to the data stored in the cache to note when the profiling info is included in the cache. This could allow the recording of the profiling info to be avoided when not needed. Might the memory usage be significant for some development work - the profiling build is my default. Might this be needed in the case that a non-profiling build firstly compiles the asm.js code and stores it in the cache, and then the user rebuilds with profiling enabled?
![]() |
Assignee | |
Comment 6•11 years ago
|
||
I'm just storing per-function profiling info which should be relatively small. I just realized the patch only always stores profiling info for VTune, not Linux perf. I can fix that.
> Might this be needed in the case that a non-profiling build
> firstly compiles the asm.js code and stores it in the cache, and then the
> user rebuilds with profiling enabled?
By "profiling build" do you mean FF itself (--enable-profiling) or do you mean FF (with --enable-profiling) compiled when profiling is active (IsVTuneProfilingActive()/PerfFuncEnabled())? In the former case, an --enable-profiling build won't get cache hits from a --disable-profiling build (the buildid of FF is part of the cache key). In the latter case, then profiling data is stored even when profiling isn't active, so it'll already be present when profiling is enabled.
![]() |
Assignee | |
Comment 7•11 years ago
|
||
Oops, I meant to flag Vlad for review in the last patch. This patch has a few tweaks.
Attachment #8379070 -
Attachment is obsolete: true
Attachment #8379070 -
Flags: feedback?
Attachment #8379755 -
Flags: feedback?(vladimir)
![]() |
Assignee | |
Comment 8•11 years ago
|
||
And by review I meant "feedback" to see if this actually fixes the problem.
Reporter | ||
Comment 9•11 years ago
|
||
Comment on attachment 8379755 [details] [diff] [review]
fix-vtune
I admit I haven't had a chance to test it yet, but it looks like it will get the job done.
Attachment #8379755 -
Flags: feedback?(vladimir) → feedback+
![]() |
Assignee | |
Comment 10•11 years ago
|
||
Could I leave it f?you until you do have a chance to try whether it actually works?
Reporter | ||
Comment 11•11 years ago
|
||
Ah I guess you asked if you can leave it f? but didn't actually leave it f? :)
So, I lied earlier. This did not work for me after a reload/rerun; functions showed up as addresses that were previously named.
Reporter | ||
Comment 12•11 years ago
|
||
I lied in comment #11. I was looking at a different view of the profile, and I thought I was seeing addresses where I should have seen functions, but they were actual valid addresses (inside some kernel and gfx drivers). Final verdict: patch works fine.
![]() |
Assignee | |
Comment 13•11 years ago
|
||
Comment on attachment 8379755 [details] [diff] [review]
fix-vtune
woot, thanks
Attachment #8379755 -
Flags: review?(benj)
![]() |
Assignee | |
Comment 14•11 years ago
|
||
Oops, previous patch built with --enable-vtune but not --enable-perf.
Attachment #8379755 -
Attachment is obsolete: true
Attachment #8379755 -
Flags: review?(benj)
Attachment #8396524 -
Flags: review?(benj)
Comment 15•11 years ago
|
||
Comment on attachment 8396524 [details] [diff] [review]
fix-vtune
Review of attachment 8396524 [details] [diff] [review]:
-----------------------------------------------------------------
I was trying to find a single constructive comment on the new code, but can't find any. Great work!
::: js/src/jit/AsmJSModule.h
@@ -448,5 @@
> for (unsigned i = 0; i < profiledFunctions_.length(); i++)
> profiledFunctions_[i].trace(trc);
> #endif
> #if defined(JS_ION_PERF)
> - for (unsigned i = 0; i < profiledFunctions_.length(); i++)
wow, that pretty looks like a bug, whenever perf and vtune are activated in the mean time. Thanks for deleting that!
Attachment #8396524 -
Flags: review?(benj) → review+
![]() |
Assignee | |
Comment 16•11 years ago
|
||
Comment 17•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•