I need to get the information about context-switches (system wide) - that is, I need a DTrace event recorded whenever a thread becomes active on a given CPU.
In OSX 10.10 (and 10.9) I used fbt::thread_dispatch probe, e.g.
dtrace -n fbt::thread_dispatch:return
However, in OSX 10.11 I don't see thread_dispatch - in fact, the entire fbt provider seems to be missing. I tried using probes from sched - e.g. thread_continue and thread_unblock - but they don't work as expected for some reason, I either get the event when the new thread isn't active so thread id seems to point to the old thread, or I don't *always* get the event even when a thread gets unscheduled which leads to incomplete information.
Is there another way to get this data? Maybe one of sched events should work and I'm just not interpreting the data properly?
ISTR that DTrace is gated by system integrity protection. Try disabling that. See WWDC 2015 Session 706 Security and Your Apps.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"