diff mbox series

[bpf-next,v3,2/3] libbpf: support detecting and attaching of writable tracepoint program

Message ID 20210928140734.1274261-3-houtao1@huawei.com (mailing list archive)
State Superseded
Delegated to: BPF
Headers show
Series add support for writable bare tracepoint | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 3 maintainers not CCed: kpsingh@kernel.org john.fastabend@gmail.com songliubraving@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
bpf/vmtest-bpf-next success VM_Test
bpf/vmtest-bpf-next-PR success PR summary

Commit Message

Hou Tao Sept. 28, 2021, 2:07 p.m. UTC
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(+)

Comments

Andrii Nakryiko Sept. 28, 2021, 11:11 p.m. UTC | #1
On Tue, Sep 28, 2021 at 6:53 AM Hou Tao <houtao1@huawei.com> 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 ef5db34bf913..b874c0179084 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -7976,6 +7976,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.w/", RAW_TRACEPOINT_WRITABLE,
> +               .attach_fn = attach_raw_tp),
> +       SEC_DEF("raw_tp.w/", RAW_TRACEPOINT_WRITABLE,
> +               .attach_fn = attach_raw_tp),

Unfortunately I just refactored these SEC_DEF() definitions, please
rebase because this won't apply cleanly anymore. Otherwise it looks
good to me.

>         SEC_DEF("tp_btf/", TRACING,
>                 .expected_attach_type = BPF_TRACE_RAW_TP,
>                 .is_attach_btf = true,
> --
> 2.29.2
>
diff mbox series

Patch

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index ef5db34bf913..b874c0179084 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -7976,6 +7976,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.w/", RAW_TRACEPOINT_WRITABLE,
+		.attach_fn = attach_raw_tp),
+	SEC_DEF("raw_tp.w/", RAW_TRACEPOINT_WRITABLE,
+		.attach_fn = attach_raw_tp),
 	SEC_DEF("tp_btf/", TRACING,
 		.expected_attach_type = BPF_TRACE_RAW_TP,
 		.is_attach_btf = true,