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 address normalization #806

Merged
merged 3 commits into from
Mar 24, 2022

Conversation

kakkoyun
Copy link
Member

@kakkoyun kakkoyun commented Mar 24, 2022

With yet to be release version of Parca Agent, we normalized addresses on the agent side. So no need to consider the mapping to normalize in the server-side for the profiles generated by the agent.

// NOTICE: We only store a single version of a mapping.
// Which means the m.Start actually correct for a single process.
// For a multi-process shared library, this will always be wrong.
// And storing the mapping for each process will be very expensive.

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
@kakkoyun kakkoyun requested a review from brancz March 24, 2022 15:34
@@ -250,7 +258,11 @@ func (pn *profileFlatNormalizer) mapMapping(ctx context.Context, src *profile.Ma
return mapInfo{}, err
}
if m != nil {
mi := mapInfo{m, int64(m.Start) - int64(src.Start)}
// NOTICE: We only store a single version of a mapping.
Copy link
Member Author

Choose a reason for hiding this comment

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

@brancz I think this is the most important bit.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe slightly extend the comment with: "Which is why the client sending the profiling data can choose to normalize the mapping and address. In a future iteration of the wire format, XYZ should be included to prevent this dilemma or forcing the client to be smart in one direction or the other."

@kakkoyun kakkoyun requested a review from metalmatze March 24, 2022 15:37
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
@kakkoyun kakkoyun force-pushed the fix_address_normalization branch from ed6de6f to 4e85941 Compare March 24, 2022 15:43
@@ -31,7 +31,7 @@ func TestMappingKeyBytes(t *testing.T) {
Offset: 2,
}

require.Equal(t, MakeMappingKey(m), []byte{
require.Equal(t, []byte{
Copy link
Member Author

Choose a reason for hiding this comment

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

This has changed because expected should be first and actual the second.

@kakkoyun
Copy link
Member Author

I think actions are completely out-of-order right now.

Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

I can't wait to see this work. 💯 🎉

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
@kakkoyun kakkoyun merged commit 182cd09 into parca-dev:main Mar 24, 2022
@kakkoyun kakkoyun deleted the fix_address_normalization branch March 24, 2022 15:55
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.

2 participants