Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing source code in the source view #3741

Open
7 of 14 tasks
mstange opened this issueDec 11, 2021· 5 comments
Open
7 of 14 tasks

Missing source code in the source view #3741

mstange opened this issueDec 11, 2021· 5 comments

Comments

@mstange
Copy link
Contributor

mstange commented Dec 11, 2021

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.

  • In profiles from official Firefox builds, captured within Firefox:
    • Source code for native code (C/C++/Rust) hosted on hg.mozilla.org
    • Source code for native code (C/C++/Rust) hosted on github (Rust standard library)
    • Generated sources for native code (C/C++/Rust) stored in an S3 bucket
    • Generated sources for macOS arm64 Firefox builds specifically (bug 1728882)
    • Source code for Firefox-internal JavaScript code (chrome:// etc.) which is hosted on hg.mozilla.org
    • Source code for JavaScript code from web pages
    • Source code for WebAssembly code from web pages
  • In profiles from local Firefox builds, captured within Firefox:
  • In profiles symbolicated with profiler-symbol-server or perfrecord:
  • In uploaded / published profiles, regardless of capturing tool:

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

This comment was marked as off-topic.

@personalizedrefrigerator
Copy link

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
Copy link

kg commented Mar 19, 2024

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
Copy link
Contributor Author

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
Copy link

kg commented Mar 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@kg @mstange @personalizedrefrigerator @IngridMi and others