Skip to content

Enable eBPF tracing support (tracepoints, uprobes, tc) for x86_64 and arm64 6.1.158#27

Merged
bchalios merged 1 commit into
e2b-dev:mainfrom
lohith-atomicwork:enable-tracing-ebpf-support-6.1.158
Jul 16, 2026
Merged

Enable eBPF tracing support (tracepoints, uprobes, tc) for x86_64 and arm64 6.1.158#27
bchalios merged 1 commit into
e2b-dev:mainfrom
lohith-atomicwork:enable-tracing-ebpf-support-6.1.158

Conversation

@lohith-atomicwork

Copy link
Copy Markdown
Contributor

What

Enable the kernel tracing subsystem needed for eBPF tracing programs on the 6.1.158 guest kernels, for both architectures:

  • configs/x86_64/6.1.158.config / configs/arm64/6.1.158.config:
    • CONFIG_TRACEPOINTS=y
    • CONFIG_FTRACE=y
    • CONFIG_FUNCTION_TRACER=y
    • CONFIG_UPROBES=y
    • CONFIG_UPROBE_EVENTS=y
    • CONFIG_NET_CLS_BPF=y

Why

We run an eBPF-based runtime-security agent inside E2B sandboxes. With in-kernel BTF now enabled (#26), its eBPF programs still fail to load with load program: invalid argument, because the guest kernel has the entire kprobe/uprobe tracing stack compiled out — none of the symbols above are set, so the kernel rejects any tracing-type BPF program at load time regardless of BTF.

Scoped deliberately to exclude CONFIG_KPROBES/CONFIG_KPROBE_EVENTS. In this kernel, CONFIG_KPROBES has a hard depends on MODULES — enabling it would also require CONFIG_MODULES (loadable kernel module support), which is a materially bigger capability change than a tracing flag and off by design in this guest kernel. We're leaving kprobe-based support out of this PR and scoping it to what tracepoints + uprobes + the BPF traffic classifier (NET_CLS_BPF) can cover on their own, with no module-loading dependency.

Notes

  • Impact (not a no-op): unlike the BTF change in Enable CONFIG_DEBUG_INFO_BTF for x86_64 and arm64 6.1.158 #26 (pure debug info), this compiles in real infrastructure — the ftrace core and uprobe subsystem. That's a modest binary size increase plus ftrace's fixed nop-patching overhead, but no tracer or probe is actually active unless something explicitly attaches one (e.g., our agent's uprobe-based hooks). No existing kernel code paths, behavior, or struct layout change as a result.
  • Both arches aligned, consistent with the precedent from Enable CONFIG_DEBUG_INFO_BTF for x86_64 and arm64 6.1.158 #26 — identical six-line change applied to both x86_64 and arm64 configs.
  • Verified against the actual 6.1.158 kernel source (arch/Kconfig, kernel/trace/Kconfig, net/sched/Kconfig): none of these six symbols depend on CONFIG_MODULES, and their prerequisites (CONFIG_PERF_EVENTS, CONFIG_ARCH_SUPPORTS_UPROBES, CONFIG_MMU, CONFIG_NET_SCHED, CONFIG_NET_CLS, CONFIG_HAVE_FUNCTION_TRACER, CONFIG_TRACING_SUPPORT) are already enabled in both arch configs.

… arm64 6.1.158

Enable the kernel tracing subsystem needed for eBPF-based tracing programs
on the 6.1.158 guest kernels, keeping both architectures aligned:

- CONFIG_TRACEPOINTS=y
- CONFIG_FTRACE=y
- CONFIG_FUNCTION_TRACER=y
- CONFIG_UPROBES=y
- CONFIG_UPROBE_EVENTS=y
- CONFIG_NET_CLS_BPF=y

Why: we run an eBPF-based runtime-security agent inside E2B sandboxes.
With in-kernel BTF now enabled (e2b-dev#26), its eBPF programs still fail to
load with EINVAL, because the guest kernel has the entire kprobe/uprobe
tracing stack compiled out — none of the above symbols are set, so the
kernel rejects any tracing-type BPF program at load time.

This set intentionally excludes CONFIG_KPROBES/CONFIG_KPROBE_EVENTS,
which would additionally require CONFIG_MODULES (loadable kernel module
support) since CONFIG_KPROBES depends on MODULES in this kernel version.
That's a materially bigger capability change than a tracing flag, so
we're leaving kprobe-based support out of this PR and scoping it to what
uprobes + tracepoints + the BPF traffic classifier can cover.

Impact: this is not a no-op like a debug-info flag. It compiles in the
ftrace/uprobe infrastructure (a modest binary size increase and the
fixed nop-patching overhead ftrace's function tracer adds), but no
tracer or probe is actually active unless something explicitly attaches
one - e.g. our runtime-security agent's uprobe-based hooks. No existing
kernel code paths, behavior, or struct layout change as a result.

Verified against the actual 6.1.158 kernel source (arch/Kconfig,
kernel/trace/Kconfig, net/sched/Kconfig): none of these six symbols
depend on CONFIG_MODULES, and their existing prerequisites
(CONFIG_PERF_EVENTS, CONFIG_ARCH_SUPPORTS_UPROBES, CONFIG_MMU,
CONFIG_NET_SCHED, CONFIG_NET_CLS, CONFIG_HAVE_FUNCTION_TRACER,
CONFIG_TRACING_SUPPORT) are already enabled in both arch configs.
@cla-bot

cla-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @lohith-atomicwork on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check'

@lohith-atomicwork

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Jul 15, 2026
@cla-bot

cla-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@lohith-atomicwork

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot

cla-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@bchalios
bchalios merged commit 7316966 into e2b-dev:main Jul 16, 2026
15 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants