zbpf icon indicating copy to clipboard operation
zbpf copied to clipboard

Writing eBPF in Zig

Results 4 zbpf issues
Sort by recently updated
recently updated
newest added

For example: ``` % zig build trace -Dkprobe=vfs_read zig build-exe trace Debug native: error: the following command failed with 1 compilation errors: /home/tw/code/zig/stage3/bin/zig build-exe /home/tw/code/zbpf/src/trace.zig /home/tw/code/zbpf/zig-cache/o/78a2ee489f9462b6ce60737103daa98e/liblibbpf.a /home/tw/code/zbpf/zig-cache/o/b4e27ee35a32d0daa776bdc75f0b1169/libz.a /home/tw/code/zbpf/zig-cache/o/fb7daa1e59d9fb6436cf07669dc20b1b/libelf.a -lc --cache-dir...

Nowadays, we have to duplicate the original BPF program as follows: ``` const obj_bytes = @embedFile("@perf_event"); const bytes = try allocator.dupe(u8, obj_bytes); defer allocator.free(bytes); ``` Once https://github.com/ziglang/zig/issues/4680 is resolved, this...

``` > zig build trace -Dkprobe=ZSTD_CCtxParams_init_advanced:arg0,arg1,ret src/bpf/args.zig:171:12: error: expected type 'vmlinux.struct_19428', found 'c_ulong' ``` libbpf did already support this: https://lore.kernel.org/bpf/[email protected]/

``` zig build trace -Dkprobe=kill_pid_usb_asyncio:arg0,arg1,arg2,arg3,arg4,ret ```