← Back to Pull requests

Relinquish 16.4 MiB by replacing `llc-bpf` with `clang-bpf` #57366

Closed
unknown closed this pull request without merging on Oct 02, 2026 16:56 UTC
View on GitHub
unknown unknown commented on Oct 01, 2026 23:47 UTC
Author

What does this PR do?


Make runtime eBPF compilation lower its LLVM IR with clang-bpf instead of llc-bpf, and stop shipping the latter.

Motivation


llc-bpf is shipped as its own standalone binary solely to turn the LLVM IR clang-bpf emits into BPF objects.

clang-bpf embeds the same LLVM 12.0.1 BPF backend llc-bpf does, confirmed via clang-bpf --version, so it can perform that step itself without shipping a second binary for it.

Describe how you validated your changes


Rebuilt offsetguess-test and runtime-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-module produced an object byte-for-byte identical to llc-bpf -march=bpf -filetype=obj, with no diagnostic from either:

  • 3,024 bytes for offsetguess-test,

  • 4,982,336 bytes for runtime-security.
  • Checked each flag's necessity by removing it in isolation and rebuilding runtime-security.

    Without -fno-addrsig, the object gains a .llvm_addrsig section (confirmed via readelf -S) that llc-bpf never emits.

    Without -Xclang -disable-llvm-optzns, the object differs by 912 bytes starting at byte 41, since clang re-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-module warning, since the IR's embedded target triple predates being retargeted to bpf.

    Additional Notes


    This only removes llc-bpf from the installed package and from runtime compilation, which runs on the end user's host.

    The ninja build still has its own llc rule (/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 provision llc-bpf.

    Diff: 267 lines (+200 / -67) across 3 files Reviewer: brycekahle Review duration: 1028m
    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
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.4% (MEDIUM) · Higher = larger blast radius
    39.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17% · Safe to merge
    17%