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

Fix pprof defaultSampleType #424

Merged
merged 1 commit into from
Jun 15, 2023
Merged

Conversation

vasi-stripe
Copy link
Contributor

Fixes #415

  • Interprets pprof's defaultSampleType as an index into the string table as documented in the proto, not as an index into the sample types repeated-field. This allows parsing to succeed when the string-table index is not a valid sampleTypes index, which is common on allocation profiles.
  • Update the pprof snapshot. This is necessarily because we were previously interpreting an empty defaultSampleType as truthy-but-zero when long.js is present, ie: the first sample-type. But Speedscope-in-the-browser doesn't seem to include long.js, so our tests were disagreeing with in-browser behavior. With this PR, that should be fixed.

@coveralls
Copy link

Coverage Status

coverage: 42.119% (+0.09%) from 42.032% when pulling 9fe2180 on vasi-stripe:vasi-pprof-default into 0414c2f on jlfwong:main.

@jlfwong jlfwong merged commit fcc1fa5 into jlfwong:main Jun 15, 2023
8 checks passed
@jlfwong
Copy link
Owner

jlfwong commented Jun 15, 2023

Thank you!

@jlfwong
Copy link
Owner

jlfwong commented Jun 22, 2023

This is now live on https://speedscope.app and published to npm as part of v1.15.2. Thanks for your contribution!

jackerghan pushed a commit to jackerghan/speedscope that referenced this pull request Jul 28, 2023
Fixes jlfwong#415

* Interprets pprof's defaultSampleType as an index into the string table [as documented in the proto](https://github.com/jlfwong/speedscope/blob/0414c2f617742e7fb0cf31a66ac0f77c2f5c0540/src/import/profile.proto#L85), not as an index into the sample types repeated-field. This allows parsing to succeed when the string-table index is not a valid sampleTypes index, which is common on allocation profiles.
* Update the pprof snapshot. This is necessarily because we were previously interpreting an empty defaultSampleType as truthy-but-zero when long.js is present, ie: the first sample-type. But Speedscope-in-the-browser doesn't seem to include long.js, so our tests were disagreeing with in-browser behavior. With this PR, that should be fixed.
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

Successfully merging this pull request may close these issues.

None yet

3 participants