-
Notifications
You must be signed in to change notification settings - Fork 610
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(ebpf): merge equal samples #2788
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Value: []int64{scaledValue}, | ||
} | ||
p.sampleHashToSample[h] = sample | ||
p.tmpLocations = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must be a leftover?
p.tmpLocationIDs = append(p.tmpLocationIDs, loc.ID) | ||
} | ||
p.hash.Reset() | ||
if _, err := p.hash.Write(uint64Bytes(p.tmpLocationIDs)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to Write
? Is there a way to Sum64([]byte)
?
Regular stacktraces are agregated in ebpf program by increasing value in the ebpf maps
Python stacktraces are different, they are sent to userspace as is without any aggregation, so we may end up with multiple equal samples and values=1.
In this PR I aggregate python samples so that pprofs are smaller.
In the future we may try to aggregate python samples in ebpf (this require adding hashing function to ebpf)