<div dir="auto">The tracee call BPF_MAP_LOOKUP_ELEM with map_fd, and tracer get the map_fd. Fds are process-scoped. For example, a bpf obj with id 4 would have fd 5 in tracee process and fd 6 in tracer process. I found that it cannot do some operation with the tracee map_fd like bpf_obj_pin, bpf_obj_get_info_by_fd in tracer process. </div><div dir="auto">One of the possible way to solve is use bpf_obj_pin in tracee process. </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 24 Sep 2022 at 1:16 AM Dmitry V. Levin <<a href="mailto:ldv@altlinux.org">ldv@altlinux.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">On Fri, Sep 23, 2022 at 11:59:37PM +0800, SuHsueyu wrote:<br>
> Like the BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM) in src/bpf.c, the<br>
> parameter "struct BPF_MAP_LOOKUP_ELEM_struct attr" have a field map_fd<br>
<br>
OK, but I still don't follow, what do you mean when you are saying that<br>
union bpf_attr.map_fd "may differ under tracee and tracer"?<br>
<br>
<br>
-- <br>
ldv<br>
-- <br>
Strace-devel mailing list<br>
<a href="mailto:Strace-devel@lists.strace.io" target="_blank">Strace-devel@lists.strace.io</a><br>
<a href="https://lists.strace.io/mailman/listinfo/strace-devel" rel="noreferrer" target="_blank">https://lists.strace.io/mailman/listinfo/strace-devel</a><br>
</blockquote></div></div>