/vibe:tracingfrom vibe
Guides choice of BPF tracing hooks (tracepoint, kprobe, fentry, uprobe, etc.) and shows concrete C examples. Useful for developing eBPF programs that observe kernel or userspace behavior.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
workflows/testing.md.tracepoint for the most portable stable kernel events.tp_btf on modern kernels when you want typed tracepoint arguments.kprobe / kretprobe when no stable tracepoint exists.BPF_KSYSCALL for portable syscall entry tracing.uprobe / uretprobe for userspace function visibility.fentry / fexit when BTF is available and lower overhead matters.perf_event for sampling rather than event-per-call tracing.lsm only when you need policy enforcement, not just observation.Attach to any kernel function entry or return. Use when no stable tracepoint exists for the function you need.
When to use it:
SEC("kprobe/tcp_connect")
int BPF_KPROBE(handle_tcp_connect, struct sock *sk) {
u32 pid = bpf_get_current_pid_tgid() >> 32;
bpf_printk("pid=%d connecting\n", pid);
return 0;
}
SEC("kretprobe/tcp_connect")
int BPF_KRETPROBE(handle_tcp_connect_ret, int ret) {
bpf_printk("tcp_connect returned %d\n", ret);
return 0;
}
Notes:
BPF_KPROBE / BPF_KRETPROBE macros unpack struct pt_regs *ctx into named args automaticallykprobe/<func> in the SEC nameAttach one program to multiple functions in a single syscall. Supports glob patterns and is significantly cheaper than attaching N individual kprobes.
// Attach to all spin_lock variants in one shot
SEC("kprobe.multi/spin_*lock*")
int BPF_KPROBE(handle_spin_lock) {
u32 pid = bpf_get_current_pid_tgid() >> 32;
bpf_printk("spin_lock pid=%d\n", pid);
return 0;
}
// Wildcard suffix — handles compiler-inlined/renamed variants of a function
// e.g. __netif_receive_skb_core.isra.0, __netif_receive_skb_core.constprop.1
SEC("kprobe.multi/__netif_receive_skb_core*")
int BPF_KPROBE(handle_netif_rx) { return 0; }
Attaching (libbpf):
// Attach by pattern
LIBBPF_OPTS(bpf_kprobe_multi_opts, opts, .syms = syms, .cnt = cnt);
struct bpf_link *link = bpf_program__attach_kprobe_multi_opts(prog, NULL, &opts);
Notes:
* suffix whenever a kernel function is frequently inlined or has compiler suffixeskretprobe.multi/func* works the same way for return probesbpf_get_func_ip(ctx) returns the address of the specific function that firedWhen attaching the same logic to many functions, use a macro to avoid boilerplate:
#define PROBE(fname) \
SEC("kprobe/" #fname) \
int fname##_entry(struct pt_regs *ctx) { \
record_entry(#fname); \
return 0; \
}
PROBE(vfs_read)
PROBE(vfs_write)
PROBE(vfs_open)
Portable syscall probing. Handles architecture-specific syscall ABI differences (e.g., __x64_sys_open vs __arm64_sys_open) so you don't have to.
When to use it:
SEC("kprobe")
int BPF_KSYSCALL(handle_sys_open, const char *filename, int flags, umode_t mode) {
char buf[256];
bpf_probe_read_user_str(buf, sizeof(buf), filename);
bpf_printk("open: %s flags=%d\n", buf, flags);
return 0;
}
Notes:
BPF_KSYSCALL instead of BPF_KPROBE for syscall entry pointsSEC("kprobe") without a function name; attach manually or via libbpf bpf_program__attach_ksyscall()Probe userspace functions in a binary or library. No source changes needed — works on any ELF binary.
When to use it:
SEC("uprobe/func_name")
int BPF_UPROBE(handle_func, int arg0, int arg1) {
bpf_printk("uprobe hit: arg0=%d arg1=%d\n", arg0, arg1);
return 0;
}
SEC("uretprobe/func_name")
int BPF_URETPROBE(handle_func_ret, int ret) {
bpf_printk("uretprobe: ret=%d\n", ret);
return 0;
}
Notes:
bpf_program__attach_uprobe(prog, false, pid, "/path/to/binary", func_offset)bpf_sym_to_addr or nm/objdump to find function offsetsSSL_read/SSL_write), language runtimes, database driversAttach to stable, pre-defined kernel tracepoints. Most portable option — tracepoint ABIs are stable across kernel versions.
When to use it:
SEC("tp/syscalls/sys_enter_openat")
int handle_openat(struct trace_event_raw_sys_enter *ctx) {
char fname[256];
bpf_probe_read_user_str(fname, sizeof(fname), (void *)ctx->args[1]);
bpf_printk("openat: %s\n", fname);
return 0;
}
Notes:
bpftrace -l 'tracepoint:*' or ls /sys/kernel/debug/tracing/eventsstruct trace_event_raw_<name> — defined in vmlinux.hLike tracepoint but receives raw, unprocessed arguments. Slightly more overhead to use but avoids the kernel's argument transformation step.
When to use it:
SEC("raw_tp/sched_switch")
int BPF_PROG(handle_sched_switch) {
// args available via BPF_PROG macro
return 0;
}
Notes:
u64 *ctx — cast manually or use BPF_PROG macroBTF-typed raw tracepoint. Gets the best of both worlds: stable tracepoint attachment + direct native type access without BPF_CORE_READ.
When to use it:
SEC("tp_btf/sched_process_exec")
int BPF_PROG(handle_exec, struct task_struct *p, pid_t old_pid,
struct linux_binprm *bprm) {
// access fields directly — no BPF_CORE_READ needed
u32 pid = p->pid;
return 0;
}
Notes:
raw_tp and tp when the kernel is recent enoughBTF-based function hooks. Lower overhead than kprobe (no int3 breakpoint). fexit uniquely has access to both input args and the return value at the same time.
When to use it:
fexit when you need both arguments and return value togetherfmod_ret only when controlled return-value override is actually intendedSEC("fentry/tcp_connect")
int BPF_PROG2(handle_fentry, struct sock *, sk) {
bpf_printk("fentry: tcp_connect\n");
return 0;
}
SEC("fexit/tcp_connect")
int BPF_PROG2(handle_fexit, struct sock *, sk, int, ret) {
bpf_printk("fexit: ret=%d\n", ret);
return 0;
}
// fmod_ret — modify return value
SEC("fmod_ret/security_file_permission")
int BPF_PROG2(handle_fmod, struct file *, file, int, mask) {
// return 0 to let original run; return non-zero to override
return 0;
}
Notes:
BPF_PROG2 macro (not BPF_PROG or BPF_KPROBE)BPF_PROG2 alternates: type, name, type, name, ...fmod_ret can short-circuit the original function — use carefullynotrace annotation)Attach to hardware/software performance counters. Used for CPU profiling and sampling.
When to use it:
SEC("perf_event")
int handle_perfevent(struct bpf_perf_event_data *ctx) {
u32 pid = bpf_get_current_pid_tgid() >> 32;
bpf_printk("perf sample: pid=%d\n", pid);
return 0;
}
Notes:
bpf_program__attach_perf_event(prog, perf_fd) where perf_fd comes from perf_event_open(2)Enforce security policy by hooking Linux Security Module hooks. Can deny operations by returning a negative error code.
When to use it:
SEC("lsm/security_file_permission")
int BPF_PROG(handle_file_perm, struct file *file, int mask) {
// return 0 to allow, negative errno to deny
return 0;
}
SEC("lsm/bprm_check_security")
int BPF_PROG(handle_exec_check, struct linux_binprm *bprm) {
return 0;
}
Notes:
CONFIG_BPF_LSM=y and lsm=bpf in kernel boot params (or appended to existing lsm= list)cat /sys/kernel/security/lsmBPF_PROG macro (not BPF_PROG2)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job