tw4452852 / zbpf

Writing eBPF in Zig
https://tw4452852.github.io/zbpf/
GNU General Public License v3.0
108 stars 6 forks source link

The embeded BPF program can't be used directly #2

Closed tw4452852 closed 3 months ago

tw4452852 commented 1 year ago

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 WA could be removed.