Re: [PATCHv7 bpf-next 04/28] bpf: Add cookies support for uprobe_multi link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 8/11/23 6:19 AM, Jiri Olsa wrote:
On Wed, Aug 09, 2023 at 09:39:53AM -0700, Yonghong Song wrote:


On 8/9/23 1:34 AM, Jiri Olsa wrote:
Adding support to specify cookies array for uprobe_multi link.

The cookies array share indexes and length with other uprobe_multi
arrays (offsets/ref_ctr_offsets).

The cookies[i] value defines cookie for i-the uprobe and will be
returned by bpf_get_attach_cookie helper when called from ebpf
program hooked to that specific uprobe.

Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
Acked-by: Yafang Shao <laoar.shao@xxxxxxxxx>
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>

Ack with a minor nit below.

Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>

---
   include/uapi/linux/bpf.h       |  1 +
   kernel/bpf/syscall.c           |  2 +-
   kernel/trace/bpf_trace.c       | 45 +++++++++++++++++++++++++++++++---
   tools/include/uapi/linux/bpf.h |  1 +
   4 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index e48780951fc7..d7f4f50b1e58 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -1639,6 +1639,7 @@ union bpf_attr {
   				__aligned_u64	path;
   				__aligned_u64	offsets;
   				__aligned_u64	ref_ctr_offsets;
+				__aligned_u64	cookies;
   				__u32		cnt;
   				__u32		flags;
   			} uprobe_multi;

The 'cookies' field is inserted into the middle of 'uprobe_multi'
struct. Not sure whether this may cause bug bisecting issue or not.

the idea is to have all fields related to the 'cnt' field grouped

so the problem is that the bisect reproducer would fail on previous
patch because of the changed uprobe_multi layout, but it only got
introduced in previous patch, so we are close ;-)

I don't think it's real problem but I guess I could add 'cookie'
field in previous patch

I agree it should not be a real issue. Maybe let maintainers
to step in with their opinion.


thanks,
jirka





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux