XDP hardware hints discussion mail archive
 help / color / mirror / Atom feed
* [xdp-hints] How to extract BTF object ID from kernel module?
@ 2022-08-30 13:17 Jesper Dangaard Brouer
  2022-08-31 17:22 ` [xdp-hints] " Jesper Dangaard Brouer
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Dangaard Brouer @ 2022-08-30 13:17 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: brouer, Zaremba Larysa, Alexei Starovoitov, bpf, xdp-hints

Hi Andrii,

When opening a modules BTF file (e.g. /sys/kernel/btf/i40e), can I
somehow get the kernels BTF object ID value (via that FD)?

I think I want the BTF object IDs as displayed by 'btftool btf'.
That code walks all IDs via bpf_btf_get_next_id() and then gets the FD
via bpf_btf_get_fd_by_id().  I'm looking for a more direct way than
having to walk all IDs...

(p.s. Cc. Larysa, I also looked at your code, which like bpftool end-up
walking all BTF IDs and extends libbpf with internal btf_obj_id to keep
track).

--Jesper


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

end of thread, other threads:[~2022-08-31 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 13:17 [xdp-hints] How to extract BTF object ID from kernel module? Jesper Dangaard Brouer
2022-08-31 17:22 ` [xdp-hints] " Jesper Dangaard Brouer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox