diff options
| author | Andrii Nakryiko <[email protected]> | 2024-03-19 23:38:51 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2024-03-20 06:05:34 +0000 |
| commit | 36ffb2023e3703a64266ca5fed30f710b1263c70 (patch) | |
| tree | fb05c40a43afcd3f237b38c253256379c0a23a09 /tools/lib/bpf/libbpf.h | |
| parent | bpf: support BPF cookie in raw tracepoint (raw_tp, tp_btf) programs (diff) | |
| download | kernel-36ffb2023e3703a64266ca5fed30f710b1263c70.tar.gz kernel-36ffb2023e3703a64266ca5fed30f710b1263c70.zip | |
libbpf: add support for BPF cookie for raw_tp/tp_btf programs
Wire up BPF cookie passing or raw_tp and tp_btf programs, both in
low-level and high-level APIs.
Acked-by: Stanislav Fomichev <[email protected]>
Acked-by: Eduard Zingerman <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
| -rw-r--r-- | tools/lib/bpf/libbpf.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 7b510761f545..f88ab50c0229 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -760,9 +760,20 @@ bpf_program__attach_tracepoint_opts(const struct bpf_program *prog, const char *tp_name, const struct bpf_tracepoint_opts *opts); +struct bpf_raw_tracepoint_opts { + size_t sz; /* size of this struct for forward/backward compatibility */ + __u64 cookie; + size_t :0; +}; +#define bpf_raw_tracepoint_opts__last_field cookie + LIBBPF_API struct bpf_link * bpf_program__attach_raw_tracepoint(const struct bpf_program *prog, const char *tp_name); +LIBBPF_API struct bpf_link * +bpf_program__attach_raw_tracepoint_opts(const struct bpf_program *prog, + const char *tp_name, + struct bpf_raw_tracepoint_opts *opts); struct bpf_trace_opts { /* size of this struct, for forward/backward compatibility */ |
