cloud-native-ebpf-observability
Use when the user asks about bpftrace, tracing syscalls, kprobes, tracepoints, uprobes, off-CPU or continuous profiling with eBPF, libbpf ring buffers, or…
от j4flmao★ 47 звёзд на GitHub
Установить cloud-native-ebpf-observability в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
eBPF Observability
Purpose
Observe what the kernel and processes are actually doing — syscalls, scheduling, I/O latency, network connections, function calls in binaries — with low overhead and no code changes. Start with bpftrace to answer a question in minutes; build a libbpf CO-RE program only when you need a long-running agent.
Agent Protocol
Trigger
"ebpf tracing", "ebpf observability", "bpftrace", "trace syscalls", "kprobe", "tracepoint", "uprobe", "off-cpu", "continuous profiling", "ringbuf", "kernel latency".
Input Context
- Question to answer (which process opens files, where is latency, who connects where).
- Kernel version and BTF availability (
ls /sys/kernel/btf/vmlinux). - One-off investigation vs permanent agent; container/Kubernetes context.
Output Artifact
bpftrace script or libbpf program + user-space loader outline. No file unless requested.
Response Format
Question: {...}
Probe type: {tracepoint|fentry/fexit|kprobe|uprobe|USDT|perf_event}
Tool: {bpftrace one-liner|libbpf CO-RE agent|existing tool}
Overhead note: {event rate, filtering in kernel}
Min kernel: {version}
Completion Criteria
- Prefer stable tracepoints over kprobes where one exists.
- Aggregation/filtering happens in kernel (maps/histograms), not per-event to user space, when rates are high.
- Minimum kernel version stated.
Probe Types
| Probe | Stability | Use |
|---|---|---|
Tracepoints (tracepoint:syscalls:sys_enter_openat) |
Stable ABI | First choice for syscalls, scheduler, block I/O, net events |
| fentry/fexit (BTF trampolines, kernel ≥ 5.5) | Function signatures may change between kernels | Low-overhead kernel function entry/exit with typed args |
| kprobe/kretprobe | Unstable (internal functions can be renamed/inlined) | When no tracepoint exists |
| uprobe/uretprobe | Binary-specific | User-space functions (TLS libraries, Go/Java runtimes with care) |
| USDT | Stable if the app defines them | Instrumented runtimes/databases |
| perf_event (CPU sampling) | Stable | CPU profiling (flame graphs) |
bpftrace for Investigation
# Who opens which files (system-wide)
bpftrace -e 'tracepoint:syscalls:sys_enter_openat { printf("%s %s\n", comm, str(args.filename)); }'
# Syscall counts by process
bpftrace -e 'tracepoint:raw_syscalls:sys_enter { @[comm] = count(); }'
# Block I/O latency histogram (µs)
bpftrace -e 'tracepoint:block:block_rq_issue { @s[args.dev, args.sector] = nsecs; }
tracepoint:block:block_rq_complete /@s[args.dev, args.sector]/ {
@usecs = hist((nsecs - @s[args.dev, args.sector]) / 1000); delete(@s[args.dev, args.sector]); }'
# New process executions with arguments
bpftrace -e 'tracepoint:syscalls:sys_enter_execve { printf("%d %s\n", pid, str(args.filename)); }'
# CPU profile at 99 Hz, kernel+user stacks
bpftrace -e 'profile:hz:99 { @[kstack, ustack, comm] = count(); }'
Older bpftrace versions use args->field instead of args.field. The bcc-tools/libbpf-tools packages (execsnoop, opensnoop, biolatency, tcplife, runqlat) cover many common questions already — prefer the libbpf-tools builds.
libbpf CO-RE Agent (exec events via ring buffer)
// execsnoop.bpf.c — kernel >= 5.8 (BPF ring buffer), BTF enabled
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_core_read.h>
struct event {
__u32 pid;
__u32 ppid;
char comm[16];
char filename[256];
};
struct {
__uint(type, BPF_MAP_TYPE_RINGBUF);
__uint(max_entries, 256 * 1024);
} events SEC(".maps");
SEC("tracepoint/syscalls/sys_enter_execve")
int handle_execve(struct trace_event_raw_sys_enter *ctx)
{
struct event *e = bpf_ringbuf_reserve(&events, sizeof(*e), 0);
if (!e)
return 0; /* buffer full: drop, count if needed */
struct task_struct *task = (struct task_struct *)bpf_get_current_task();
e->pid = bpf_get_current_pid_tgid() >> 32; /* upper 32 bits = TGID (user-visible PID) */
e->ppid = BPF_CORE_READ(task, real_parent, tgid);
bpf_get_current_comm(&e->comm, sizeof(e->comm));
bpf_probe_read_user_str(&e->filename, sizeof(e->filename), (const char *)ctx->args[0]);
bpf_ringbuf_submit(e, 0);
return 0;
}
char LICENSE[] SEC("license") = "GPL";
User space (C with skeleton): bpftool gen skeleton execsnoop.bpf.o > execsnoop.skel.h, then execsnoop_bpf__open_and_load(), execsnoop_bpf__attach(), ring_buffer__new(bpf_map__fd(skel->maps.events), handle_event, NULL, NULL), and loop on ring_buffer__poll(rb, 100). In Go use cilium/ebpf (bpf2go + ringbuf.NewReader).
Key details:
bpf_get_current_pid_tgid()returnstgid << 32 | pid; the user-visible process ID is the upper half.BPF_CORE_READrelocates field offsets at load time using BTF → one binary works across kernels.- Ring buffer (≥ 5.8) preserves event order across CPUs and uses one shared buffer; prefer it over
PERF_EVENT_ARRAY.
Kubernetes-Ready Tools
| Need | To
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл cloud-native-ebpf-observability?
Use when the user asks about bpftrace, tracing syscalls, kprobes, tracepoints, uprobes, off-CPU or continuous profiling with eBPF, libbpf ring buffers, or measuring kernel latency. Produces bpftrace one-liners and libbpf CO-RE agents, and picks tools like Parca, Pixie, Tetragon or Beyla. Not for packet processing (use cloud-native-ebpf-networking) or threat detection (use ebpf-threat-detection).
Как установить скилл cloud-native-ebpf-observability?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cloud-native-ebpf-observability запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…