Skip to content

Commit 08be4d0

Browse files
committed
Update CLAUDE.md to reflect per-hook-type BPF program split
Fix stale references to the removed monolithic counter.bpf.c and the counter_* generated files; list the actual per-mode BPF sources (tc, xdp, kprobe, cgroup_skb, cgroup) and their correct generated file prefixes. Note that cgroup.bpf.c is shared by both KProbes and CGroup capture modes.
1 parent 8bd8958 commit 08be4d0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CLAUDE.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ Plain `go build` also works for the Go userland (pre-compiled eBPF objects are c
2323
pktstat-bpf is a Linux eBPF packet statistics tool. It has two layers:
2424

2525
**eBPF layer (C, in `bpf/`):**
26-
- `bpf/counter.bpf.c` — packet/byte counting programs for TC (TCX ingress+egress), XDP (ingress only), KProbes (tcp/udp/icmp), and CGroup SKB hooks.
27-
- `bpf/cgroup.bpf.c` — raw tracepoint on `cgroup_mkdir` to push new CGroup path events to userspace via perf buffer.
26+
- `bpf/tc.bpf.c` — packet/byte counting via TC (TCX ingress+egress).
27+
- `bpf/xdp.bpf.c` — packet/byte counting via XDP (ingress only).
28+
- `bpf/kprobe.bpf.c` — per-process TCP/UDP/ICMP stats via KProbes with PID/CGroup tracking.
29+
- `bpf/cgroup_skb.bpf.c` — packet/byte counting via CGroup SKB hooks.
30+
- `bpf/cgroup.bpf.c` — raw tracepoint on `cgroup_mkdir` to push new CGroup path events to userspace via perf buffer; shared by both KProbes and CGroup modes.
2831

2932
**Userland layer (Go, root package `main`):**
30-
- `gen.go``//go:generate` directives that invoke `bpf2go` to compile each `.bpf.c` for `amd64` and `arm64`, producing `counter_{x86,arm64}_bpfel.{go,o}` and `cgroup_{x86,arm64}_bpfel.{go,o}` (bpf2go maps `-target amd64``x86` in filenames).
33+
- `gen.go``//go:generate` directives that invoke `bpf2go` to compile each `.bpf.c` for `amd64` and `arm64`, producing `tc_`, `xdp_`, `kprobe_`, `cgroupskb_`, and `cgroup_` prefixed `*_{x86,arm64}_bpfel.{go,o}` files (bpf2go maps `-target amd64``x86` in filenames).
3134
- `main.go` — program entry: loads both eBPF objects, resolves interface, selects capture mode (TC / XDP / KProbes / CGroup), runs TUI or CLI loop.
3235
- `probe.go``startTC`, `startXDP`, `startKProbes`, `startCgroup`, `startCGroupTrace`: attach eBPF programs to hooks.
3336
- `map.go` — reads `PktCount` eBPF LRU hash map; prefers `BatchLookup` (kernel ≥5.6), falls back to iterator.

0 commit comments

Comments
 (0)