site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hello Jorgen, Unfortunately, SDT probes do not work in kexts on MacOS at the moment (and never have). This is something we are considering though. I suggest you file an enhancement request on https://bugreport.apple.com <https://bugreport.apple.com/> Best, - Samuel Lepetit
On 12Jul 2017, at 19:42, Jorgen Lundman <lundman@lundman.net> wrote:
Hello list,
So we thought we would finally support the Solaris style in-source dtrace probes, which work quite differently in Apple.
Following the section "BUILDING CODE CONTAINING USDT PROBES" in manpage for dtrace;
Going through the steps of "dtrace -h -s dtrace.d" to produce the Apple header "dtrace.h", to include when compiling kext, we eventually end up with:
/tmp/zfs.kext failed to load - (libkern/kext) link error; check the system/kernel logs for errors or try kextutil(8).
# kextutil /tmp/spl.kext/ /tmp/zfs.kext/ (kernel) kxld[net.lundman.zfs]: The Mach-O file is malformed: Invalid section type: 15.
Which seems to come directly from the dtrace produced code:
#define ZFS_TYPEDEFS "___dtrace_typedefs$zfs$v2" #define ZFS_STABILITY "___dtrace_stability$zfs$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0"
__asm__ volatile(".reference " ZFS_TYPEDEFS); \ __dtrace_probe$zfs$zfs__dbgmsg$v1$63686172202a(arg0); \ __asm__ volatile(".reference " ZFS_STABILITY); \
Produced from libkern/kxld/kxld_sect.c:
case S_DTRACE_DOF: default: rval = KERN_FAILURE; kxld_log(kKxldLogLinking, kKxldLogErr, kKxldLogMalformedMachO "Invalid section type: %u.", sect->flags & SECTION_TYPE); goto finish;
Am I missing a step, or does in-source dtrace probes no longer work in KEXTs?
Lund
-- Jorgen Lundman | <lundman@lundman.net> Unix Administrator | +81 (0)90-5578-8500 Shibuya-ku, Tokyo | Japan
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-kernel/slepetit%40apple.com
This email sent to slepetit@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com