Commit 03184cc
authored
Allow newer kernels to opt into explicit loop and chunk limit overrides (#2047)
Summary: Allow newer kernels to opt into explicit loop and chunk limit
overrides
Overwriting non default values of the bpf chunk and loop limit is
frustrating since it undoes configuration a user explicitly requested.
This also will allow for working around #2042, which causes kernels 6.10
and later to fail to start the socket tracer.
In addition to this, I tweaked the kernel upgrade logic slightly. The
previous logic would have upgraded a 5.0.x kernel to use the new loop
limit when the 1M instruction limit isn't available until 5.1.
Relevant Issues: Helps to work around #2042
Type of change: /kind bugfix
Test Plan: Verified the following on a 6.x kernel running
`stirling_wrapper`
- [x] Not supplying any arguments results in using an increased loop and
chunk limit
```
$ sudo ./bazel-bin/src/stirling/binaries/stirling_wrapper
I20241118 05:52:37.358364 3104175 socket_trace_connector.cc:474] Kernel version greater than V5.1 detected (6.8.12), raised loop limit to 882 and chunk limit to 84
```
- [x] Supplying the loop limit or chunk limit flag disables the
automatic increase
```
$ sudo ./bazel-bin/src/stirling/binaries/stirling_wrapper --stirling_bpf_loop_limit=41
I20241118 05:53:21.082810 3104197 source_connector.cc:35] Initializing source connector: socket_tracer
I20241118 05:53:21.082886 3104197 kernel_version.cc:82] Obtained Linux version string from `uname`: 6.8.0-1015-gcp
I20241118 05:53:21.082916 3104197 linux_headers.cc:395] Detected kernel release (uname -r): 6.8.0-1015-gcp
I20241118 05:53:21.082964 3104197 linux_headers.cc:206] Using Linux headers from: /lib/modules/6.8.0-1015-gcp/build.
I20241118 05:53:21.083058 3104197 bcc_wrapper.cc:166] Initializing BPF program ...
```
Changelog Message: Ensures that the `--stirling_bpf_loop_limit` and
`--stirling_bpf_chunk_limit` values are respected if explicitly provided
on the command line. For 5.1 and later kernels, cli provided values
would have been ignored
---------
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>1 parent fd5cd63 commit 03184cc
File tree
1 file changed
+8
-1
lines changed- src/stirling/source_connectors/socket_tracer
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
464 | 471 | | |
465 | 472 | | |
466 | 473 | | |
| |||
0 commit comments