[LSF/MM/BPF TOPIC] BTF function/address resolving

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

 



The process of resolving function from its BTF ID could get us wrong address
when there are more functions with the same name in BTF data.

We retrieve the function name from BTF data (the first match we find) and look
it up in kallsyms with kallsyms_lookup_name functions (which also finds the
first match). This brings lot of ambiguity and we can't be sure we get the
proper function address.

Currently we are about to eliminate multiple definitions of static functions
with same name and not matching declarations [1], so current resolve process
should work reliably, but at the expense of removing functions from BTF.

As a next step it'd great to have non ambiguous way to resolve function by
its BTF ID to its address.

Ideas that came around so far:

  - prefix symbols with filenames in BTF [Timo], like:
    fentry/kernel/reboot.c:type_show
  - using declaration tags [Yonghong] [2]

It'd be great to have a discussion about that.

thanks,
jirka


[1] https://lore.kernel.org/bpf/1675790102-23037-1-git-send-email-alan.maguire@xxxxxxxxxx/
[2] https://lore.kernel.org/bpf/ac273c04-3066-dd63-934c-f62650c41f8f@xxxxxxxx/



[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