firefox-devtools / profiler

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

Missing source code in the source view #3741

Open mstange opened 2 years ago

mstange commented 2 years ago

At the moment, the source view is only able to show source code in a small number of cases and only for native code (i.e. code compiled from C/C++/Rust). Over time, we should add support for more cases.

This issue tracks the implementation status of the various cases.

The various "native code" cases will be handled first. For anything involving JavaScript, we're still lacking the line number information in many cases (see bug 1441689).

┆Issue is synchronized with this Jira Task

IngridMi commented 2 years ago

This comment has been removed because it was offtopic.

personalizedrefrigerator commented 2 years ago

The profiler also seems to be unable to show source code for webpack-bundled files (Firefox 103.0, files bundled in development mode).

Edit: Nevermind! This would be included in Source code for JavaScript code from web pages.

kg commented 7 months ago

Hi, sorry for spam: The message I get when trying to view .wasm or .js for entries in the profiler is as follows:

Source code not available
See [issue #3741](https://github.com/firefox-devtools/profiler/issues/3741) for supported scenarios and planned improvements.
    There is no known cross-origin-accessible URL for this file.

I have CORS fully configured for the host and wide open, and I don't see failed network requests to retrieve it. Is this message misleading, and showing js/wasm source just isn't supported in the profiler yet? From looking at the tasks list I see "Source code for JavaScript code from web pages" isn't checked, and I assume that also encompasses webassembly code.

mstange commented 7 months ago

Hi Katelyn, I've filed #4940 for the case where the JS file is available via CORS - this is not something I had considered before so thank you for pointing it out. For WebAssembly, what would you expect to see in the source view? Formatted "WebAssembly text format" code? If you file an issue about the wasm case I can link it in the list above.

kg commented 7 months ago

Hi Katelyn, I've filed #4940 for the case where the JS file is available via CORS - this is not something I had considered before so thank you for pointing it out. For WebAssembly, what would you expect to see in the source view? Formatted "WebAssembly text format" code? If you file an issue about the wasm case I can link it in the list above.

Thank you very much! My point of reference for this is Chrome's devtools, which show formatted webassembly text format. They don't have line or instruction level time information, so it just shows the raw text with no annotations whatsoever and groups samples by function.

If there is no line/instruction-level information for wasm, I think the lack of wasm source appearing in the profiler is not terribly significant, to the point that I wouldn't ask for it - knowing the names of the hot functions is probably enough. The JS-level information could be very helpful though so I am happy to see an issue filed for it. It's nice that even without the source displayed, the line-level breakdown appears on the left side of the source pane.

I can also imagine there being challenges related to minified JS sources and sources with source maps, but that's mostly speculative until the feature works.