BpfSyscallWrapper: add bpfGetFd{Jit,Xlat}ProgLen

Available in Linux Kernel 4.14+

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3e5a43ceece5826fc6019bd11df2bc5315fe405c
This commit is contained in:
Maciej Żenczykowski 2025-02-14 11:12:09 -08:00
commit fb98f05e7c

View file

@ -269,7 +269,7 @@ inline int bpfGetFd ## NAME(const borrowed_fd& fd) { \
return info.FIELD; \
}
// All 7 of these fields are already present in Linux v4.14 (even ACK 4.14-P)
// All 9 of these fields are already present in Linux v4.14 (even ACK 4.14-P)
// while BPF_OBJ_GET_INFO_BY_FD is not implemented at all in v4.9 (even ACK 4.9-Q)
DEFINE_BPF_GET_FD(map, MapType, type) // int bpfGetFdMapType(const borrowed_fd& map_fd)
DEFINE_BPF_GET_FD(map, MapId, id) // int bpfGetFdMapId(const borrowed_fd& map_fd)
@ -278,6 +278,8 @@ DEFINE_BPF_GET_FD(map, ValueSize, value_size) // int bpfGetFdValueSize(const
DEFINE_BPF_GET_FD(map, MaxEntries, max_entries) // int bpfGetFdMaxEntries(const borrowed_fd& map_fd)
DEFINE_BPF_GET_FD(map, MapFlags, map_flags) // int bpfGetFdMapFlags(const borrowed_fd& map_fd)
DEFINE_BPF_GET_FD(prog, ProgId, id) // int bpfGetFdProgId(const borrowed_fd& prog_fd)
DEFINE_BPF_GET_FD(prog, JitProgLen, jited_prog_len) // int bpfGetFdJitProgLen(...)
DEFINE_BPF_GET_FD(prog, XlatProgLen, xlated_prog_len) // int bpfGetFdXlatProgLen(...)
#undef DEFINE_BPF_GET_FD