dtrace: script 'high.d' matched 2 probes dtrace: allowing destructive actions
dtrace: error on enabled probe ID 1 (ID 36: profile:::profile-997): invalid address (0xbffff7c8) in action #2
dtrace: error on enabled probe ID 1 (ID 36: profile:::profile-997): invalid address (0xbfffca28) in action #2
dtrace: error on enabled probe ID 1 (ID 36: profile:::profile-997): invalid address (0xbfffcb58) in action #2
Any suggestions on how to avoid the non-paged memory errors above?
I'd recommend using Instruments and/or Shark for such profiles. The DTrace profile probe cannot give you this information at this time, as ustack() is not effective from the environment where profile probes get triggered. If I remember correctly that's due to not being able to take page faults in that environment.
In fairness, Shark can't do anything special either if it encounters a page fault while walking the stack - it just records a truncated stack, which probably won't be much use as a consequence. Instruments in Leopard can force the page in, I believe, since it does its callstack recording from user space. But it has higher overhead (partly) as a result, so I'd recommend Shark. [[ That I work on Shark only ensures my completely objectivity. ;) ]]
That said, it's exceedingly rare to encounter such a scenario; you'd have to be paging brutally and have extremely long and stagnant stacks; most stacks [of active threads] fit well within a page and are touched very frequently, keeping them effectively pinned in physical memory. Though I don't know any details about the error dtrace is emitting, I would suspect it's not that the frames are paged out but that the addresses are actually invalid - such as you'd see if you have certain kinds of aggressive optimisations turned on (-fomit-frame-pointers, for example), hand-written assembly functions, etc. You actually tend to find these sorts of things in web browsers; I know Safari uses a lot of tricks that confuse profilers.
Though I realise this is the darwin dev list, so if you truly are using 'Darwin' in the conventional sense, then of course Shark and Instruments won't be available for you.
Wade |