BPF List
 help / color / mirror / Atom feed
From: JP Kobryn <inwardvessel@gmail.com>
To: andrii@kernel.org, ast@kernel.org, eddyz87@gmail.com,
	bpf@vger.kernel.org
Subject: [PATCH bpf-next v3 1/2] bpf: allow kfuncs within tracepoint and perf event programs
Date: Thu,  5 Sep 2024 15:38:11 -0700	[thread overview]
Message-ID: <20240905223812.141857-2-inwardvessel@gmail.com> (raw)
In-Reply-To: <20240905223812.141857-1-inwardvessel@gmail.com>

Associate tracepoint and perf event program types with the kfunc tracing
hook. This allows calling kfuncs within these types of programs.

Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
---
 kernel/bpf/btf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 520f49f422fe..7d25ecd195ba 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -8304,6 +8304,8 @@ static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type)
 	case BPF_PROG_TYPE_STRUCT_OPS:
 		return BTF_KFUNC_HOOK_STRUCT_OPS;
 	case BPF_PROG_TYPE_TRACING:
+	case BPF_PROG_TYPE_TRACEPOINT:
+	case BPF_PROG_TYPE_PERF_EVENT:
 	case BPF_PROG_TYPE_LSM:
 		return BTF_KFUNC_HOOK_TRACING;
 	case BPF_PROG_TYPE_SYSCALL:
-- 
2.46.0


  reply	other threads:[~2024-09-05 22:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 22:38 [PATCH bpf-next v3 0/2] allow kfuncs in tracepoint and perf event JP Kobryn
2024-09-05 22:38 ` JP Kobryn [this message]
2024-09-05 22:38 ` [PATCH bpf-next v3 2/2] bpf/selftests: coverage for tp and perf event progs using kfuncs JP Kobryn
2024-09-06  0:10 ` [PATCH bpf-next v3 0/2] allow kfuncs in tracepoint and perf event patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240905223812.141857-2-inwardvessel@gmail.com \
    --to=inwardvessel@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox