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

Create a fake mapping for profile.proto profiles #135

Merged
merged 2 commits into from
Apr 19, 2017

Conversation

aalexand
Copy link
Collaborator

@aalexand aalexand commented Apr 18, 2017

If a profile has mappings but no profiles, pprof may be unable to
symbolize it offline, as it uses the mappings to keep track of which
locations need symbolization.

This fixes #120.

Added the test, verified it fails on Mac with Go 1.7 before the fix, and
passes with the fix. The test is done by augmenting the existing test
for handling https+insecure:// scheme in URLs. This is a bit vague but I
figured that this test needed an updated anyway since as we moved it
recently we stopped exercising the symbolization as part of the test
which was its original intention in fixing #94. Can split the tests if
things do look too ugly.

If a profile has mappings but no profiles, pprof may be unable to
symbolize it offline, as it uses the mappings to keep track of which
locations need symbolization.

This fixes google#120.

Added the test, verified it fails on Mac with Go 1.7 before the fix, and
passes with the fix. The test is done by augmenting the existing test
for handling https+insecure:// schema in URLs. This is a bit vague but I
figured that this test needed an updated anyway since as we moved it
recently we stopped exercising the symbolization as part of the test
which was its original intention in fixing google#94. Can split the tests if
things do look too ugly.
if ui.IgnoreRx != "" {
if matched, err := regexp.MatchString(ui.IgnoreRx, fmt.Sprint(args)); matched || err != nil {
if err != nil {
ui.T.Error(args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably also include the error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fixed.

@codecov-io
Copy link

codecov-io commented Apr 18, 2017

Codecov Report

Merging #135 into master will increase coverage by 0.31%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #135      +/-   ##
=========================================
+ Coverage   54.59%   54.9%   +0.31%     
=========================================
  Files          29      29              
  Lines        5697    5697              
=========================================
+ Hits         3110    3128      +18     
+ Misses       2251    2230      -21     
- Partials      336     339       +3
Impacted Files Coverage Δ
internal/driver/fetch.go 65.98% <100%> (+4.42%) ⬆️
internal/driver/tempfile.go 56.25% <0%> (+31.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 813536d...1c8f1ab. Read the comment docs.

@aalexand aalexand assigned aalexand and rauls5382 and unassigned aalexand Apr 19, 2017
@rauls5382 rauls5382 merged commit 1047541 into google:master Apr 19, 2017
nolanmar511 added a commit to nolanmar511/pprof that referenced this pull request Jul 20, 2017
nolanmar511 added a commit to nolanmar511/pprof that referenced this pull request Jul 20, 2017
gmarin13 pushed a commit to gmarin13/pprof that referenced this pull request Dec 17, 2020
* Create a fake mapping for profile.proto profiles

If a profile has mappings but no profiles, pprof may be unable to
symbolize it offline, as it uses the mappings to keep track of which
locations need symbolization.

This fixes google#120.

Added the test, verified it fails on Mac with Go 1.7 before the fix, and
passes with the fix. The test is done by augmenting the existing test
for handling https+insecure:// schema in URLs. This is a bit vague but I
figured that this test needed an updated anyway since as we moved it
recently we stopped exercising the symbolization as part of the test
which was its original intention in fixing google#94. Can split the tests if
things do look too ugly.

* Fix the test to include the failed regex matching error in the message.
@aalexand aalexand deleted the aalexand-fix-no-mappings branch January 11, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pprof: ignores symbols in symbolized profile with no mappings
5 participants