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

add startline to function when symbolizing elf #3648

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

albertlockett
Copy link
Contributor

Adds the StartLine to the profile Function during symbolization. This is needed to support pgo https://go.dev/doc/pgo#alternative-sources

Function.start_line must be set. This is the line number of the start of the function. i.e., the line containing the func keyword. The Go compiler uses this field to compute line offsets of samples (Location.Line.line - Function.start_line). Note that many existing pprof converters omit this field.

Tested using pprof that was collected by parca-agent & downloaded from pacra UI.

Before:

$ go build  -gcflags="all=-N -l" -o bin/ -pgo ~/Downloads/profile_before.pb ./my/test
# internal/coverage/rtcov
compile: /home/albertlockett/Downloads/profile(1).pb: PGO error: profile missing Function.start_line data (Go version of profiled application too old? Go 1.20+ automatically adds this to profiles)
# internal/goos
compile: /home/albertlockett/Downloads/profile(1).pb: PGO error: profile missing Function.start_line data (Go version of profiled application too old? Go 1.20+ automatically adds this to profiles)
# internal/goarch
compile: /home/albertlockett/Downloads/profile(1).pb: PGO error: profile missing Function.start_line data (Go version of profiled application too old? Go 1.20+ automatically adds this to profiles)
# internal/goexperiment

After:

$ go build  -gcflags="all=-N -l" -o bin/ -pgo ~/Downloads/profile_after ./my/test
# no problems

@albertlockett albertlockett requested a review from a team as a code owner August 18, 2023 19:22
@CLAassistant
Copy link

CLAassistant commented Aug 18, 2023

CLA assistant check
All committers have signed the CLA.

@albertlockett albertlockett marked this pull request as draft August 18, 2023 19:27
@albertlockett albertlockett marked this pull request as ready for review August 18, 2023 19:27
@brancz
Copy link
Member

brancz commented Aug 19, 2023

Looks a test needs to be adapted, otherwise lgtm!

@albertlockett
Copy link
Contributor Author

Looks a test needs to be adapted, otherwise lgtm!

thanks! fixed test 👍

@brancz brancz merged commit e9b8e36 into parca-dev:main Aug 22, 2023
34 checks passed
@manojVivek
Copy link
Contributor

@all-contributors Please add @albertlockett for code.

@allcontributors
Copy link
Contributor

@manojVivek

I've put up a pull request to add @albertlockett! 🎉

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

4 participants