Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2013 05:52:21 -0700 (PDT)
From:      pra_udupi <pra_udupi@yahoo.co.in>
To:        freebsd-i386@freebsd.org
Subject:   Re: Dtrace fasttrap function call usage
Message-ID:  <1382532741203-5854274.post@n5.nabble.com>
In-Reply-To: <1382269110605-5853354.post@n5.nabble.com>
References:  <1382269110605-5853354.post@n5.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1382532741203-5854274.post>