zbpf icon indicating copy to clipboard operation
zbpf copied to clipboard

The embeded BPF program can't be used directly

Open tw4452852 opened this issue 2 years ago • 0 comments

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.

tw4452852 avatar Apr 23 '23 11:04 tw4452852