Re: dtrace probes in kexts
Re: dtrace probes in kexts
- Subject: Re: dtrace probes in kexts
- From: Samuel Lepetit <email@hidden>
- Date: Thu, 13 Jul 2017 11:14:34 -0700
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 <email@hidden> 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 | <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
_______________________________________________
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