Relinquish 16.4 MiB by replacing `llc-bpf` with `clang-bpf` #57366
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 267 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.334
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #57366"
general
weight: 0.35
brycekahle
What does this PR do?
Make runtime eBPF compilation lower its LLVM IR with
clang-bpfinstead ofllc-bpf, and stop shipping the latter.Motivation
llc-bpfis shipped as its own standalone binary solely to turn the LLVM IRclang-bpfemits into BPF objects.clang-bpfembeds the same LLVM 12.0.1 BPF backendllc-bpfdoes, confirmed viaclang-bpf --version, so it can perform that step itself without shipping a second binary for it.Describe how you validated your changes
Rebuilt
offsetguess-testandruntime-security, the smallest and largest of the 9 runtime compilation bundles, from their flattened sources with the default compilation flags.For both,
clang-bpf -target bpf -O2 -Xclang -disable-llvm-optzns -fno-addrsig -Wno-override-moduleproduced an object byte-for-byte identical tollc-bpf -march=bpf -filetype=obj, with no diagnostic from either:offsetguess-test,runtime-security.Checked each flag's necessity by removing it in isolation and rebuilding
runtime-security.Without
-fno-addrsig, the object gains a.llvm_addrsigsection (confirmed viareadelf -S) thatllc-bpfnever emits.Without
-Xclang -disable-llvm-optzns, the object differs by 912 bytes starting at byte 41, sinceclangre-runs its own optimizer on IR already optimized once at-O2.That flag made no observable difference on the much smaller
offsetguess-test.Without
-Wno-override-module, the object is unchanged.It only suppresses a
-Woverride-modulewarning, since the IR's embedded target triple predates being retargeted tobpf.Additional Notes
This only removes
llc-bpffrom the installed package and from runtime compilation, which runs on the end user's host.The ninja build still has its own
llcrule (/opt/datadog-agent/embedded/bin/llc-bpf -march=bpf -filetype=obj) compiling the prebuilt CO-RE objects at CI build time, unaffected by this change.KMT and dev images (
tools/ebpf/Dockerfiles/Dockerfile-security-agent-dev,Dockerfile-process-agent-dev) also still provisionllc-bpf.