12-07-2007, 12:52 AM #1
Asking about Mach (and how to trace context switch by Dtrace)
- Member Since
- Jul 30, 2007
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.
12-10-2007, 01:34 AM #2
- Member Since
- Mar 14, 2005
- Atlanta, GA
- 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/mact...ace/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?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By Ethan asdf in forum OS X - Development and DarwinReplies: 5Last Post: 02-12-2009, 06:03 PM
By smiles in forum OS X - Operating SystemReplies: 1Last Post: 07-09-2008, 06:40 PM
By Stefan in forum OS X - Operating SystemReplies: 6Last Post: 11-16-2007, 12:49 PM
By rerks in forum OS X - Operating SystemReplies: 6Last Post: 02-21-2007, 08:39 AM