dtrace probes in kexts
dtrace probes in kexts
- Subject: dtrace probes in kexts
- From: Jorgen Lundman <email@hidden>
- Date: Thu, 13 Jul 2017 11:42:23 +0900
- Dkim-filter: OpenDKIM Filter v2.10.3 mail.lundman.net AA1081271B4
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 | <email@hidden>
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden