Asking about Mach (and how to trace context switch by Dtrace)

Joined
Jul 30, 2007
Messages
1
Reaction score
0
Points
1
Hi,

A have a question about tracing context switch events on Mac OS 10.5 based on dtrace. I would like to ask a more general question about Mach and then describe my specific question.

My generl question about Mach is: Does all system call of Darwin finally call some mach_kernel methods? I'm new to Mac and not very clear about the relationship between Mach and Darwin.

My specific question about tracing context switch events is to figure out the right dtrace probes I shall enable. Since I cannot find sched provider on Mac OS 10.5, I want to turn to find the corresponding mach_kernel calls and enable them according to fbt provider. I found a mach_kernel naming thread_switch but I'm not sure whether other mach_kernel methods will result in the context switch. Or other system calls besides mach_kernel calls?

Any ideas about these two questions are appreciated.
 
Joined
Mar 14, 2005
Messages
443
Reaction score
3
Points
18
Location
Atlanta, GA
Your Mac's Specs
17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM
"My generl question about Mach is: Does all system call of Darwin finally call some mach_kernel methods? I'm new to Mac and not very clear about the relationship between Mach and Darwin."

I am sure that if you do an all system call the mach_kernel would eventually be reached, but I am not sure how to prove this... I guess that is your question.

First step is to go here: http://developer.apple.com/ and search forums.

I found a good article here: http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html

These are great examples and I found a few tags you can use with DTrace to see where the program is going. Are you debugging some code your wrote, or are you trying to find out if a application is eventually accessing the kernel when you do something within the application? Are you writing a plug-in or something?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top