[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-dtrace-discuss
Subject:    Re: [dtrace-discuss] Dtrace "fork()-o-meter" ...
From:       Chip Bennett <cbennett () laurustech ! com>
Date:       2006-12-31 16:12:55
Message-ID: 4597E187.8090004 () laurustech ! com
[Download RAW message or body]

Hi Roland,

First, arguments do work, as demonstrated below:

# dtrace -n 'BEGIN {exit(0)}' -c 'ls xxx'
dtrace: description 'BEGIN ' matched 1 probe
xxx: No such file or directory
CPU     ID                    FUNCTION:NAME
  0      1                           :BEGIN

DTrace must be passing the argument "xxx" to the ls command in order for 
the error to happen.

The errors you're getting from your example, I think are just from the 
shell not parsing the quotes the way you expect, when DTrace invokes the 
command.  If you're thinking that your bash script is supposed to 
display all of the arguments from the command line (it appears that's 
what's intended), when I tried:

/bin/bash -c 'i=0 ; while [ $i -lt 100 ] ; do i=$(echo $((i + 1)) ) ; 
done' xxx yyy zzz

at the shell prompt (without DTrace), it didn't work there either.  No 
syntax errors, but also no echos.

Chip

Roland Mainz wrote:
> Anyway...
> ... next problem is that dtrace's "-c" option does not seem to allow an
> application to pass arguments to a child application (or passes them
> somehow incorrectly), e.g. $ dtrace ... -c './prog arg1 arg2 arg3 ...' #
> does not work.
> Example:
> -- snip --
> $ dtrace -s /home/gisburn/solaris/ksh93/fork-o-meter/fork-o-meter.d  -c
> '/bin/bash -c "i=0 ; while [ $i -lt 100 ] ; do i=$(echo $((i + 1)) ) ;
> done"'
> ;: -c: line 0: unexpected EOF while looking for matching `"'
> ;: -c: line 1: syntax error: unexpected end of file
> Total forks 0
> -- snip --
>
> Is this a bug, feature or just that I am trying something wrong in this
> case ?
>
> ----
>
> Bye,
> Roland
>
>   

_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic