Export a tool to extract gecko logs from a profile#4973
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4973 +/- ##
==========================================
+ Coverage 88.43% 88.44% +0.01%
==========================================
Files 304 304
Lines 27581 27607 +26
Branches 7458 7465 +7
==========================================
+ Hits 24390 24416 +26
Misses 2963 2963
Partials 228 228 ☔ View full report in Codecov by Sentry. |
7610fed to
28b7d5f
Compare
659379e to
a6f03e9
Compare
a6f03e9 to
de22a3e
Compare
|
Hey @julienw -- this seems to work very well for me! I've asked the necko folks to add feedback as well. • The output didn't seem to be recognized by logan -- there might be a small export change required (this is a guess) • Naturally a button or similar would be better than console commands :) |
valenting
left a comment
There was a problem hiding this comment.
This is really great, @julienw
I've confirmed that with my suggested change the logs can be loaded into https://mozilla-necko.github.io/logan/
Thanks!
| ); | ||
| const processName = thread.processName ?? 'Unknown Process'; | ||
| // TODO: lying about the log level as it's not available yet in the markers | ||
| const statement = `${strTimestamp} - [${processName} ${thread.pid} ${thread.name}] D/${data.module} ${data.name.trim()}`; |
There was a problem hiding this comment.
| const statement = `${strTimestamp} - [${processName} ${thread.pid} ${thread.name}] D/${data.module} ${data.name.trim()}`; | |
| const statement = `${strTimestamp} - [${processName} ${thread.pid} ${thread.name}]: D/${data.module} ${data.name.trim()}`; |
The format for MOZ_LOG has a colon after the ]
de22a3e to
a516873
Compare
|
I've looked at the output log and it looks great! |
a516873 to
a457ad3
Compare
|
Thanks all, I made the requested changes and added a test! I also tested after the changes that logan would be able to import the resulting file. This should now be ready for review :-) |
| return `${d.getFullYear()}-${pad(d.getUTCMonth() + 1, 2)}-${pad(d.getUTCDate(), 2)} ${pad(d.getUTCHours(), 2)}:${pad(d.getUTCMinutes(), 2)}:${pad(d.getUTCSeconds(), 2)}.${pad(d.getUTCMilliseconds(), 3)}${pad(ns, 6)} UTC`; | ||
| } | ||
|
|
||
| const all = []; |
There was a problem hiding this comment.
nit: could be better to name it to something like logs or allLogs
There was a problem hiding this comment.
good point, this was a leftover from the hacky origin of this PR. :-) changed it to logs
a457ad3 to
a71f4b4
Compare
[Julien Wajsberg] Two optimizations for the marker chart (#5121) [Nazım Can Altınova] [Tab selector 5] Add a tab selector component and implement tab switching (#5093) [Julien Wajsberg] Support profiling from the toolbox in Thunderbird Release (#5135) [Richard Fine] Add a dedicated symbolication tool (#5123) [Julien Wajsberg] Export a tool to extract gecko logs from a profile (#4973) Shout-out to our localizers: de: Michael Köhler el: Jim Spentzos en-CA: chutten en-GB: Ian Neal es-CL: ravmn fr: Théo Chevalier fy-NL: Fjoerfoks ia: Melo46 it: Francesco Lodolo [:flod] nl: Mark Heijl pt-BR: Marcelo Ghelman ru: Valery Ledovskoy sv-SE: Andreas Pettersson uk: Lobodzets zh-CN: Olvcpr423 zh-TW: Pin-guang Chen
|
Used this again today, very nice ;) |
deploy preview
One can use it this way:
This takes into account the current range (both selection range and committed range).
It is a little bit slow because running inside the web console runs the code only in the JS interpreter and never starts the JIT (I think). But I think it's still OK.
Fixes #4660