program, btf: probe correct log buffer size#1500
Merged
lmb merged 2 commits intocilium:mainfrom Jul 3, 2024
Merged
Conversation
For some reason the Action decided to break now, after being updated a couple of weeks ago. Signed-off-by: Lorenz Bauer <[email protected]>
0efaff5 to
7cfb785
Compare
florianl
reviewed
Jul 3, 2024
dylandreimerink
approved these changes
Jul 3, 2024
Member
dylandreimerink
left a comment
There was a problem hiding this comment.
LGTM other than the bit Florian already pointed out
The kernel exposes a log of operations to aid debugging a program
or BTF load. Until recently there was no way to know the size of
that buffer, so the library forces the user to specify a buffer
size. From a cursory survey on sourcegraph.com it seems that
users either hardcode a large fixed buffer or probe the correct
size by doubling the buffer size when hitting ENOSPC.
Since commit 47a71c1f9af0 ("bpf: Add log_true_size output field
to return necessary log buffer size") the kernel does provide a
hint to user space.
Move probing of the correct log buffer size into the library. On
recent (>= 6.4) kernels this is guaranteed to work in a single
call. On older kernels we use the doubling strategy employed by
cilium and tetragon.
Signed-off-by: Lorenz Bauer <[email protected]>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ci: fix golangci-lint
program, btf: probe correct log buffer size