hi, When I read the dtrace script "./Extra/guess.d" in DTraceToolkit 0.92, I found it couldn''t work well. After I entered my number, it then stopped there. I found clause-local variable this->state used in differnet probes. I replaced this->state with state, and then it worked well. But I''m puzzled with arg0, the first argument of the probe syscall::read:entry. Why there are two different comparisons "arg0 == 3"(line 39) and "arg0 == 0"(line 99)? How to distinguish them? Does "arg0 == 0" mean standard input? What about "arg0 == 3"? BTW, I couldn''t download the DTraceToolkit 0.96, and also couldn''t open http://www.brendangregg.com/. Does anyone know why? Thanks! This message posted from opensolaris.org
Hey there - Not sure what your issues with connecting to www.brendangregg.com was, or issues downloading the 0.96 version of the toolkit... I was able to do both without issue. As for the script and it''s behaviour, I''ll leave that to Brendan. :) Nathan. On Tue, 2006-05-16 at 11:15, Yongce Tu wrote:> hi, > > When I read the dtrace script "./Extra/guess.d" in DTraceToolkit 0.92, I found it couldn''t work well. After I entered my number, it then stopped there. I found clause-local variable this->state used in differnet probes. I replaced this->state with state, and then it worked well. > > But I''m puzzled with arg0, the first argument of the probe syscall::read:entry. Why there are two different comparisons "arg0 == 3"(line 39) and "arg0 == 0"(line 99)? How to distinguish them? Does "arg0 == 0" mean standard input? What about "arg0 == 3"? > > BTW, I couldn''t download the DTraceToolkit 0.96, and also couldn''t open http://www.brendangregg.com/. Does anyone know why? > > Thanks! > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing listdtrace-discuss at opensolaris.org -- ////////////////////////////////////////////////////////////////// // Nathan Kroenert nathan.kroenert at sun.com // // PTS Engineer Phone: +61 2 9844-5235 // // Sun Services Direct Ext: x57235 // // Level 2, 828 Pacific Hwy Fax: +61 2 9844-5311 // // Gordon 2072 New South Wales Australia // //////////////////////////////////////////////////////////////////
I don''t suppose you are running this on a multi-cpu box are you? On Tue, 2006-05-16 at 11:15, Yongce Tu wrote:> hi, > > When I read the dtrace script "./Extra/guess.d" in DTraceToolkit 0.92, I found it couldn''t work well. After I entered my number, it then stopped there. I found clause-local variable this->state used in differnet probes. I replaced this->state with state, and then it worked well. > > But I''m puzzled with arg0, the first argument of the probe syscall::read:entry. Why there are two different comparisons "arg0 == 3"(line 39) and "arg0 == 0"(line 99)? How to distinguish them? Does "arg0 == 0" mean standard input? What about "arg0 == 3"? > > BTW, I couldn''t download the DTraceToolkit 0.96, and also couldn''t open http://www.brendangregg.com/. Does anyone know why? > > Thanks! > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing listdtrace-discuss at opensolaris.org -- ////////////////////////////////////////////////////////////////// // Nathan Kroenert nathan.kroenert at sun.com // // PTS Engineer Phone: +61 2 9844-5235 // // Sun Services Direct Ext: x57235 // // Level 2, 828 Pacific Hwy Fax: +61 2 9844-5311 // // Gordon 2072 New South Wales Australia // //////////////////////////////////////////////////////////////////
G''Day, On Mon, 15 May 2006, Yongce Tu wrote:> hi, > > When I read the dtrace script "./Extra/guess.d" in DTraceToolkit 0.92, > I found it couldn''t work well. After I entered my number, it then > stopped there. I found clause-local variable this->state used in > differnet probes. I replaced this->state with state, and then it worked > well.Thanks. Sure, I shouldn''t be using this-> for globals, and that will cause it to hang on multi-processor systems. I noticed another issue as well. I really didn''t dwell on the code - it''s only a game.> But I''m puzzled with arg0, the first argument of the probe > syscall::read:entry. Why there are two different comparisons "arg0 => 3"(line 39) and "arg0 == 0"(line 99)? How to distinguish them? Does > "arg0 == 0" mean standard input? What about "arg0 == 3"?Try "man read.2" arg0 is the file descriptor. At one point it is 0 (STDIN), and another it is 3. The Bourne shell does a dup(2) on STDIN, then uses the other file descriptor for read (which is usually 3). I actually use two versions of read for different purposes, # grep system.*read Extra/guess.d system("read guess"); system("/usr/bin/read name"); system("read line"); depending on whether I want DTrace to scrape keystrokes or entire lines. Actually, you probably don''t want to try and understand guess.d - it''s a bizzare stateful beast, and not a good demonstration of DTrace! It probably doesn''t belong in the toolkit.> BTW, I couldn''t download the DTraceToolkit 0.96, and also couldn''t > open http://www.brendangregg.com/. Does anyone know why?Yes, "www.brendangregg.com" is my DNS pointer, and I''ve found it to fail from within China (I''ve tried from Beijing, Shanghai and Guangzhou). I don''t know why. Try http://users.tpg.com.au/adsln4yb/dtrace.html - this is a temporary location on my current ISP (which is why I have the DNS pointer), and I''ve found it to work fine when my DNS pointer fails. cheers, Brendan [Sydney, Australia]
G''Day Nathan, On Tue, 16 May 2006, Nathan Kroenert wrote:> I don''t suppose you are running this on a multi-cpu box are you?Yep - that would be it. :) I''ve already updated it here, http://www.brendangregg.com/Guess/guess.d ( part of http://www.brendangregg.com/guessinggame.html ) and it''ll be in the next update of the toolkit. Brendan> On Tue, 2006-05-16 at 11:15, Yongce Tu wrote: > > hi, > > > > When I read the dtrace script "./Extra/guess.d" in DTraceToolkit 0.92, I found it couldn''t work well. After I entered my number, it then stopped there. I found clause-local variable this->state used in differnet probes. I replaced this->state with state, and then it worked well. > > > > But I''m puzzled with arg0, the first argument of the probe syscall::read:entry. Why there are two different comparisons "arg0 == 3"(line 39) and "arg0 == 0"(line 99)? How to distinguish them? Does "arg0 == 0" mean standard input? What about "arg0 == 3"? > > > > BTW, I couldn''t download the DTraceToolkit 0.96, and also couldn''t open http://www.brendangregg.com/. Does anyone know why? > > > > Thanks! > > > > > > This message posted from opensolaris.org > > _______________________________________________ > > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org > -- > ////////////////////////////////////////////////////////////////// > // Nathan Kroenert nathan.kroenert at sun.com // > // PTS Engineer Phone: +61 2 9844-5235 // > // Sun Services Direct Ext: x57235 // > // Level 2, 828 Pacific Hwy Fax: +61 2 9844-5311 // > // Gordon 2072 New South Wales Australia // > ////////////////////////////////////////////////////////////////// > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org > >
G''Day, To Nathan,> I don''t suppose you are running this on a multi-cpu box are you?Yes. To Brendan, The website, http://users.tpg.com.au/adsln4yb/dtrace.html, works well! Thanks very much! Thank you for your kindness! cheers, tyc This message posted from opensolaris.org