Re: dtrace return hook missing for some iokit funcs?
Re: dtrace return hook missing for some iokit funcs?
- Subject: Re: dtrace return hook missing for some iokit funcs?
- From: Terry Lambert <email@hidden>
- Date: Wed, 21 Apr 2010 16:32:43 -0700
On Apr 21, 2010, at 2:08 PM, Andrew Gallatin wrote:
I'm trying to figure out why createMappingInTas is failing, so I
wrote a
simple dtrace script using self->follow=1 and dumping the args.
But I can't neatly terminate it, because there is a dtrace fbt
hook for _ZN18IOMemoryDescriptor19createMappingInTaskEP4taskymyy:entry
but not _ZN18IOMemoryDescriptor19createMappingInTaskEP4taskymyy:return
in 10.6.3
Eg:
% sudo dtrace -l | grep MemoryDescriptor19createMappingInTask
3361 fbt mach_kernel
_ZN18IOMemoryDescriptor19createMappingInTaskEP4taskymyy
[IOMemoryDescriptor::createMappingInTask] entry
%
Is this intentional? Or just some optimization issue?
It's an optimization issue; the code results in a tail call to
makeMapping(), and it misses the return (basically, because there
isn't one). If you failed to get a memory mapping via new
IOMemoryMap, it also does this.
There are three ways this function can fail:
(1) the new fails (you are out of kernel memory)
(2) the mapping->init() fails; generally because the parameters are
out of range
(3) the makeMapping() fails; generally because the task you were
trying to map it into is no more
If you compile a DEBUG kernel, you will get an IOLog telling you more
or less exactly what's going on.
You can also dtrace the tail-called function return value for the
functions involved, which would also get you the result code.
-- Terry
_______________________________________________
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