From rmilkowski at task.gda.pl Mon Apr 4 04:47:52 2005 From: rmilkowski at task.gda.pl (Robert Milkowski) Date: Mon, 4 Apr 2005 13:47:52 +0200 Subject: [DTrace] Arguments in PID provider In-Reply-To: <20050331172724.GE8955@eng.sun.com> References: <1368822644.20050330145213@task.gda.pl> <20050331172724.GE8955@eng.sun.com> Message-ID: <261640323.20050404134752@task.gda.pl> Hello Adam, As usually quick and accurate response! - thank you!. Thursday, March 31, 2005, 7:27:24 PM, you wrote: AL> Hey Robert, AL> Good question. It's kind of tricky and it will change depending on the AL> ISA, but you can do it. AL> sparc 32-bit: AL> this->argN = AL> *(uint32_t *)copyin(uregs[R_SP] + sizeof (uint32_t) * (N + 17), AL> sizeof (uint32_t)); AL> (only applies to args past the first 6) This one (above) works ok. AL> sparc 64-bit: AL> this->argN = AL> *(uint32_t *)copyin(uregs[R_SP] + 0x7ff + AL> sizeof (uint64_t) * (N + 16), sizeof (uint64_t)); AL> (only applies to args past the first 6) this one I had to chane first uint32_t type to uint64_t and then it works. AL> x86: AL> this->argN = AL> *(uint32_t *)copyin(uregs[R_SP] + sizeof (uint32_t) * (N + 1), AL> sizeof (uint32_t)); AL> amd64: AL> this->argN = AL> *(uint64_t *)copyin(uregs[R_SP] + sizeof (uint64_t) * (N - 5), AL> sizeof (uint64_t)); AL> (only applies to args past the first 6) AL> If you run into any problems with those let me know. One tricky thing about AL> amd64 is that the compiler seems free to use as much or as little of the AL> 64 bits allotted to each argument so if you pass an int, the first 32-bits AL> will contain the value of the 32-bit int, and the upper 32-bits will be AL> garbage. Of course, you can just cast the value to an int, but it's a AL> pitfall to watch out for. AL> We're working on getting the args array working for the pid provider and AL> we'll consider allowing more than just 10 args. Great! -- Best regards, Robert mailto:rmilkowski at task.gda.pl From keith.wesolowski at sun.com Thu Apr 7 12:55:49 2005 From: keith.wesolowski at sun.com (Keith M Wesolowski) Date: Thu, 7 Apr 2005 12:55:49 -0700 Subject: [DTrace] fbt and gcc Message-ID: <20050407195549.GB737@sun.com> Two minor problems are noted with fbt when using kernels compiled with gcc: 1. Tables containing legal but meaningless instructions trigger warnings of the form: Apr 6 18:07:27 flask fbt: [ID 783403 kern.notice] NOTICE: strange leaf jmpl/call delay at 7b277b60 Apr 6 18:07:27 flask fbt: [ID 783403 kern.notice] NOTICE: strange leaf jmpl/call delay at 7b277b64 Apr 6 18:07:27 flask fbt: [ID 783403 kern.notice] NOTICE: strange leaf jmpl/call delay at 7b277b68 Apr 6 18:07:27 flask fbt: [ID 783403 kern.notice] NOTICE: strange leaf jmpl/call delay at 7b277b6c The instructions in question look like: geterrno+0x140: call -0x136216d0 <0x67c56490> geterrno+0x144: call -0x136216d0 <0x67c56494> geterrno+0x148: call -0x136216b0 <0x67c564b8> 0x7b277b6c: illtrap 0 0x7b277b70: illtrap 0 Since these aren't really calls, fbt does the right thing. The messages are harmless but voluminous. The examples I've looked at invariably have the table between functions. Determining that these instructions are unreachable, however, seems impractical. Any suggestions? 2. fbt refuses to instrument functions whose first instruction is a branch other than non-annulled ba. However, gcc compiles functions like int foo(void *bar) { if (bar == NULL) return (0); ... } into failover_safe: brz,pn %o0, +0x38 failover_safe+4: clr %o5 failover_safe+8: ldx [%o0], %o0 ... which is not incorrect. There are unfortunately quite a few of these functions, though the only negative impact is that they aren't instrumented and warnings are issued on the console. A grovel through bugster doesn't show that anyone's run across this yet. How difficult would it be to instrument these? -- Keith M Wesolowski "Sir, we're surrounded!" Solaris Kernel Team "Excellent; we can attack in any direction!" From bmc at zion.eng.sun.com Thu Apr 7 13:07:22 2005 From: bmc at zion.eng.sun.com (Bryan Cantrill) Date: Thu, 7 Apr 2005 13:07:22 -0700 (PDT) Subject: [DTrace] fbt and gcc In-Reply-To: <20050407195549.GB737@sun.com> from Keith M Wesolowski at "Apr 7, 2005 12:55:49 pm" Message-ID: <200504072007.j37K7MCH019411@zion.eng.sun.com> > The instructions in question look like: > > geterrno+0x140: call -0x136216d0 <0x67c56490> > geterrno+0x144: call -0x136216d0 <0x67c56494> > geterrno+0x148: call -0x136216b0 <0x67c564b8> > 0x7b277b6c: illtrap 0 > 0x7b277b70: illtrap 0 > > Since these aren't really calls, fbt does the right thing. The > messages are harmless but voluminous. > > The examples I've looked at invariably have the table between > functions. Determining that these instructions are unreachable, > however, seems impractical. Any suggestions? Hmmm....the fact that they are inside the bounds of the text symbol makes this difficult. I think the message should probably just be suppressed if this is coming up often... > 2. fbt refuses to instrument functions whose first instruction is a > branch other than non-annulled ba. However, gcc compiles functions > like > > int > foo(void *bar) { > if (bar == NULL) > return (0); > > ... > } > > into > > failover_safe: brz,pn %o0, +0x38 > failover_safe+4: clr %o5 > failover_safe+8: ldx [%o0], %o0 > ... > > which is not incorrect. There are unfortunately quite a few of these > functions, though the only negative impact is that they aren't > instrumented and warnings are issued on the console. A grovel through > bugster doesn't show that anyone's run across this yet. How difficult > would it be to instrument these? If they're all branch on register conditions, it's not terribly difficult -- just a tad unpleasant. If they're branching on condition codes, that's much more of a pain -- but it seems very unlikely that such senseless code would be generated. (I would say that such code would always be incorrect, but I suppose it could still be technically correct to have something like "bg,a +8 ; nop" as a function preamble.) - Bryan -------------------------------------------------------------------------- Bryan Cantrill, Solaris Kernel Development. http://blogs.sun.com/bmc From rmilkowski at task.gda.pl Tue Apr 19 02:00:42 2005 From: rmilkowski at task.gda.pl (Robert Milkowski) Date: Tue, 19 Apr 2005 11:00:42 +0200 Subject: [DTrace] DTracing Java! Message-ID: <1841797282.20050419110042@task.gda.pl> Hello dtrace, http://blogs.sun.com/roller/page/bmc/20050418#your_java_fell_into_my http://blogs.sun.com/roller/page/ahl/20050418#dtracing_java https://solaris10-dtrace-vm-agents.dev.java.net/ Wow! -- Best regards, Robert mailto:rmilkowski at task.gda.pl From dp at eng.sun.com Tue Apr 19 02:23:02 2005 From: dp at eng.sun.com (Dan Price) Date: Tue, 19 Apr 2005 02:23:02 -0700 Subject: [DTrace] DTracing Java! In-Reply-To: <1841797282.20050419110042@task.gda.pl> References: <1841797282.20050419110042@task.gda.pl> Message-ID: <20050419092302.GT826@eng.sun.com> On Tue 19 Apr 2005 at 11:00AM, Robert Milkowski wrote: > Hello dtrace, > > > http://blogs.sun.com/roller/page/bmc/20050418#your_java_fell_into_my > http://blogs.sun.com/roller/page/ahl/20050418#dtracing_java > https://solaris10-dtrace-vm-agents.dev.java.net/ > Yeah, no kidding. I got waved into Bryan's office today, as I have so many times in the past with "wanna see something neat?" A great contribution already available under CDDL. Whoohoo! -dp -- Daniel Price - Solaris Kernel Engineering - dp at eng.sun.com - blogs.sun.com/dp From rmilkowski at task.gda.pl Tue Apr 19 03:06:48 2005 From: rmilkowski at task.gda.pl (Robert Milkowski) Date: Tue, 19 Apr 2005 12:06:48 +0200 Subject: [DTrace] DTracing Java! In-Reply-To: <20050419092302.GT826@eng.sun.com> References: <1841797282.20050419110042@task.gda.pl> <20050419092302.GT826@eng.sun.com> Message-ID: <546043753.20050419120648@task.gda.pl> Hello Dan, Tuesday, April 19, 2005, 11:23:02 AM, you wrote: DP> On Tue 19 Apr 2005 at 11:00AM, Robert Milkowski wrote: >> Hello dtrace, >> >> >> http://blogs.sun.com/roller/page/bmc/20050418#your_java_fell_into_my >> http://blogs.sun.com/roller/page/ahl/20050418#dtracing_java >> https://solaris10-dtrace-vm-agents.dev.java.net/ >> DP> Yeah, no kidding. I got waved into Bryan's office today, as I have so DP> many times in the past with "wanna see something neat?" Lucky you are! :) All the rest of the world have to wait for blogs... but what would we do without blogs? :))))) -- Best regards, Robert mailto:rmilkowski at task.gda.pl From dp at eng.sun.com Tue Apr 19 03:18:50 2005 From: dp at eng.sun.com (Dan Price) Date: Tue, 19 Apr 2005 03:18:50 -0700 Subject: [DTrace] DTracing Java! In-Reply-To: <546043753.20050419120648@task.gda.pl> References: <1841797282.20050419110042@task.gda.pl> <20050419092302.GT826@eng.sun.com> <546043753.20050419120648@task.gda.pl> Message-ID: <20050419101849.GV826@eng.sun.com> On Tue 19 Apr 2005 at 12:06PM, Robert Milkowski wrote: > DP> Yeah, no kidding. I got waved into Bryan's office today, as I have so > DP> many times in the past with "wanna see something neat?" > > Lucky you are! :) > > All the rest of the world have to wait for blogs... but what would we > do without blogs? :))))) But hey, it's not bad, right? I found out about it in the office today, and you heard it about three hours later! -dp -- Daniel Price - Solaris Kernel Engineering - dp at eng.sun.com - blogs.sun.com/dp From rmilkowski at task.gda.pl Tue Apr 19 04:29:15 2005 From: rmilkowski at task.gda.pl (Robert Milkowski) Date: Tue, 19 Apr 2005 13:29:15 +0200 Subject: [DTrace] DTracing Java! In-Reply-To: <20050419101849.GV826@eng.sun.com> References: <1841797282.20050419110042@task.gda.pl> <20050419092302.GT826@eng.sun.com> <546043753.20050419120648@task.gda.pl> <20050419101849.GV826@eng.sun.com> Message-ID: <1919843840.20050419132915@task.gda.pl> Hello Dan, Tuesday, April 19, 2005, 12:18:50 PM, you wrote: DP> On Tue 19 Apr 2005 at 12:06PM, Robert Milkowski wrote: >> DP> Yeah, no kidding. I got waved into Bryan's office today, as I have so >> DP> many times in the past with "wanna see something neat?" >> >> Lucky you are! :) >> >> All the rest of the world have to wait for blogs... but what would we >> do without blogs? :))))) DP> But hey, it's not bad, right? I found out about it in the office today, DP> and you heard it about three hours later! Of course it's not bad! Quite the opposite! The whole idea of blogging by Sun's engineers is imho one of the best things Sun has ever done. To some extend, after "Sun" started to blogging, Sun is no longer just a corporation - now there are people, ideas, communication, ... I read blogs on regular basis (some of them) as "normal" and often primary source of information of what's going on with Solaris. ps. in a few years maybe Sun's folks will have cameras attached to their heads with live streaming in the Internet :)))) just kidding :) -- Best regards, Robert mailto:rmilkowski at task.gda.pl From brendan.gregg at tpg.com.au Wed Apr 20 06:51:45 2005 From: brendan.gregg at tpg.com.au (Brendan Gregg) Date: Wed, 20 Apr 2005 23:51:45 +1000 (EST) Subject: [DTrace] DTracing Java! In-Reply-To: <1919843840.20050419132915@task.gda.pl> Message-ID: On Tue, 19 Apr 2005, Robert Milkowski wrote: > Hello Dan, > > Tuesday, April 19, 2005, 12:18:50 PM, you wrote: > > DP> On Tue 19 Apr 2005 at 12:06PM, Robert Milkowski wrote: > >> DP> Yeah, no kidding. I got waved into Bryan's office today, as I have so > >> DP> many times in the past with "wanna see something neat?" > >> > >> Lucky you are! :) > >> > >> All the rest of the world have to wait for blogs... but what would we > >> do without blogs? :))))) > > DP> But hey, it's not bad, right? I found out about it in the office today, > DP> and you heard it about three hours later! > > Of course it's not bad! Quite the opposite! > > The whole idea of blogging by Sun's engineers > is imho one of the best things Sun has ever done. > > To some extend, after "Sun" started to blogging, Sun is no longer just > a corporation - now there are people, ideas, communication, ... Actually, my biggest suprise was to learn how few kernel engineers there are. Before blogging I had no idea - I thought there must have been around a thousand kernel engineers, considering Sun hires around 30,000 in total. After blogging I get the feeling there is only about two dozen kernel engineers after all! Or at least, two dozen who have written all the interesting stuff. :) Brendan From brendan.gregg at tpg.com.au Thu Apr 21 04:24:23 2005 From: brendan.gregg at tpg.com.au (Brendan Gregg) Date: Thu, 21 Apr 2005 21:24:23 +1000 (EST) Subject: [DTrace] DTrace Toolkit Message-ID: G'Day Folks, DTrace needs you! There is a new website at, https://www.opensolaris.org/projects/Wiki.jsp?page=DTraceToolkit that can serve as the development grounds for a "DTrace Toolkit" - a packaged freeware collection of useful DTrace based tools. Tools written by all of us! I've written up a few guidelines, created a table of contents, and added a few scripts to get the ball rolling. The guidelines are standard Unix conventions - keep it simple, do one task well, document, etc (see Kernighan/Pike, "Art of Unix Programming" ESR...). Feel free to dive in and edit the site, the wiki does do write locks to prevent us from stepping on each others toes. Perhaps a good safty measure is to save " is currently editing this" at the top of the site when you begin editing, and remove it when finished. A while ago it was discussed here if we could put DTrace tools on http://www.sunfreeware.com, bigadmin or straight into /usr/demo/dtrace. Let's just start by writing the tools! We can distribute the toolkit after it has been documented, tested and packaged up nicely. :-) We can also start a few extra threads on this list to discuss coding style, script usefullness, etc. If you are a little unsure about a scripts inclusion, you can post it to the list and I'm sure many of us will be glad to provide feedback. Another welcome post to this list is suggestions for scripts. Please say what you'd like to see in a toolkit that would be useful for you. ... and I imagine some of you already have pet scripts that belong in a toolkit (eg, Alan, Jarod, Dan, etc... :-) Brendan [Sydney, Australia] From dp at eng.sun.com Thu Apr 21 15:38:15 2005 From: dp at eng.sun.com (Dan Price) Date: Thu, 21 Apr 2005 15:38:15 -0700 Subject: [DTrace] DTrace Toolkit In-Reply-To: References: Message-ID: <20050421223815.GQ3486@eng.sun.com> On Thu 21 Apr 2005 at 09:24PM, Brendan Gregg wrote: > Feel free to dive in and edit the site, the wiki does do write locks to > prevent us from stepping on each others toes. Perhaps a good safty measure > is to save " is currently editing this" at the top of the site when > you begin editing, and remove it when finished. Sounds like we might need to add a lock notification/management to the website's infrastructure, perhaps? Thanks for identifying it. I'll speak to Derek. -dp -- Daniel Price - Solaris Kernel Engineering - dp at eng.sun.com - blogs.sun.com/dp From schilling at fokus.fraunhofer.de Fri Apr 22 07:50:20 2005 From: schilling at fokus.fraunhofer.de (Joerg Schilling) Date: Fri, 22 Apr 2005 16:50:20 +0200 Subject: [DTrace] DTracing Java! In-Reply-To: References: Message-ID: <42690F2C.nailM3Y3XGH4M@burner> Brendan Gregg wrote: > > To some extend, after "Sun" started to blogging, Sun is no longer just > > a corporation - now there are people, ideas, communication, ... > > Actually, my biggest suprise was to learn how few kernel engineers there > are. Before blogging I had no idea - I thought there must have been around > a thousand kernel engineers, considering Sun hires around 30,000 in total. > > After blogging I get the feeling there is only about two dozen kernel > engineers after all! Or at least, two dozen who have written all the > interesting stuff. :) >From a discussion with Sun enginer from around 1990 I know that there is a rule like: "You cannot coordinate more than approx. 30 Kernel hackers". J?rg -- EMail:joerg at schily.isdn.cs.tu-berlin.de (home) J?rg Schilling D-13353 Berlin js at cs.tu-berlin.de (uni) schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily From brendan.gregg at tpg.com.au Thu Apr 28 08:18:38 2005 From: brendan.gregg at tpg.com.au (Brendan Gregg) Date: Fri, 29 Apr 2005 01:18:38 +1000 (EST) Subject: [DTrace] DTrace Toolkit In-Reply-To: Message-ID: G'Day Folks, The DTrace Toolkit went missing in the website migration (no problem, I did a backup), but I haven't worked out how to recreate it yet (no add page link?). I'm quite determined to see a decent DTrace Toolkit created, and I think it makes sense to have this developed by the OpenSolaris folk such that it is a community effort (please reply if you think that may not be such a good idea after all!). Just thought I'd better write in case anyone went looking at the link below to find it no longer works. The link may not work, but the DTrace Toolkit is still around (on my home server), I'm still working on it (just wrote four new tools), and hopefully it will return to OpenSolaris. Brendan [Sydney, Australia] On Thu, 21 Apr 2005, Brendan Gregg wrote: > G'Day Folks, > > DTrace needs you! > > There is a new website at, > > https://www.opensolaris.org/projects/Wiki.jsp?page=DTraceToolkit > > that can serve as the development grounds for a "DTrace Toolkit" - a > packaged freeware collection of useful DTrace based tools. Tools written > by all of us! [...]