Re: private externs break shark on kernel/drivers
Re: private externs break shark on kernel/drivers
- Subject: Re: private externs break shark on kernel/drivers
- From: Brian Bergstrand <email@hidden>
- Date: Fri, 3 Jun 2005 16:10:54 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Download the Kernel Debug Kit <http://developer.apple.com/sdk> and
use the debug image in Shark (hopefully it will let you use an
alternate file -- I don't know though).
$ nm -m /Volumes/KernelDebugKit/mach_kernel | grep m_getpackets_internal
0028974c (__TEXT,__text) non-external (was a private external)
_m_getpackets_internal
HTH.
On Jun 3, 2005, at 3:52 PM, Andrew Gallatin wrote:
>
> I was doing some profiling of my network device driver receiving a TCP
> stream at 3.8Gb/sec.
>
> An L1 data cache miss profile shows the following top functions:
>
> mi_set_interrupts_enabled
> mutex_lock
> mulckPatch_eieio
> sbappend
> my driver's rx function
> m_copy_pkthdr
> hw_compare_and_store
> <....>
>
> Most of these make sense .. they either use a lot of locked
> instructions, or get called often, or both. But when I saw
> m_copy_pkthdr, as #6, I was pretty surprised, and spent about an hour
> scouring the source code, trying to figure out how in the heck it
> could possibly be getting called so often, or with such stale data..
>
> It turns out that the private externs used in the kernel really screw
> up profiling... I'm pretty sure that "m_copy_pkthdr" really means
> m_getpackets_internal, since its the next thing in uipc_mbuf.c,
> and there is no symbol for it found when running nm on /mach_kernel.
>
> When profiling on other systems, seeing unexpected functions high in
> the profile has always been a hint that something is seriously wrong.
> Its going to be hard to break myself of that.
>
> Is there any way we could get the full symbolic information out to
> shark so that its possible to generate meaningful profiles?
Brian Bergstrand
<http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.1 (Build 2179)
iQA+AwUBQqDHZHnR2Fu2x7aiEQJjHQCXVYs5xt9uawwx73uSrn1Umav8XgCfc5g3
U90NzNP4Rok3Vs2dfx8TRSo=
=WWL6
-----END PGP SIGNATURE-----
_______________________________________________
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