-
Notifications
You must be signed in to change notification settings - Fork 71
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
pkg/agent: Use eBPF map batch operations #181
Conversation
e91265d
to
40ceae5
Compare
13b2588
to
772ae82
Compare
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.
It looks good to me.
We just need to clean up a minor thing.
@@ -53,6 +54,16 @@ const ( | |||
doubleStackDepth = 254 | |||
) | |||
|
|||
// stackCountKey mirrors the struct in parca-agent.bpf.c. | |||
// | |||
// TODO(derekparker) Perhaps in order to keep these in sync we should write a Go generator to |
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.
Awesome idea! Let's do it.
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.
Already the opened the issue for it #207
|
||
stackBytes, err := stackTraces.GetValue(unsafe.Pointer(&userStackID)) | ||
if err != nil { | ||
//profile.MissingStacks++ | ||
// TODO(derekparker): Should we log or increment missing stack trace count? |
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.
👍 Let's add a metric for it, not necessarily in this PR though. #208
// memsetCountKeys will reset the given slice to the given value. | ||
// This function makes use of the highly optimized copy builtin function | ||
// and is able to fill the entire slice in O(log n) time. | ||
func memsetCountKeys(in []stackCountKey, v stackCountKey) { |
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.
❤️
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.
🚀
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.
Let's clean up first.
This patch adds support for using eBPF batch operations on maps which should dramatically improve the performance of the parca-agent by enabling it to batch lookup and delete keys/values in maps in a single operation. This replaces the use of iterators in favor of iteration in batches. Fixes parca-dev#74
772ae82
to
e528c7c
Compare
Done! |
This patch adds support for using eBPF batch operations on maps which
should dramatically improve the performance of the parca-agent by
enabling it to batch lookup and delete keys/values in maps in a single
operation.
This replaces the use of iterators in favor of iteration in batches.
Fixes #74