Dynamic kfunc discovery

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

 



Hi,

I was chatting w/ Quentin [0] about how bpftool could:

1. Support a "feature dump" of all supported kfuncs on running kernel
2. Generate vmlinux.h with kfunc prototypes

I had another idea this morning so I thought I'd bounce it around
on the list in case others had better ones. 3 vague ideas:

1. Add a BTF type tag annotation in __bpf_kfunc macro. This would
   let bpftool parse BTF to do discovery. It would be fairly clean and
   straightforward, except that I don't think GCC supports these type
   tags. So only clang-built-linux would work.

2. Do the same thing as above, except rather than tagging src code,
   teach pahole about the .BTF_ids section in vmlinux. pahole could then
   construct BTF with the appropriate type tags.

3. Have the kernel export function prototypes (with no forward decls)
   in a pseudo fs file. bpftool could then append the contents of this file
   to the end of the generated vmlinux.h. Unfortunately this would rule
   out minimized type dumps (IOW only dump dependent types for kfuncs
   or something). Unless bpftool wants to embed clang-front-end or
   something like that to parse C.

Would appreciate any thoughts.

Thanks,
Daniel


[0]: https://github.com/libbpf/bpftool/issues/98




[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