Dtrace fasttrap function call usage

pra_udupi pra_udupi at yahoo.co.in
Wed Oct 23 12:52:22 UTC 2013


When using Dtrace pid provider with entry probe or the offset probe on a
program using TLS, dtrace
would hang in tls_get_addr_common function.If you use scanf or fscanf in
your program you can
notice this behaviour. This i believe is due to dtrace using
gs segment register to point to the scratch space, and TLS also loading the
thread variable
from gs register.

if you change the following code in fasttrap_isa.c
<code>
#ifdef __i386__
		addr = USD_GETBASE(&curthread->td_pcb->pcb_gsd);
#else
		addr = curthread->td_pcb->pcb_gsbase;
#endif
		addr += sizeof (void *);	
</code>

to

<code>
#ifdef __i386__
		addr = USD_GETBASE(&curthread->td_pcb->pcb_gsd);
#else
		addr = curthread->td_pcb->pcb_gsbase;
#endif
		addr += sizeof (void *) * 3;	
</code>

the dtrace will not hang. I am not sure what is happening here and 
whether this is the correct solution.
Note: This changes were made in FreeBSD 9.2-RELEASE i386



--
View this message in context: http://freebsd.1045724.n5.nabble.com/Dtrace-fasttrap-function-call-usage-tp5853354p5854274.html
Sent from the freebsd-i386 mailing list archive at Nabble.com.


More information about the freebsd-i386 mailing list