linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Allow bpf_d_path in perf_event_mmap
@ 2021-10-28 16:43 Florent Revest
  2021-10-28 22:46 ` Martin KaFai Lau
  0 siblings, 1 reply; 14+ messages in thread
From: Florent Revest @ 2021-10-28 16:43 UTC (permalink / raw)
  To: bpf; +Cc: ast, daniel, andrii, kpsingh, jackmanb, linux-kernel, Florent Revest

Allow the helper to be called from the perf_event_mmap hook. This is
convenient to lookup vma->vm_file and implement a similar logic as
perf_event_mmap_event in BPF.

Signed-off-by: Florent Revest <revest@chromium.org>
---
 kernel/trace/bpf_trace.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index cbcd0d6fca7c..f6e301c775a5 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -922,6 +922,9 @@ BTF_ID(func, vfs_fallocate)
 BTF_ID(func, dentry_open)
 BTF_ID(func, vfs_getattr)
 BTF_ID(func, filp_close)
+#ifdef CONFIG_PERF_EVENTS
+BTF_ID(func, perf_event_mmap)
+#endif
 BTF_SET_END(btf_allowlist_d_path)
 
 static bool bpf_d_path_allowed(const struct bpf_prog *prog)
-- 
2.33.0.1079.g6e70778dc9-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-11-02 23:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 16:43 [PATCH bpf-next] bpf: Allow bpf_d_path in perf_event_mmap Florent Revest
2021-10-28 22:46 ` Martin KaFai Lau
2021-10-29 15:17   ` Hengqi Chen
2021-10-29 17:08     ` Florent Revest
2021-10-29 17:02   ` Florent Revest
2021-11-01 13:17     ` Hengqi Chen
2021-11-01 15:01       ` Florent Revest
2021-11-01 17:31         ` Yonghong Song
2021-11-02  2:53           ` Alexei Starovoitov
2021-11-02  3:16             ` Andrii Nakryiko
2021-11-02  3:20               ` Alexei Starovoitov
2021-11-02  4:05                 ` Andrii Nakryiko
2021-11-02 23:03                   ` Florent Revest
2021-11-02 23:15                     ` Yonghong Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).