firefox-devtools / profiler

Firefox Profiler — Web app for Firefox performance analysis
https://profiler.firefox.com
Mozilla Public License 2.0
1.19k stars 387 forks source link

Export a tool to extract gecko logs from a profile #4973

Closed julienw closed 6 days ago

julienw commented 5 months ago

deploy preview

One can use it this way:

// In the Devtools' Web Console
l = extractGeckoLogs()

// Then
// Either download to a file:
saveToDisk(l)

// or copy to the clipboard:
copy(l)

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

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.44%. Comparing base (1507cdd) to head (a457ad3). Report is 17 commits behind head on main.

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

acreskeyMoz commented 1 week ago

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) Current export: [Parent Process 158395 Socket Thread] D/nsSocketTransport engaging But when I capture MOZ_LOG's natively: [Parent 87530: Socket Thread]: D/nsSocketTransport engaging

• Naturally a button or similar would be better than console commands :) • I didn't find the performance to be a problem at all.

KershawChang commented 1 week ago

I've looked at the output log and it looks great! Thank you.

julienw commented 1 week ago

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 :-)