[dtrace-discuss] Integer overflow in aggregations

2007-10-22 Thread Chad Mynhier
What's the policy WRT integer overflow in aggregations? From what I can tell, it's just silently ignored. Is this the de facto policy? (I can't find any mention of it in the dtrace doc nor in the dtrace-discuss archives.) For example, /usr/src/uts/common/dtrace/dtrace.c defines this function:

Re: [dtrace-discuss] Proposal: standard deviation aggregating function

2007-11-01 Thread Chad Mynhier
Dan Price pointed out the confusing wording in the The planned implementation invovles paragraph. Here's a better version: SUMMARY This fast-track enhances the DTrace utility to address an existing RFE[1] requesting an aggregating function to calculate standard

Re: [dtrace-discuss] Proposal: standard deviation aggregating function

2007-11-02 Thread Chad Mynhier
On 11/1/07, Alexander Kolbasov [EMAIL PROTECTED] wrote: SUMMARY This fast-track enhances the DTrace utility to address an existing RFE[1] requesting an aggregating function to calculate standard deviation, similar to the current aggregating function for

[dtrace-discuss] 6593259: libdtrace should prefer pid probes to breakpoints

2008-01-06 Thread Chad Mynhier
I've been looking at this bug. What I think needs to be done is the following: - In dt_proc_control(), create a separate dtrace handle with the destructive option set. - In dt_proc_bp_create() (or the equivalent-but-renamed function), do something similar to the following instead of creating a

Re: [dtrace-discuss] 6593259: libdtrace should prefer pid probes to breakpoints

2008-01-16 Thread Chad Mynhier
Sorry for the delay in the reply. On Jan 7, 2008 1:27 PM, Adam Leventhal [EMAIL PROTECTED] wrote: On Sun, Jan 06, 2008 at 08:37:32PM -0500, Chad Mynhier wrote: I've been looking at this bug. What I think needs to be done is the following: [snip] I've tried the above, and I see

Re: [dtrace-discuss] DTrace contribution: Chad Mynhier

2008-02-07 Thread Chad Mynhier
On Feb 7, 2008 8:00 PM, Adam Leventhal [EMAIL PROTECTED] wrote: Congratulations and thanks to Chad Mynhier for a substantial contribution to DTrace! Chad has fixed a couple of bugs and added a standard deviation aggregation action. Chad, nice work; now how about an update to the wiki

[dtrace-discuss] Determining curthread pointer (ulwp_t) via libproc on i386

2008-03-03 Thread Chad Mynhier
come up to speed on understanding the Intel architecture segmentation stuff, so I'm hoping someone can help out here.) Thanks, Chad Mynhier ___ dtrace-discuss mailing list dtrace-discuss@opensolaris.org

Re: [dtrace-discuss] Request for code review: the brendan() action

2008-04-03 Thread Chad Mynhier
On Thu, Apr 3, 2008 at 9:51 AM, Jonathan Adams [EMAIL PROTECTED] wrote: I did notice that in .../uts/common/dtrace/dtrace.c you did: 9580 +case DTRACEACT_BRENDAN: 9581 +size = sizeof (uint64_t); 9582 +break;

Re: [dtrace-discuss] Request for code review: the brendan() action

2008-04-10 Thread Chad Mynhier
On Thu, Apr 10, 2008 at 1:12 AM, Adam Leventhal [EMAIL PROTECTED] wrote: On Apr 9, 2008, at 6:01 PM, Chad Mynhier [EMAIL PROTECTED] wrote: I've written this tutorial, to be found here: http://www.solarisinternals.com/wiki/index.php/DTrace_Topics_Adding_An_Action. (I could move

Re: [dtrace-discuss] CPC provider - input welcome

2008-07-15 Thread Chad Mynhier
Hey, Jon, On Mon, Jul 14, 2008 at 5:42 AM, Jon Haslam [EMAIL PROTECTED] wrote: 3. Co-existence with existing tools The provider has priority over per-LWP libcpc usage (i.e. cputrack) for access to counters. In the same manner as cpustat, enabling probes causes all existing per-LWP counter

Re: [dtrace-discuss] CPC provider - input welcome

2008-07-15 Thread Chad Mynhier
Hey, Jon, On Tue, Jul 15, 2008 at 11:15 AM, Jon Haslam [EMAIL PROTECTED] wrote: Hi Chad, Only one of cpustat and DTrace may use the counter hardware at any one time. Ownership of the counters is given on a first-come, first-served basis. I'm curious, how does DTrace interact with DTrace

Re: [dtrace-discuss] printa stddev error

2008-07-24 Thread Chad Mynhier
On Thu, Jul 24, 2008 at 2:12 PM, Chris Kiick [EMAIL PROTECTED] wrote: Hi, Searched for similar errors and nothing came up. Anybody know what this is? When using aggregate stddev, and then trying to print it at END, using printa, I get this error: dtrace: processing aborted: Invalid return

Re: [dtrace-discuss] printa stddev error

2008-07-25 Thread Chad Mynhier
On Fri, Jul 25, 2008 at 2:31 PM, Jonathan Adams [EMAIL PROTECTED] wrote: On Thu, Jul 24, 2008 at 12:12:01PM -0700, Chris Kiick wrote: Hi, Searched for similar errors and nothing came up. Anybody know what this is? When using aggregate stddev, and then trying to print it at END, using

Re: [dtrace-discuss] printa stddev error

2008-07-25 Thread Chad Mynhier
On Fri, Jul 25, 2008 at 3:08 PM, chris kiick [EMAIL PROTECTED] wrote: On Fri, Jul 25, 2008 at 03:05:06PM -0500, Chad Mynhier wrote: Chris, have you filed a bug for this? If not, I can do so. If so, could you give me the number? Thanks, Chad Hot off the press: CR6730130: dtrace missing

Re: [dtrace-discuss] system unresponsive error with file upload monitor script

2008-08-07 Thread Chad Mynhier
On Thu, Aug 7, 2008 at 4:31 PM, Mark Harrison [EMAIL PROTECTED] wrote: Hi all, I'm trying to write a dtrace script to print a list of files uploaded via sftp. I have it working pretty well, except after the script has been running for a few minutes, I get the dtrace: processing aborted: Abort

Re: [dtrace-discuss] system unresponsive error with file upload monitor script

2008-08-08 Thread Chad Mynhier
On Fri, Aug 8, 2008 at 10:07 AM, Mark Harrison [EMAIL PROTECTED] wrote: As a workaround, you might try running with the -w flag (permit destructive actions.) This will skip the deadman timeout processing. (This will only work if you're running as root, though.) I may end up doing that. I'm

Re: [dtrace-discuss] pid: excluding libraries, modules

2008-08-15 Thread Chad Mynhier
On Fri, Aug 15, 2008 at 3:21 AM, [EMAIL PROTECTED] wrote: Hi, I am facing another problem with pid provider. I'd like to trace my application but would like to not to trace libc and libnsl. I could use predicate like /probemod != libc probemod != libnsl/ but having this dtrace keeps

Re: [dtrace-discuss] pid: excluding libraries, modules

2008-08-15 Thread Chad Mynhier
2008/8/15 [EMAIL PROTECTED]: Původní zpráva Od: Chad Mynhier [EMAIL PROTECTED] Předmět: Re: [dtrace-discuss] pid: excluding libraries, modules Datum: 15.8.2008 14:04:25 On Fri, Aug 15, 2008 at 3:21 AM, [EMAIL PROTECTED

Re: [dtrace-discuss] pid: excluding libraries, modules

2008-08-15 Thread Chad Mynhier
2008/8/15 Chad Mynhier [EMAIL PROTECTED]: I've not dug into the gmatch(3GEN) code yet, but I'd guess that it's not matching because of the fully-qualified pathnames. Is this a bug that just needs a basename(3C) call? (I went looking for a bug that matches this, but I couldn't find anything

Re: [dtrace-discuss] [tesla-dev] PowerTOP and suspend/resume

2008-09-19 Thread Chad Mynhier
for everything. On Thu, Sep 18, 2008 at 9:00 PM, Aubrey Li [EMAIL PROTECTED] wrote: On Fri, Sep 19, 2008 at 12:20 AM, Chad Mynhier [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 9:43 PM, Aubrey Li [EMAIL PROTECTED] wrote: I didn't dig into the dtrace problem, just wonder is this expected

[dtrace-discuss] Prelease() behavior (related to 6712247: dtrace -c runs the program despite errors)

2008-10-01 Thread Chad Mynhier
Executive summary: If PR_KLC is set for a process, should Prelease() cause the process to be killed? Details: I've been looking at 6712247 (dtrace -c runs the program despite errors), and it looks like libdtrace expects Prelease() to terminate a process if PR_KLC is set. The code that shows

[dtrace-discuss] DTrace build broken recently?

2008-10-08 Thread Chad Mynhier
I've done a clean build of fresh sources pulled down, and I'm getting core dumps using the version of libdtrace that was built from a full nightly (with no error messages.) Here's what I see on a system bfu'd from these archives: # dtrace -n syscall:::entry Segmentation Fault - core dumped #

Re: [dtrace-discuss] DTrace build broken recently?

2008-10-14 Thread Chad Mynhier
On Thu, Oct 9, 2008 at 12:47 AM, Jonathan Adams [EMAIL PROTECTED] wrote: On Wed, Oct 08, 2008 at 10:26:02PM -0400, Chad Mynhier wrote: I've done a clean build of fresh sources pulled down, and I'm getting core dumps using the version of libdtrace that was built from a full nightly

Re: [dtrace-discuss] pid provider, return not fired when variable argument list

2008-10-21 Thread Chad Mynhier
On Mon, Oct 20, 2008 at 11:33 AM, P. Remek [EMAIL PROTECTED] wrote: Hi, I am using pid provider and I have noticed that return probe is not fired when leaving function with variable number of arguments using va_start and va_stop. Having such code: log() { va_start(ap, fmt);

Re: [dtrace-discuss] Round two: Re: code review req: 6750659 drti.o crashes app due to corrupt environment

2008-11-16 Thread Chad Mynhier
Contributed by Chad Mynhier [EMAIL PROTECTED]. Doh!) Chad ___ dtrace-discuss mailing list dtrace-discuss@opensolaris.org

[dtrace-discuss] DTrace documentation scripting bug

2008-12-11 Thread Chad Mynhier
One of the scripts in the DTrace manual contains a bug. (I searched the archives for this list but didn't find any previous mention of this.) In the chapter for the sched provider, this script is presented as a way to measure CPU latency:

Re: [dtrace-discuss] DTrace documentation scripting bug

2008-12-17 Thread Chad Mynhier
On Thu, Dec 11, 2008 at 11:53 AM, Chad Mynhier cmynh...@gmail.com wrote: Doh! I'll point out my own bug: This script should actually be the following: #!/usr/sbin/dtrace -qs sched:::enqueue { self-ts

Re: [dtrace-discuss] Can I pass a parameter to Dtrace script as a part of function name?

2009-01-17 Thread Chad Mynhier
On Sat, Jan 17, 2009 at 12:43 AM, Qihua Wu dtrace...@gmail.com wrote: I want to trace function whose name has certain value, such as read or write. But seems dtrace can't replace the variable with the value I passed in. bash-3.00$ cat d.d #!/usr/sbin/dtrace -s #pragma D option flowindent

Re: [dtrace-discuss] high sys cpu time, any way to use dtrace to do troubleshooting?

2009-01-20 Thread Chad Mynhier
On Tue, Jan 20, 2009 at 6:23 AM, Chad Mynhier cmynh...@gmail.com wrote: If you don't care about the stack per se, and if it's available to you (I don't know off the top of my head which version this went back into), you could also just aggregate on the kernel function using '@c[func(arg0

Re: [dtrace-discuss] nfsv3 provider: failed to grab process

2009-01-21 Thread Chad Mynhier
On Wed, Jan 21, 2009 at 3:41 PM, River Tarnell ri...@loreley.flyingparchment.org.uk wrote: Edward Pilatowicz: fsflush isn't a real process. it's actually a bunch of kernel threads that look like a processes so it can't be grabbed / stopped. this was my understanding - which makes me wonder

Re: [dtrace-discuss] Can I pass a parameter to Dtrace script as a part of function name?

2009-01-25 Thread Chad Mynhier
On Sat, Jan 17, 2009 at 5:28 PM, Chad Mynhier cmynh...@gmail.com wrote: For example, the following works (at least on build 105, I don't have a stock Solaris 10 system handy at the moment): #!/usr/sbin/dtrace -s syscall::$1:entry { @c[execname,probefunc] = count(); } # ./count

[dtrace-discuss] stack() and ustack() as first-class objects

2009-02-06 Thread Chad Mynhier
Are there any subtle reasons why DTrace can't treat stack traces as first-class objects? They're already slightly better than second-class objects because we can use them as the key to aggregations, but we can't assign them as variables. (Note, I haven't looked closely at the code yet to see

Re: [dtrace-discuss] tracing aio syscalls

2009-02-18 Thread Chad Mynhier
On Wed, Feb 18, 2009 at 1:01 PM, Michael Mueller m...@michael-mueller-it.de wrote: Hi all, Is there some documentation or some example on how to interpret the arg0 .. argn for the aioread, aiowrite, aiowait syscalls? The system call name for all three seems to be kaio. Michael When you

[dtrace-discuss] dtrace -c behavior

2009-03-20 Thread Chad Mynhier
What should the behavior of 'dtrace -c' be when dtrace(1M) exits before the target command? Should the target process be killed, or should the target process continue running? Currently, the target process keeps running, but this also happens in the case when dtrace(1M) exits with an error (see

Re: [dtrace-discuss] dtrace -c behavior

2009-03-20 Thread Chad Mynhier
On Fri, Mar 20, 2009 at 2:35 PM, Chip Bennett cbenn...@laurustech.com wrote: What should the behavior of 'dtrace -c' be when dtrace(1M) exits before the target command?  Should the target process be killed, or should the target process continue running? Currently, the target process keeps

Re: [dtrace-discuss] DTracing one's own libraries

2009-04-01 Thread Chad Mynhier
On Wed, Apr 1, 2009 at 12:41 PM, Michael Schuster michael.schus...@sun.com wrote: All, from reading of the DTrace documentation, eg. at http://wikis.sun.com/display/DTrace/pid+Provider, I got the impression that I could do something like        dtrace -n 'pid$target:mylib::entry{}' -c ...

Re: [dtrace-discuss] DTracing one's own libraries

2009-04-01 Thread Chad Mynhier
On Wed, Apr 1, 2009 at 1:42 PM, Michael Schuster michael.schus...@sun.com wrote: I see similar stuff for my library ... so why would dtrace fail to show calls into libdladm for a process that's started by dtrace (ie using -c) (using -Z as someone suggested) $ dtrace -Z -n

Re: [dtrace-discuss] DTracing one's own libraries

2009-04-01 Thread Chad Mynhier
On Wed, Apr 1, 2009 at 4:02 PM, Steve Scargall steve.scarg...@sun.com wrote: As Pavan suggested DTrace isn't preloading the libraries.  Try using the LD_PRELOAD, LD_PRELOAD_32, or LD_PRELOAD_64 environmental variables to preload the libraries you need.  There's an example on my blog

Re: [dtrace-discuss] DTracing one's own libraries

2009-04-02 Thread Chad Mynhier
On Thu, Apr 2, 2009 at 8:34 AM, Pavan Chandrashekar - Sun Microsystems pavan.chandrashe...@sun.com wrote: This observation of yours is correct but there is more to the story. I did the following:  truss -u a.out -u libc -o dladm.log dladm show-link on both a s10u6 machine and a Nevada build

Re: [dtrace-discuss] sprintf(9F) and copyin

2009-04-07 Thread Chad Mynhier
On Tue, Apr 7, 2009 at 1:39 PM, Brett Monroe mr.bmon...@gmail.com wrote: Hey all, This is probably a dumb newbie question but I seem to be misunderstanding what the copyin function can do.  When I run the following one-liner: dtrace -n 'fbt::sprintf:return {printf(%s

Re: [dtrace-discuss] Strange behavior of profile:::tick-10ms.

2009-04-17 Thread Chad Mynhier
On Fri, Apr 17, 2009 at 6:03 AM, Qihua Wu dtrace...@gmail.com wrote: Hi, All, For the following script, I hope the printed number should be sequential and ordered. But the fact is not, anyone knows the reason or bug? #!/usr/sbin/dtrace -s #pragma D option quiet BEGIN {    j=0; }

Re: [dtrace-discuss] unable to find any probes from the nfs provider

2009-04-17 Thread Chad Mynhier
On Fri, Apr 17, 2009 at 12:32 PM, Priya Krishnan priya.krish...@sun.com wrote: I want to list/use the nfs probes but I get the error dtrace: failed to match nfs* No probe matches description. Is there a way to enable nfs provider probes? My system is running snv_112 (bfu'ed from the gate

Re: [dtrace-discuss] Do actions fire in order?

2009-04-18 Thread Chad Mynhier
On Sat, Apr 18, 2009 at 9:25 AM, Ryan ryanj...@ece.cmu.edu wrote: Hi all, Is there any kind of specification that probes from the same script fire in the order they were declared (modulo predicates, of course)? Google turned up a ppt from 2005 which suggests they do, but there's nothing in

Re: [dtrace-discuss] Unexpected behavior of 'self' in profile/tick probes

2009-04-18 Thread Chad Mynhier
On Sat, Apr 18, 2009 at 12:48 PM, Ryan ryanj...@ece.cmu.edu wrote: Hi all, It seems that 'self' behaves differently in profile and tick probes compared with regular ones (perhaps because they can interrupt normal dtrace probes?) For example, the following code does not output anything on my

Re: [dtrace-discuss] Unexpected behavior of 'self' in profile/tick probes

2009-04-20 Thread Chad Mynhier
On Sat, Apr 18, 2009 at 6:57 PM, Ryan ryanj...@ece.cmu.edu wrote: self variables are thread-local variables, which are unique to the thread in which they fire.  The thread in which the foo:entry probe fires isn't the same thread in which the profile probe fires. I understand that the profile

Re: [dtrace-discuss] dtrace : isolating the slow write

2009-04-27 Thread Chad Mynhier
On Mon, Apr 27, 2009 at 8:31 AM, Renil Thomas thomson_p...@yahoo.co.in wrote: Hi Experts,  _write           value  - Distribution - count            4096 |                                         0            8192 |@@   1161825    

Re: [dtrace-discuss] How to use pid provider on certain processes.

2009-05-11 Thread Chad Mynhier
On Mon, May 11, 2009 at 4:37 PM, Brian Utterback brian.utterb...@sun.com wrote: I know this has been asked before, but I can't seem to find the answer. I have a process I want to trace with the pid provider, but the process gets started once in a while. There is only one process by its name

Re: [dtrace-discuss] (dtrace error) operator - cannot be applied to a forward declaration ...

2009-06-05 Thread Chad Mynhier
On Fri, Jun 5, 2009 at 9:48 AM, Danny Websterdannywebs...@gmail.com wrote: Hi, This may be more suited to a general D mailing list, but - i'm trying to analyse LWP activity on a system, and faltering at the first hurdle. The lwp_create() call is prototyped as: klwp_t * lwp_create(void

Re: [dtrace-discuss] Possible to read current value of aggregate?

2009-06-26 Thread Chad Mynhier
On Fri, Jun 26, 2009 at 11:55 AM, Ryan Johnsonryanj...@ece.cmu.edu wrote: Also, is there any documentation for libdtrace other than the programs that use it? The tools are a good start. Especially intrstat for what you want to to, as it consumes aggregation data to print out. The second

Re: [dtrace-discuss] Possible to read current value of aggregate?

2009-06-26 Thread Chad Mynhier
On Fri, Jun 26, 2009 at 2:49 PM, Ryan Johnsonryanj...@ece.cmu.edu wrote: Chad Mynhier wrote: If you'd like, I could send you a stripped down consumer so you don't have to worry much about all the baggage in the code for other utilities. That would be really helpful! The dtrace code

Re: [dtrace-discuss] track program time - need some guidelines

2009-07-12 Thread Chad Mynhier
want microstate accounting on S10 you need something else. Unless it was back ported to S10 without the man page being updated? Jim James Litchfield wrote: Agreed. I missed that. Since it does only the process, is that good enough? Jim Chad Mynhier wrote: On Sun, Jul 12

Re: [dtrace-discuss] printf() giving unsigned int, when it is signed

2009-07-21 Thread Chad Mynhier
On Tue, Jul 21, 2009 at 2:52 AM, Matt Ingenthronmingenth...@acm.org wrote: I have a USDT provider in memcached which is defined as either a positive value returned or -1 if there is no result.  From my DTrace script, the value returned seems to be 4294967295 when I'm expecting a -1 so it

Re: [dtrace-discuss] printf() giving unsigned int, when it is signed

2009-07-22 Thread Chad Mynhier
On Tue, Jul 21, 2009 at 12:37 PM, Matt Ingenthronmingenth...@acm.org wrote: To be more particular, in order to get the types from the provider, you must use the args[] array, not the arg? variables.  Try doing: printf(key is %s, length is %d\n, copyinstr(arg1), , args[3]); The DTrace

Re: [dtrace-discuss] [osol-discuss] Printing process variable

2009-07-23 Thread Chad Mynhier
Actually, this isn't exactly true. There are two things you can do with the pid provider that allow you to inspect the value of variables inside functions in certain cases: you can instrument any individual instruction, and you can access register values via the uregs[] array. As long as you

Re: [dtrace-discuss] getting extra characters with printf(copyin(a, b))

2009-07-24 Thread Chad Mynhier
On Fri, Jul 24, 2009 at 4:50 PM, Matt Ingenthronmingenth...@acm.org wrote: Hi, I have a situation where a DTrace script is printing out extra characters, despite the copyin() call giving a specific length.  Can anyone think of why this might be? [ ... ] memcached*::command-get / (signed

Re: [dtrace-discuss] getting extra characters with printf(copyin(a, b))

2009-07-26 Thread Chad Mynhier
On Sun, Jul 26, 2009 at 3:35 PM, Matt Ingenthronmingenth...@acm.org wrote: Thanks again for the help Chad, memcached*::command-get / (signed int) arg3 != -1 / {  printf(get %s, FOUND KEY\n, stringof(copyin(arg1, arg2))); } It doesn't look like you're copying in a null character,

Re: [dtrace-discuss] getting extra characters with printf(copyin(a, b))

2009-07-26 Thread Chad Mynhier
On Sun, Jul 26, 2009 at 6:16 PM, Matt Ingenthronmingenth...@acm.org wrote: If not, then something like this should work:         this-foo = (char *)alloca(arg2 + 1); copyinto(arg1, arg2, this-foo);         this-foo[arg2 + 1] = '\0'; printf(%s\n, stringof(this-foo)); Makes sense.  Is

Re: [dtrace-discuss] why system() takes so long? (using dtrace to synchronize kernel event with userland process)

2009-07-30 Thread Chad Mynhier
On Thu, Jul 30, 2009 at 3:48 PM, Pavel Filipenskypavel.filipen...@sun.com wrote: [ ... ] One of the possibility to synchronize it, is to let the dtrace probe to send a signal to the user land process via a system() action. [ ... ] The problem is that the delay between the event (nfs probe)

Re: [dtrace-discuss] How to print all parameters for a function (pid provider?)

2009-08-12 Thread Chad Mynhier
On Wed, Aug 12, 2009 at 9:03 AM, Qihua Wudtrace...@gmail.com wrote: Hi, dtrace experts: Using pid provider, can we print all the parameters passed to a function? First need to know is the number of parameters the function has.  But which build in variable could show us the number of

Re: [dtrace-discuss] Convert fd into string

2009-08-18 Thread Chad Mynhier
Why not just aggregate on the tuple fd, file name? Something like this: syscall::read:entry { @c[arg0, fds[arg0].fi_pathname] = count(); } If the output's unsatisfactory, you could always use a printa() in en END clause to get it into the format you want. Chad On Tue, Aug 18, 2009 at

Re: [dtrace-discuss] sum on an aggregation / summing values from different threads

2009-08-24 Thread Chad Mynhier
On Mon, Aug 24, 2009 at 2:31 PM, Joel Reymontjoe...@gmail.com wrote: Here's the full output: http://pastie.org/593398 You can see that the total should be way higher than 0.81s by eyeballing the output. The total should be between 3 and 4 seconds. You're printing the values incorrectly.

Re: [dtrace-discuss] sum on an aggregation / summing values from different threads

2009-08-24 Thread Chad Mynhier
On Mon, Aug 24, 2009 at 3:07 PM, Joel Reymontjoe...@gmail.com wrote: Any suggestions on how I can figure out the right # of leading 0s? I really wish dtrace had floating-point printing. This should do what you want: printa(%...@09d\n, @int); i.e., print it in a field 9 characters wide with

Re: [dtrace-discuss] putting a running app into trace mode

2009-08-28 Thread Chad Mynhier
...@gmail.com wrote: Thanks Chad! How do I pass the 2nd script as argument into the first, though?        Thanks, Joel On Aug 28, 2009, at 8:52 PM, Chad Mynhier wrote: You can do this with two separate DTrace invocations.  The first catches the exec of firefox-bin and fires off the second

Re: [dtrace-discuss] putting a running app into trace mode

2009-08-28 Thread Chad Mynhier
On Fri, Aug 28, 2009 at 4:44 PM, Nicolas Williamsnicolas.willi...@sun.com wrote: On Fri, Aug 28, 2009 at 03:52:01PM -0400, Chad Mynhier wrote: You can do this with two separate DTrace invocations.  The first catches the exec of firefox-bin and fires off the second.  Something like

Re: [dtrace-discuss] Atomicity of committing speculation buffers

2009-09-08 Thread Chad Mynhier
On Sat, Sep 5, 2009 at 12:09 AM, Yossi Lev (Sun Labs)yosef@sun.com wrote: Somebody will have to confirm, but I think global variables are lock-protected in DTrace, so you should be able to use one to store the sequence number. Actually, from messages that I saw in this forum, and my

Re: [dtrace-discuss] what is the +hex in c++ stack traces?

2009-09-09 Thread Chad Mynhier
On Wed, Sep 9, 2009 at 1:42 PM, Joel Reymontjoe...@gmail.com wrote: What is the hex number after the method, e.g. +0x32f below? It matches arg0 and I suspect it's the c++ this pointer, aka hidden first argument. It matches arg0 to which probe? These look like function offsets. Chad I

Re: [dtrace-discuss] Aggregation key membership test, and dynamic adopting of tracing functionality

2009-09-13 Thread Chad Mynhier
On Sun, Sep 13, 2009 at 4:54 PM, Yossi Lev (Sun Labs) yosef@sun.com wrote: My questions: - If not, do you have any other idea how can I achieve this kind of  dynamically adapting tracing behavior? For something this complicated, you might want to look at writing your own DTrace consumer.

Re: [dtrace-discuss] dtrace predicat

2009-09-17 Thread Chad Mynhier
On Thu, Sep 17, 2009 at 9:17 AM, Eugenias redtigra...@gmail.com wrote: Hi, I'm a nub in dtrace, could you please help me to find the mistake? I need to implement the logic: - if PID and TID are defined, fire the probe for the particular thread of particular process; - if only PID is

Re: [dtrace-discuss] Running dtrace sript for defined period of time?

2009-10-19 Thread Chad Mynhier
If you're a little more concerned with getting it close to 10 seconds, you can use something like this: tick-1s / i++ = 10 / { exit(0); } The reason the tick-10s probe might fire sooner than 10 seconds is that DTrace will use an existing probe if there is one. If script A is the first to

Re: [dtrace-discuss] tracing transient processes

2009-12-03 Thread Chad Mynhier
On Thu, Dec 3, 2009 at 10:07 PM, Kevin Fitch kfitc...@gmail.com wrote: I have a situation that I would like to debug with dtrace, but I am not sure how. I have a process that kicks off, runs for a few seconds (perhaps milliseconds) then goes away. And this happens very frequently, think

Re: [dtrace-discuss] privileges for dtrace

2009-12-15 Thread Chad Mynhier
On Tue, Dec 15, 2009 at 1:38 PM, Hillel (Sabba) Markowitz sabbahil...@gmail.com wrote: I attempted to add the dtrace privileges to /etc/user_attr but it does not appear to work. I found a writeup from 2005 asking about this, but the answer does not seem to work for me. I set it to

Re: [dtrace-discuss] tracing recursive functions

2009-12-16 Thread Chad Mynhier
On Wed, Dec 16, 2009 at 1:52 PM, Hillel (Sabba) Markowitz sabbahil...@gmail.com wrote: As can be seen, if recursive code is used, the self-ts gets reset to timestamp with every entry, and the innermost exit causes a time to be calculated and the ts to be reset. The rest of the returns within

Re: [dtrace-discuss] tracing recursive functions

2009-12-16 Thread Chad Mynhier
On Wed, Dec 16, 2009 at 2:17 PM, Hillel (Sabba) Markowitz sabbahil...@gmail.com wrote: On Wed, Dec 16, 2009 at 2:13 PM, Chad Mynhier cmynh...@gmail.com wrote: You'll need to keep an array of timestamps indexed on ustackdepth. Something like this (it appears that ustackdepth on entry doesn't

Re: [dtrace-discuss] tracing recursive functions

2009-12-16 Thread Chad Mynhier
On Wed, Dec 16, 2009 at 3:19 PM, Hillel (Sabba) Markowitz sabbahil...@gmail.com wrote: However, what I am worried about is a set where -A  -B     -C     -C   -B -A -D  -C  -C -D This would seem to not aggregate the C as the ustackdepth for the two usages of C would be different.

Re: [dtrace-discuss] tracing recursive functions

2009-12-18 Thread Chad Mynhier
On Thu, Dec 17, 2009 at 3:08 PM, Hillel (Sabba) Markowitz sabbahil...@gmail.com wrote: On Wed, Dec 16, 2009 at 2:44 PM, Chad Mynhier cmynh...@gmail.com wrote: #define STACKDEPTHBASE 2 I don't follow why this is set to 2. I included a syscall count to also see how many times a function

Re: [dtrace-discuss] tracing recursive functions

2009-12-21 Thread Chad Mynhier
On Mon, Dec 21, 2009 at 8:47 AM, Hillel (Sabba) Markowitz sabbahil...@gmail.com wrote: When I tried to set up with a probe at pid$target::main:entry with a printf inside it, I got no output. However, I did get a main:return from pid:target:hello::return I do not understand why that is

Re: [dtrace-discuss] __lwp_park() showing up as most time-consuming when dtrace an application

2010-02-03 Thread Chad Mynhier
Yep. The system call is lwp_park(). Given that it's a blocking system call, the time a thread spends here is effectively unbounded. Chad On Wed, Feb 3, 2010 at 3:47 PM, Jim Mauro james.ma...@sun.com wrote: It's used to put threads to sleep that are blocking on user locks (at least that's my

Re: [dtrace-discuss] ustack() and trouble with leaf functions

2010-02-05 Thread Chad Mynhier
On Fri, Feb 5, 2010 at 7:10 AM, Ryan Johnson ryanj...@ece.cmu.edu wrote: Is this a known limitation/bug? For now I'm using the O7 trick and post-processing to remove the most glaring deficiencies but a real solution would be nice. Yes, this is a known limitation. The documentation talks

Re: [dtrace-discuss] ustack() and trouble with leaf functions

2010-02-05 Thread Chad Mynhier
On Fri, Feb 5, 2010 at 9:40 AM, Ryan Johnson ryanj...@ece.cmu.edu wrote: On 2/5/2010 1:19 PM, Chad Mynhier wrote: On Fri, Feb 5, 2010 at 7:10 AM, Ryan Johnsonryanj...@ece.cmu.edu  wrote: Is this a known limitation/bug? For now I'm using the O7 trick and post-processing to remove the most

Re: [dtrace-discuss] dtracing zvol's

2010-03-02 Thread Chad Mynhier
On Tue, Mar 2, 2010 at 3:20 AM, Henrik Johansen fi...@hotmail.com wrote: Hi folks, While playing around with the FBT provider I came across something I simply can't figure out how to do. I would really like to track I/O to some of our zvols - for writes something like this does the trick

Re: [dtrace-discuss] dtracing zvol's

2010-03-04 Thread Chad Mynhier
On Wed, Mar 3, 2010 at 2:31 AM, Henrik Johansen fi...@hotmail.com wrote: But this return what appears to be a hexdump as well as the zvol names and their read counts       []       370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00         380: 00 00 00 00 00 00 00

Re: [dtrace-discuss] wildcarding USDT probes

2010-04-27 Thread Chad Mynhier
On Tue, Apr 27, 2010 at 11:00 AM, Mark Phalan mark.pha...@sun.com wrote: Whenever I try to use a wildcard in my dtrace scripts with my USDT provider I get an error complaining that the set of probes is unstable. dtrace -n 'foo$target:::bar-* { printf(%d\n, args[0]-i); }' -c /tmp/x dtrace:

Re: [dtrace-discuss] Invalid address error when using stringof to convert a pointer to a string

2010-05-04 Thread Chad Mynhier
On Tue, May 4, 2010 at 11:23 AM, Yossi Lev yosef@sun.com wrote: Hi I'm running a simple DTrace script that has the following clause: pid$target::ReportTx:entry /arg1 != 0 this-numEntries != 0/ {  printf(NumEntries: %lld\n, (long long)this-numEntries);  this-entry =

Re: [dtrace-discuss] Invalid address error when using stringof to convert a pointer to a string

2010-05-04 Thread Chad Mynhier
On Tue, May 4, 2010 at 12:58 PM, Yossi Lev yosef@sun.com wrote: Moreover, I know that the value that I'm getting is valid, because I had the following printf statement: pid$target::ReportTx:entry /arg1 != 0 this-numEntries != 0/ {  printf(NumEntries: %lld\n, (long

Re: [dtrace-discuss] accessing frame pointer

2010-05-07 Thread Chad Mynhier
It doesn't appear to be documented, but it appears that uregs[R_FP] will give you the value. (At least on SPARC, you'll need to know which register the FP is stored in on x86.) Chad On Fri, May 7, 2010 at 3:38 PM, tester solaris.ident...@gmail.com wrote: Hello, How can I access frame

Re: [dtrace-discuss] accessing frame pointer

2010-05-07 Thread Chad Mynhier
On Fri, May 7, 2010 at 3:56 PM, tester solaris.ident...@gmail.com wrote: Thanks. Do I need to add stack bias 2047to fp to get actual data? which is  correct?  printf(localvar value is %x\n, (uregs[R_I6])); or  printf(localvar value is %x\n, uregs[R_I6] + 2047); I don't think you need to

Re: [dtrace-discuss] Translating a pointer to a user function name + offset

2010-05-10 Thread Chad Mynhier
On Mon, May 10, 2010 at 11:16 AM, Yossi Lev yossi@oracle.com wrote: Hi I wondered if given a pointer to an instruction in a user C function, DTrace can print out the user function name and offset of that instruction.  That is, I'm looking for something like the %a flag but for user

Re: [dtrace-discuss] dtrace - in time of need

2010-05-20 Thread Chad Mynhier
On Thu, May 20, 2010 at 7:46 AM, tester solaris.ident...@gmail.com wrote: Hello,  We had a situation on a t5140 running solaris 10 where the load average   from prstat were 20-25,30-40,60-80. We ran a simple dtrace cmd to capture the jstack using the pid provider using the PID from prstat.

Re: [dtrace-discuss] hitting scratch space limit?

2010-05-24 Thread Chad Mynhier
On Mon, May 24, 2010 at 8:56 AM, Mark Phalan mark.pha...@sun.com wrote: On Mon, 2010-05-24 at 13:42 +0200, Mark Phalan wrote: On Tue, 2010-05-18 at 17:28 -0400, Angelo Rajadurai wrote: The way to fix it is to set strsize #pragma D option strsize=1024 // make sure your string can fit in!

Re: [dtrace-discuss] hitting scratch space limit?

2010-05-25 Thread Chad Mynhier
On Tue, May 25, 2010 at 5:13 AM, Mark Phalan mark.pha...@sun.com wrote: On Mon, 2010-05-24 at 15:16 -0400, Chad Mynhier wrote: Even though string is a separate type in DTrace, a string is still just stored as a null-terminated sequence of characters.  stringof() isn't doing anything to null

Re: [dtrace-discuss] hitting scratch space limit?

2010-05-25 Thread Chad Mynhier
On Tue, May 25, 2010 at 5:37 AM, Mark Phalan mark.pha...@sun.com wrote: Another data point. This works fine:   data_string = lltostr(strlen(stringof(copyin((uintptr_t)(*((uint32_t *)       copyin((uintptr_t)P-data, sizeof (uint32_t, *((uint32_t *)       copyin((uintptr_t)P-length,

Re: [dtrace-discuss] hitting scratch space limit?

2010-05-25 Thread Chad Mynhier
On Tue, May 25, 2010 at 10:23 AM, Mark Phalan mark.pha...@sun.com wrote: On Tue, 2010-05-25 at 09:36 -0400, Chad Mynhier wrote: OTOH, copyinstr() _does_ take a second argument that specifies a max length, so the workaround you're looking for is to use that:   data_string = strjoin

Re: [dtrace-discuss] condition probe argument construction in static probes

2010-07-16 Thread Chad Mynhier
I think you're looking for is-enabled probes. See http://blogs.sun.com/ahl/entry/user_land_tracing_gets_better or the current DTrace documentation. Chad On Fri, Jul 16, 2010 at 10:39 AM, Thomas Maier-Komor tho...@maier-komor.de wrote: Hi, is it somehow possible to conditionally enable a

Re: [dtrace-discuss] Using dtrace to follow a kernel linked list

2011-08-21 Thread Chad Mynhier
On Fri, Aug 19, 2011 at 4:34 PM, Lida Horn lida.h...@oracle.com wrote: I'm looking for an example of how one could write a dtrace probe that could follow something like a NULL terminated linked list. If this is a list with short-lived entries (e.g., one of the hash buckets in the sleep queue),

Re: [dtrace-discuss] Predicate vs. separate clause performance

2012-05-23 Thread Chad Mynhier
On Tue, May 22, 2012 at 4:04 PM, chip.benn...@exeloncorp.com wrote: Often a D program is easier to read if you break up a complex predicate into separate clauses, but I was wondering if you sacrifice script performance to do that.  For example, the following two D programs do the same thing

Re: [dtrace-discuss] Predicate vs. separate clause performance

2012-05-25 Thread Chad Mynhier
Responses inline: On Thu, May 24, 2012 at 6:56 PM, chip.benn...@exeloncorp.com wrote: Chad, That was very helpful, thank-you. So it sounds like you're saying that if the check expression has no cacheable components, it doesn't matter if I put the check in the predicate, or if I break