FBT creates entry/return probes for functions which have a corresponding ELF symbol. For e.g., copyout(), we'll get fbt::copyout{,_smap,_nosmap}:entry. Now users need to know which one to select. In particular, fbt::copyout:entry never fires now. I think FBT should be made to treat STT_GNU_IFUNC symbols specially: when enabling a probe on such a function, invoke the resolver to find the true address, and put a probe there instead.
Hmm, it looks like we're already patching the right instruction since linker_file_function_listall() returns the resolved ifunc address for each ifunc. But the probe isn't firing for some reason.
The real problem is that with ifuncs we create multiple probes with the same tracepoint, and fbt_invop() just returns after the first probe.
https://reviews.freebsd.org/D16921
A commit references this bug: Author: markj Date: Tue Aug 28 20:21:38 UTC 2018 New revision: 338359 URL: https://svnweb.freebsd.org/changeset/base/338359 Log: Allow multiple FBT probes to share a tracepoint. With GNU ifuncs, multiple FBT probes may correspond to the same instruction. fbt_invop() assumed that this could not happen and would return after the first probe found in the global FBT hash table, which might not be the one that's enabled. Fix the problem on x86 by linking probes that share a tracepoint and having each linked probe fire when the tracepoint is hit. PR: 230846 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16921 Changes: head/sys/cddl/dev/fbt/aarch64/fbt_isa.c head/sys/cddl/dev/fbt/arm/fbt_isa.c head/sys/cddl/dev/fbt/fbt.c head/sys/cddl/dev/fbt/fbt.h head/sys/cddl/dev/fbt/mips/fbt_isa.c head/sys/cddl/dev/fbt/powerpc/fbt_isa.c head/sys/cddl/dev/fbt/riscv/fbt_isa.c head/sys/cddl/dev/fbt/x86/fbt_isa.c