On 02/20/09 04:13, Darren Reed wrote:
On 19/02/09 05:42 AM, Pramod Batni wrote:
Darren Reed wrote:
What I'd like to be able to do is include functions such as
rw_enter in fbt scripting. The problem I'm faced with is
that functions such as these appear to not be present in
fbt, only rw_enter_sleep...
I glanced over at lockstat but rw-acquired is on the wrong
side of the lock for me.
What I'm trying to do is provoke a race condition and
the easiest way that I could think of would be to force
the thread to sleep as its about to enter the protected
section of code.
I am not sure you could force a thread to sleep from the DTrace
script.
raise(SIGSTOP)
seems like it would do the trick...
If the protected section of code has a
cv_wait_sig/cv_waituntil_sig/cv_timedwait_sig.
If you enable the rw_enter_sleep:entry probe and in the action
raise(SIGSTOP) the thread
will not stop with the stack leading to rw_enter_sleep().
Did you consider using the chill() action ? [You could put a probe
either in the caller of the rw_enter function or in rw_enter_sleep
and have it
spin on the cpu for few milliseconds using chill()]
In my experiments i have found that the chill() action does widen
the race windows.
Yes, I can add a specific probe into the code to enable me
to do what I want, but that doesn't help me debug something
when I'm not able to recompile the code with a special new
dtrace probe in it.
I realise i was not precise enough. Apologies.
What I meant is enable the probe rw_enter_sleep::entry and in the
action clause for that probe call chill();
Pramod
Darren
Is there any chance of there being RFE-able work here
to provide an fbt or other probe pre-lock on the "leading"
edge of functions such as rw_enter?
Darren
_______________________________________________
dtrace-discuss mailing list
[email protected]
_______________________________________________
dtrace-discuss mailing list
[email protected]