site_archiver(a)lists.apple.com
Delivered-To: darwin-kernel(a)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(a)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(a)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(a)lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/darwin-kernel/slepetit%40apple.com
>
> This email sent to slepetit(a)apple.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (Darwin-kernel(a)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(a)lists.apple.com
site_archiver(a)lists.apple.com
Delivered-To: darwin-kernel(a)lists.apple.com
Dkim-filter: OpenDKIM Filter v2.10.3 mail.lundman.net AA1081271B4
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=lundman.net; s=dkim; t=1499913758; bh=+eaRUBh0X01H4VzQdYXSb2olNq1Abkd9KmHOK+Yt1c4=; h=To:From:Subject:Date; b=aDk2H9ST7m0WbkU3l9klZKwpBYIoBJ0R149aGzvEtwtypdOola3rR6PFzMRmdtyUS ARpB76LPsLWi2LyEhpaDnugHm4Y2zXM+R1iAHSuiWoJtg61v9LgdMfTZUCVObSNTJ6 /oz05KcpKeXE1+PWsoGT6WMEcK/ENxvM5zGbSQAk=
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46
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(a)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(a)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(a)lists.apple.com