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

Allow newer kernels to opt into explicit loop and chunk limit overrides #2047

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,14 @@ auto SocketTraceConnector::InitPerfBufferSpecs() {
Status SocketTraceConnector::InitBPF() {
// set BPF loop limit and chunk limit based on kernel version
auto kernel = system::GetCachedKernelVersion();
if (kernel.version >= 5 || (kernel.version == 5 && kernel.major_rev >= 1)) {
auto loop_limit_is_default =
gflags::GetCommandLineFlagInfoOrDie("stirling_bpf_loop_limit").is_default;
auto chunk_limit_is_default =
gflags::GetCommandLineFlagInfoOrDie("stirling_bpf_chunk_limit").is_default;

// Do not automatically raise loop and chunk limits for non-default values.
if (loop_limit_is_default && chunk_limit_is_default &&
(kernel.version > 5 || (kernel.version == 5 && kernel.major_rev >= 1))) {
// Kernels >= 5.1 have higher BPF instruction limits (1 million for verifier).
// This enables a 21x increase to our loop and chunk limits
FLAGS_stirling_bpf_loop_limit = 882;
Expand Down
Loading