Message ID | 20210916135511.3787194-3-houtao1@huawei.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | add support for writable bare tracepoint | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
bpf/vmtest-bpf-next-PR | fail | merge-conflict |
bpf/vmtest-bpf | success | VM_Test |
bpf/vmtest-bpf-PR | success | PR summary |
On 9/16/21 6:55 AM, Hou Tao wrote: > Program on writable tracepoint is BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, > but its attachment is the same as BPF_PROG_TYPE_RAW_TRACEPOINT. > > Signed-off-by: Hou Tao <houtao1@huawei.com> > --- > tools/lib/bpf/libbpf.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c > index 88d8825fc6f6..e6a1d552040c 100644 > --- a/tools/lib/bpf/libbpf.c > +++ b/tools/lib/bpf/libbpf.c > @@ -7942,6 +7942,10 @@ static const struct bpf_sec_def section_defs[] = { > .attach_fn = attach_raw_tp), > SEC_DEF("raw_tp/", RAW_TRACEPOINT, > .attach_fn = attach_raw_tp), > + SEC_DEF("raw_tracepoint_writable/", RAW_TRACEPOINT_WRITABLE, > + .attach_fn = attach_raw_tp), > + SEC_DEF("raw_tp_writable/", RAW_TRACEPOINT_WRITABLE, > + .attach_fn = attach_raw_tp), Looks like initially ([1]) we don't have C bpf program test case for RAW_TRACEPOINT_WRITABLE, so the above sec definition is missing. [1] e950e843367d7 selftests: bpf: test writable buffers in raw tps > SEC_DEF("tp_btf/", TRACING, > .expected_attach_type = BPF_TRACE_RAW_TP, > .is_attach_btf = true, >
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 88d8825fc6f6..e6a1d552040c 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -7942,6 +7942,10 @@ static const struct bpf_sec_def section_defs[] = { .attach_fn = attach_raw_tp), SEC_DEF("raw_tp/", RAW_TRACEPOINT, .attach_fn = attach_raw_tp), + SEC_DEF("raw_tracepoint_writable/", RAW_TRACEPOINT_WRITABLE, + .attach_fn = attach_raw_tp), + SEC_DEF("raw_tp_writable/", RAW_TRACEPOINT_WRITABLE, + .attach_fn = attach_raw_tp), SEC_DEF("tp_btf/", TRACING, .expected_attach_type = BPF_TRACE_RAW_TP, .is_attach_btf = true,
Program on writable tracepoint is BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, but its attachment is the same as BPF_PROG_TYPE_RAW_TRACEPOINT. Signed-off-by: Hou Tao <houtao1@huawei.com> --- tools/lib/bpf/libbpf.c | 4 ++++ 1 file changed, 4 insertions(+)