feat(validator): manifest program-type override (general form of #40 auto-type) + trace_dns case study#41
Merged
Merged
Conversation
Add a manifest-declared program-type override — `program_types:`
({program: <name-or-section>, type: <bpf-type>}) — the general form of the
socket-filter auto-typing: set any program's BPF type explicitly for objects
libbpf can't classify from the section name. Threaded through manifest schema
+ validation, runner tuning, the VM command line
(`--set-prog-type <program|section>=<type>`), and the validator (applied
before auto-typing, so an explicit override wins). Reported per override in
the run notes. Verified end-to-end: trace_dns's socket1 program is typed via
the override, then advances to the framework CO-RE boundary.
Also fold the trace_dns finding into docs/case-study-inspektor-gadget.md: it
hits two loader contracts — program type (now handled) then a CO-RE
relocation against IG's socket-enricher API (gadget_socket_value), the honest
boundary of standalone gadget validation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two pieces that were authored alongside the auto-typing in #40 but didn't make it into that squash-merge (this lands them on top of
main):Manifest-declared program-type override —
program_types:entries set a program's BPF type explicitly, the general form of the socket-filter auto-typing already inmain:Surfaced to the validator as
--set-prog-type <program|section>=<type>; applied before auto-typing so an explicit override wins. Threaded through manifest schema + validation, runner tuning, the VM command line, and the validator. Supported types: socket_filter, kprobe, tracepoint, raw_tracepoint, xdp, perf_event, cgroup_skb, cgroup_sock, sched_cls, sched_act, sk_skb, sk_msg, tracing, lsm. Reported per override in the run notes.trace_dns case-study finding in
docs/case-study-inspektor-gadget.md: trace_dns hits two loader contracts — program type (handled by auto-type / this override) then a CO-RE relocation against Inspektor Gadget's socket-enricher API typegadget_socket_value(BTF injected by the IG runtime). The latter is a framework dependency, not a kernel-compat gap — the honest boundary of standalone gadget validation.Verification
Verified end-to-end on the box earlier: a
program_types:manifest for trace_dns producedprogram type override applied: "socket1"(taking precedence over auto-typing), with the load then advancing to the framework CO-RE boundary. Tests added for manifest validation + CLI-arg construction;go build,go vet,gofmt,go test ./...clean; validator C compiles clean.🤖 Generated with Claude Code