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

Source lines for cpu samples present using --debug, but not using --profile #48839

Closed
CoderDake opened this issue Apr 19, 2022 · 2 comments
Closed
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@CoderDake
Copy link

CoderDake commented Apr 19, 2022

The CPU samples returned by getCpuSamples in devtools, are used to generate CPU profile data (which is used to populate the CPU profiler table).

When attached to the Flutter Gallery App run with --profile:

On the other hand, when Flutter Gallery App is run with --debug:

The end result is that source lines only appear to work when running the target application in --debug mode.

Details

Reproduced on

Targets:

  • MacOs
  • android

Dev Tools was run on MacOs

My Dart Version

  • Dart SDK Version (dart --version)
    • Dart SDK version: 2.18.0-34.0.dev (dev) (Tue Apr 19 01:34:32 2022 -0700) on "macos_x64"
@CoderDake
Copy link
Author

@bkonyi this is one you may be able to help with

@bkonyi bkonyi self-assigned this Apr 20, 2022
@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Apr 20, 2022
@bkonyi
Copy link
Contributor

bkonyi commented May 6, 2022

So I have this working now locally, but it has a non-negligible impact on the AOT snapshot size since we need to add token position information for each function (and if we wanted to be consistent, each field and class also) and line start arrays for each script.

Here's the sizes of the snapshots generated while building Flutter's image_list example:

-rw-r--r--   1 bkonyi  primarygroup  4965272 May  6 12:57 no_func_tokens.so
-rw-r--r--   1 bkonyi  primarygroup  5522328 May  6 12:47 with_func_tokens.so

For this relatively small application, we're seeing a 10% size regression, which is hardly ideal. If we really want to have line number information available for profiles (which I assume we do), we might need to consider other options (e.g., looking for the line/column information directly from the SourceLocation service objects rather than using token positions to map into the line starts arrays).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

3 participants