I was looking at some assembly on mdb and noticed that calls to DTRACE_PROBE1() were seen as ~5 nops. Could anyone explain me why''s that ? thanks Rafael
When you run dtrace -G it places nops at the probe sites. One of those nops will then be replaced with a trap instruction when the probe is enabled by your D script. I''ve been meaning to write up a blog entry describing how USDT works, but I''ve been afraid that only James McIlree and I would find it interesting. Adam On Mon, Jun 16, 2008 at 09:34:26PM +0100, Rafael Vanoni wrote:> I was looking at some assembly on mdb and noticed that calls to > DTRACE_PROBE1() were seen as ~5 nops. > > Could anyone explain me why''s that ? > > thanks > Rafael > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Rafael Vanoni writes:> I was looking at some assembly on mdb and noticed that calls to > DTRACE_PROBE1() were seen as ~5 nops. > > Could anyone explain me why''s that ?That''s where the probes are patched in at run time. -- James Carlson, Solaris Networking <james.d.carlson at sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
Adam Leventhal wrote:> When you run dtrace -G it places nops at the probe sites. One of those nops > will then be replaced with a trap instruction when the probe is enabled by > your D script.Thanks for the reply. And how does dtrace keep track of which address to replace for a given probe ?> I''ve been meaning to write up a blog entry describing how USDT works, but > I''ve been afraid that only James McIlree and I would find it interesting.I would too :) Rafael> > Adam > > On Mon, Jun 16, 2008 at 09:34:26PM +0100, Rafael Vanoni wrote: >> I was looking at some assembly on mdb and noticed that calls to >> DTRACE_PROBE1() were seen as ~5 nops. >> >> Could anyone explain me why''s that ? >> >> thanks >> Rafael >> _______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org >
2008/6/16 Adam Leventhal <ahl at eng.sun.com>:> When you run dtrace -G it places nops at the probe sites. One of those nops > will then be replaced with a trap instruction when the probe is enabled by > your D script. > > I''ve been meaning to write up a blog entry describing how USDT works, but > I''ve been afraid that only James McIlree and I would find it interesting.Not at all! I''ve been staring at those 5 nops just recently trying to work out why my Ruby-probes weren''t firing, and I''m just about to start writing up what I''ve managed to figure out... I''d definitely be interested in the details. Chris.
> Adam Leventhal wrote: >> I''ve been meaning to write up a blog entry describing how USDT works, but >> I''ve been afraid that only James McIlree and I would find it interesting.On Mon, Jun 16, 2008 at 01:58:53PM -0700, Michael Schuster wrote:> not so! ;-)On Mon, Jun 16, 2008 at 10:05:48PM +0100, Rafael Vanoni wrote:> I would too :)On Mon, Jun 16, 2008 at 10:10:42PM +0100, Chris Andrews wrote:> Not at all! I''ve been staring at those 5 nops just recently trying to > work out why my Ruby-probes weren''t firing, and I''m just about to > start writing up what I''ve managed to figure out... I''d definitely be > interested in the details.Thank you, oh loyal shills :-) I''ll knock something together in the next couple of weeks and post to this list when it''s up. Adam -- Adam Leventhal, Fishworks http://blogs.sun.com/ahl