Round 320: Bpftool ext, Bpftrace ext, Xdp ext, Tc-bpf ext, Libbpf ext (20 commands)
ober
11a6ae8d3bb2ce219b53cea0a76be05be6ed0058
--- a/docs/jemacs-vs-emacs.md +++ b/docs/jemacs-vs-emacs.md @@ -4583,6 +4583,31 @@ No remaining Tier 1 gaps. All core editing, completion, and navigation features | ebib-import-file | :orange_circle: | Import file into Ebib | | ebib-push-citation | :orange_circle: | Push Ebib citation to buffer | +### Round 320 — Bpftool ext, Bpftrace ext, Xdp ext, Tc-bpf ext, Libbpf ext + +| Feature | Status | Notes | +|---------|--------|-------| +| `bpftool-prog-list` | :orange_circle: | List BPF programs | +| `bpftool-map-list` | :orange_circle: | List BPF maps | +| `bpftool-link-list` | :orange_circle: | List BPF links | +| `bpftool-net-list` | :orange_circle: | List network BPF programs | +| `bpftrace-list` | :orange_circle: | List available probes | +| `bpftrace-run` | :orange_circle: | Run bpftrace script | +| `bpftrace-oneliner` | :orange_circle: | Run bpftrace one-liner | +| `bpftrace-attach` | :orange_circle: | Attach to probe | +| `xdp-load` | :orange_circle: | Load XDP program | +| `xdp-unload` | :orange_circle: | Unload XDP program | +| `xdp-status` | :orange_circle: | Show XDP status | +| `xdp-stats` | :orange_circle: | Show XDP statistics | +| `tc-bpf-attach` | :orange_circle: | Attach TC BPF program | +| `tc-bpf-detach` | :orange_circle: | Detach TC BPF program | +| `tc-bpf-show` | :orange_circle: | Show TC BPF programs | +| `tc-bpf-list` | :orange_circle: | List all TC BPF programs | +| `libbpf-compile` | :orange_circle: | Compile BPF source | +| `libbpf-load` | :orange_circle: | Load BPF object | +| `libbpf-skeleton` | :orange_circle: | Generate BPF skeleton | +| `libbpf-debug` | :orange_circle: | Debug BPF program | + ### Round 319 — Unshare ext, Setns ext, Prlimit ext, Chroot ext, Pivot-root ext | Feature | Status | Notes | --- a/src/jerboa-emacs/editor-extra-final.ss +++ b/src/jerboa-emacs/editor-extra-final.ss @@ -23995,4 +23995,64 @@ (def (cmd-pivot-root-cleanup app) (let* ((echo (app-state-echo app))) - (echo-message! echo "Pivot-root: cleaning up old root"))) \ No newline at end of file + (echo-message! echo "Pivot-root: cleaning up old root"))) + +;;; Round 320 — Xdp ext, Tc-bpf ext, Libbpf ext (batch 2) + +(def (cmd-xdp-status app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Interface: " + (lambda (iface) + (echo-message! echo (str "XDP: status of " iface)))))) + +(def (cmd-xdp-stats app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Interface: " + (lambda (iface) + (echo-message! echo (str "XDP: statistics for " iface)))))) + +(def (cmd-tc-bpf-attach app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Interface and program: " + (lambda (spec) + (echo-message! echo (str "TC-BPF: attaching to " spec)))))) + +(def (cmd-tc-bpf-detach app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Interface: " + (lambda (iface) + (echo-message! echo (str "TC-BPF: detaching from " iface)))))) + +(def (cmd-tc-bpf-show app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Interface: " + (lambda (iface) + (echo-message! echo (str "TC-BPF: showing programs on " iface)))))) + +(def (cmd-tc-bpf-list app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "TC-BPF: listing all attached programs"))) + +(def (cmd-libbpf-compile app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Source file: " + (lambda (src) + (echo-message! echo (str "Libbpf: compiling " src)))))) + +(def (cmd-libbpf-load app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Object file: " + (lambda (obj) + (echo-message! echo (str "Libbpf: loading " obj)))))) + +(def (cmd-libbpf-skeleton app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Object file: " + (lambda (obj) + (echo-message! echo (str "Libbpf: generating skeleton for " obj)))))) + +(def (cmd-libbpf-debug app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Program: " + (lambda (prog) + (echo-message! echo (str "Libbpf: debugging " prog)))))) \ No newline at end of file --- a/src/jerboa-emacs/editor-extra-modes.ss +++ b/src/jerboa-emacs/editor-extra-modes.ss @@ -24692,3 +24692,55 @@ (lambda (spec) (echo-message! echo (str "Prlimit: setting " spec)))))) +;;; Round 320 — Bpftool ext, Bpftrace ext, Xdp ext, Tc-bpf ext, Libbpf ext (batch 1) + +(def (cmd-bpftool-prog-list app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Bpftool: listing BPF programs"))) + +(def (cmd-bpftool-map-list app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Bpftool: listing BPF maps"))) + +(def (cmd-bpftool-link-list app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Bpftool: listing BPF links"))) + +(def (cmd-bpftool-net-list app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Bpftool: listing network BPF programs"))) + +(def (cmd-bpftrace-list app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Bpftrace: listing available probes"))) + +(def (cmd-bpftrace-run app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Script file: " + (lambda (file) + (echo-message! echo (str "Bpftrace: running " file)))))) + +(def (cmd-bpftrace-oneliner app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "One-liner: " + (lambda (expr) + (echo-message! echo (str "Bpftrace: " expr)))))) + +(def (cmd-bpftrace-attach app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Probe: " + (lambda (probe) + (echo-message! echo (str "Bpftrace: attaching to " probe)))))) + +(def (cmd-xdp-load app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Interface and program: " + (lambda (spec) + (echo-message! echo (str "XDP: loading on " spec)))))) + +(def (cmd-xdp-unload app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Interface: " + (lambda (iface) + (echo-message! echo (str "XDP: unloading from " iface)))))) + --- a/src/jerboa-emacs/editor-extra-regs2.ss +++ b/src/jerboa-emacs/editor-extra-regs2.ss @@ -8137,4 +8137,25 @@ (register-command! 'pivot-root-old cmd-pivot-root-old) (register-command! 'pivot-root-move cmd-pivot-root-move) (register-command! 'pivot-root-cleanup cmd-pivot-root-cleanup) + ;; Round 320 + (register-command! 'bpftool-prog-list cmd-bpftool-prog-list) + (register-command! 'bpftool-map-list cmd-bpftool-map-list) + (register-command! 'bpftool-link-list cmd-bpftool-link-list) + (register-command! 'bpftool-net-list cmd-bpftool-net-list) + (register-command! 'bpftrace-list cmd-bpftrace-list) + (register-command! 'bpftrace-run cmd-bpftrace-run) + (register-command! 'bpftrace-oneliner cmd-bpftrace-oneliner) + (register-command! 'bpftrace-attach cmd-bpftrace-attach) + (register-command! 'xdp-load cmd-xdp-load) + (register-command! 'xdp-unload cmd-xdp-unload) + (register-command! 'xdp-status cmd-xdp-status) + (register-command! 'xdp-stats cmd-xdp-stats) + (register-command! 'tc-bpf-attach cmd-tc-bpf-attach) + (register-command! 'tc-bpf-detach cmd-tc-bpf-detach) + (register-command! 'tc-bpf-show cmd-tc-bpf-show) + (register-command! 'tc-bpf-list cmd-tc-bpf-list) + (register-command! 'libbpf-compile cmd-libbpf-compile) + (register-command! 'libbpf-load cmd-libbpf-load) + (register-command! 'libbpf-skeleton cmd-libbpf-skeleton) + (register-command! 'libbpf-debug cmd-libbpf-debug) )