Skip to content

BpfProg.load fails #123

@andrewbolotsky

Description

@andrewbolotsky

When I try to call

BpfProg.load("...", ProgType.PERF_EVENT);

it fails with

libbpf: bpf_prog_load_opts has non-zero extra bytes
Exception in thread "main" java.io.IOException: Invalid argument
        at one.nio.os.bpf.Bpf.progLoad(Native Method)
        at one.nio.os.bpf.BpfProg.load(BpfProg.java:32)
        at org.example.BpfRunner.main(BpfRunner.java:14)

As far as I understand, in implementation utilized

int (*bpf_prog_load)(const char *file, enum bpf_prog_type type,
                     struct bpf_object **pobj, int *prog_fd);

but as i see here this method now has another signature

int bpf_prog_load (enum bpf_prog_type prog_type, const char *prog_name, const char *license, const struct bpf_insn *insns, size_t insn_cnt, struct bpf_prog_load_opts *opts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions