You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: CLAUDE.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,14 @@ Plain `go build` also works for the Go userland (pre-compiled eBPF objects are c
23
23
pktstat-bpf is a Linux eBPF packet statistics tool. It has two layers:
24
24
25
25
**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.
28
31
29
32
**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).
31
34
-`main.go` — program entry: loads both eBPF objects, resolves interface, selects capture mode (TC / XDP / KProbes / CGroup), runs TUI or CLI loop.
0 commit comments