Summary: | dtrace FBT doesn't know about ifuncs | ||
---|---|---|---|
Product: | Base System | Reporter: | Mark Johnston <markj> |
Component: | kern | Assignee: | Mark Johnston <markj> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | avg, dtrace, emaste |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Mark Johnston
![]() ![]() 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. 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 |