[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-dtrace-discuss
Subject:    Re: [dtrace-discuss] Iterating over all LWPs
From:       Jon Haslam <Jonathan.Haslam () Sun ! COM>
Date:       2008-03-26 21:38:21
Message-ID: 47EAC24D.1000406 () sun ! com
[Download RAW message or body]


>> Using time based probes to iterate over data structures is
>> problematic as the data structures may well change beneath you.
>> I offered this up as an example of how to iterate over data structures
>> using a tick probe as it gets referenced quite a bit but there aren't that
>> many examples around of how to do it. The important point about
>> this technique is for the user to be aware of its limitations and
>> how the data they are observing is modified.
>
> Thanks for confirming my hunch. I guess at this point the only question
> I have left is: what is really going to happen the next time
> I do t->t_forw? A SEGV? Or I'll be just off to chasing these pointers
> forever? See, I really don't know kernel well enough to make
> even an educated guess here. Any help would be appreciated.

If the data that you're using becomes invalid the logic of your
script may be affected or you may see runtime errors reported by
dtrace(1M) when you try and dereference invalid pointers (for example).
However, you shouldn't see any failures (such as a SEGV or panic) as
safety is baked into the design of DTrace - you can dereference all the
bad pointers you want from within your D script and all you see is a ton
of error messages reported back to you.

Jon.
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic