From ah89892@sac.sfbay.sun.com Mon Jan  7 18:14:51 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m082EpQi028230
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 7 Jan 2008 18:14:51 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m082Ejw9017713;
	Tue, 8 Jan 2008 02:14:50 GMT
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUA00L03ZKO7Z00@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 07 Jan 2008 18:14:48 -0800 (PST)
Received: from dm-sfbay-02.sfbay.sun.com ([129.146.11.31])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUA00G2VZKNHTF0@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 07 Jan 2008 18:14:47 -0800 (PST)
Received: from sac.sfbay.sun.com (new-sac.SFBay.Sun.COM [129.146.175.65])
	by dm-sfbay-02.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id m082EloM033587; Mon, 07 Jan 2008 18:14:47 -0800 (PST)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m081xlS0027685; Mon,
 07 Jan 2008 17:59:47 -0800 (PST)
Received: (from ah89892@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id m081xlJj027681; Mon,
 07 Jan 2008 17:59:47 -0800 (PST)
Date: Mon, 07 Jan 2008 17:59:47 -0800 (PST)
From: Alan Hargreaves <ah89892@sac.sfbay.sun.com>
Subject: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008]
To: PSARC-ext@sun.com
Cc: dtrace-discuss@opensolaris.org
Message-id: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
Status: RO
Content-Length: 7489

I am sponsoring the following fast track for myself. I am doing the
bourne shell first for two primary reasons.

1. It is the "simplest" of the shells and thus should provide the
   minimum set of probes to implement for future work in other shells,
2. Providing probes into /bin/sh gives us observability of
   approximately 60% of all of the scripts on ON.

Additionally, as it has been around for a very long time there are
quite a lot of user written scripts for it, many very badly written.

I would expect future fast tracks for other shells (eg ksh88, ksh93,
zsh, bash, ...) to reference this fast track for the minimum set of
probes.

Note the probes are currently listed as Uncommited. As the probes
gain use I would hope to log a future fast track to increase this
stability.

A Minor release binding is initially requested. Again, once things
settle down and the interfaces stabilise it is expected that a future
case may request a patch binding.


Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 DTrace Provider for Bourne Shell
    1.2. Name of Document Author/Supplier:
	 Author:  Alan Hargreaves
    1.3  Date of This Document:
	07 January, 2008
4. Technical Description

The sh provider makes available probes that can be used to observe the
behaviour of bourne shell scripts.

Probes
------

The sh provider makes available the following probes as exports:

builtin-entry   Fires on entry to a shell builtin command.
builtin-return  Fires on return from a shell builtin command.
command-entry   Fires when the shell execs an external command.
command-return  Fires on return from an external command.
function-entry  Fires on entry into a shell function.
function-return Pires on return from a shell function.
line            Fires before commands on a particular line of code are
		executed.
subshell-entry  Fires when the shell forks a subshell.
subshell-return Fires on return from a forked subshell.
script-start    Fires before any commands in a script are executed.
script-done     Fires on script exit.
variable-assign Fires on assignment to a variable.

The use of non-empty module or function names in a sh* probe is
undefined at this time.

Arguments
---------

builtin-entry,
command-entry,
function-entry

	char *	args[0]	Script Name
	char *	args[1]	Builtin/Command/Function Name
	int	args[2]	Line Number
	int	args[3]	# Arguments
	char **	args[4]	Pointer to argument list

builtin-return,
command-return,
function-return

	char *	args[0]	Script Name
	char *	args[1]	Builtin/Command/Function Name
	int	args[2]	Return Value

subshell-entry

	char *	args[0]	Script Name
	pid_t	args[1]	Forked Process ID

subshell-return

	char *	args[0]	Script Name
	int	args[1]	Return Value

line

	char *	args[0]	Script Name
	int	args[1]	Line Number

script-start

	char *	args[0]	Script Name

script-done

	char *	args[0]	Script Name
	int	args[1]	Exit Value

variable-assign

	char *	args[0]	Script Name
	char *	args[1]	Variable Name
	char *	args[2]	Value

Examples
--------

1. Catching a variable assignment

	Say we want to determine which line in the following script has
	an assignment to WatchedVar:

	#!/bin/sh

	# starting script
	WatchedVar=Value
	# ending script

	We could use the following script

	#!/usr/sbin/dtrace -s

	#pragma D option quiet

	sh$target:::line { self->line = arg1; }
	sh$target:::variable-assign /copyinstr(arg1) == "WatchedVar"/ {
	        printf("%d: %s=%s\n", self->line, copyinstr(arg1),
		    copyinstr(arg2))
	}

	$ ./watch.d -c ./var.sh
	4: WatchedVar=Value

2. Watching the time spent in functions

	#!/usr/sbin/dtrace -s

	#pragma D option quiet

	sh$target:::function-entry { self->start = vtimestamp }
	sh$target:::function-return {
		@[copyinstr(arg1)] = quantize(vtimestamp - self->start)
	}

	Similar for the other entry/return probes, with the exception
	of subshell as the probe name is unavailable.

3. Wasted time using external functions instead of builtins

	This script is copied from the DTrace toolkit. It's function
	and how it works should be relatively self explanatory.

#!/usr/sbin/dtrace -Zs
/*
 * sh_wasted.d - measure Bourne shell elapsed times for "wasted" commands.
 *               Written for the sh DTrace provider.
 *
 * $Id: sh_wasted.d 25 2007-09-12 09:51:58Z brendan $
 *
 * USAGE: sh_wasted.d { -p PID | -c cmd }       # hit Ctrl-C to end
 *
 * This script measures "wasted" commands - those which are called externally
 * but are in fact builtins to the shell. Ever seen a script which calls
 * /usr/bin/echo needlessly? This script measures that cost.
 *
 * FIELDS:
 *              FILE            Filename of the shell or shellscript
 *              NAME            Name of call
 *              TIME            Total elapsed time for calls (us)
 *
 * IDEA: Mike Shapiro
 *
 * Filename and call names are printed if available.
 *
 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
 *
 * CDDL HEADER START
 *
 *  The contents of this file are subject to the terms of the
 *  Common Development and Distribution License, Version 1.0 only
 *  (the "License").  You may not use this file except in compliance
 *  with the License.
 *
 *  You can obtain a copy of the license at Docs/cddl1.txt
 *  or http://www.opensolaris.org/os/licensing.
 *  See the License for the specific language governing permissions
 *  and limitations under the License.
 *
 * CDDL HEADER END
 *
 * 09-Sep-2007  Brendan Gregg   Created this.
 */

#pragma D option quiet

dtrace:::BEGIN
{
        isbuiltin["echo"] = 1;
        isbuiltin["test"] = 1;
        /* add builtins here */

        printf("Tracing... Hit Ctrl-C to end.\n");
        self->start = timestamp;
}

sh$target:::command-entry
{
        self->command = timestamp;
}

sh$target:::command-return
{
        this->elapsed = timestamp - self->command;
        this->path = copyinstr(arg1);
        this->cmd = basename(this->path);
}

sh$target:::command-return
/self->command && !isbuiltin[this->cmd]/
{
        @types_cmd[basename(copyinstr(arg0)), this->path] = sum(this->elapsed);
        self->command = 0;
}

sh$target:::command-return
/self->command/
{
        @types_wasted[basename(copyinstr(arg0)), this->path] =
            sum(this->elapsed);
        self->command = 0;
}

proc:::exit
/pid == $target/
{
        exit(0);
}

dtrace:::END
{
        this->elapsed = (timestamp - self->start) / 1000;
        printf("Script duration: %d us\n", this->elapsed);

        normalize(@types_cmd, 1000);
        printf("\nExternal command elapsed times,\n");
        printf("   %-30s %-22s %8s\n", "FILE", "NAME", "TIME(us)");
        printa("   %-30s %-22s %@8d\n", @types_cmd);

        normalize(@types_wasted, 1000);
        printf("\nWasted command elapsed times,\n");
        printf("   %-30s %-22s %8s\n", "FILE", "NAME", "TIME(us)");
        printa("   %-30s %-22s %@8d\n", @types_wasted);
}


Stability
---------

Element Name    Class           Data Class
------------------------------------------
Provider        Uncommited      Uncommited
Module          Private         Private
Function        Private         Private
Name            Uncommited      Uncommited
Arguments       Uncommited      Uncommited
------------------------------------------


6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		onnv
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open


From Darren.Reed@sun.com Mon Jan  7 20:25:57 2008
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m084Pv8S002779
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 7 Jan 2008 20:25:57 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m084PvUN042835
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Mon, 7 Jan 2008 21:25:57 -0700 (MST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUB002035N86T00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Mon, 07 Jan 2008 21:25:56 -0700 (MST)
Received: from sineb-mail-1.sun.com ([192.18.19.6])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUB000945N7G740@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Mon,
 07 Jan 2008 21:25:56 -0700 (MST)
Received: from fe-apac-03.sun.com
 (fe-apac-03.sun.com [192.18.19.174] (may be forged))
	by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m084Psfe026246	for
 <PSARC-ext@sun.com>; Tue, 08 Jan 2008 04:25:54 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUB00M015KPT100@mail-apac.sun.com>
 (original mail from Darren.Reed@Sun.COM)
 for PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 08 Jan 2008 12:25:54 +0800 (SGT)
Received: from [129.158.87.228] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUB008LC5N5A221@mail-apac.sun.com>; Tue,
 08 Jan 2008 12:25:54 +0800 (SGT)
Date: Tue, 08 Jan 2008 15:25:26 +1100
From: Darren Reed <Darren.Reed@sun.com>
Subject: Re: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008]
In-reply-to: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
Sender: Darren.Reed@sun.com
To: Alan Hargreaves <ah89892@sac.sfbay.sun.com>
Cc: PSARC-EXT@sun.com, dtrace-discuss@opensolaris.org
Message-id: <4782FB36.2060501@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
User-Agent: Thunderbird 1.5.0.13 (Windows/20070809)
Status: RO
Content-Length: 353

Given that you're tracing setting a variable, isn't it also
worthwhile generating an event for "unset"?

e.g. if a dtrace script is following variable assignments
and my shell script does this:

FOO=bar
unset FOO
echo ${FOO}

the dtrace script's idea of the state of affairs when echo
is executed is going to be quite different to the shell's.

Darren


From Alan.Hargreaves@sun.com Mon Jan  7 21:58:25 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m085wO6k003912
	for <psarc-ext@sac.sfbay.Sun.COM>; Mon, 7 Jan 2008 21:58:24 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m085wLRv017919
	for <@sunmail2sca.sfbay.sun.com:PSARC-EXT@sun.com>; Tue, 8 Jan 2008 13:58:23 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUB009079X9ZC00@brm-avmta-1.central.sun.com> for PSARC-EXT@sun.com
 (ORCPT PSARC-EXT@Sun.COM); Mon, 07 Jan 2008 22:58:21 -0700 (MST)
Received: from sineb-mail-2.sun.com ([192.18.19.7])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUB005IY9X7YU30@brm-avmta-1.central.sun.com> for
 PSARC-EXT@sun.com (ORCPT PSARC-EXT@Sun.COM); Mon,
 07 Jan 2008 22:58:20 -0700 (MST)
Received: from fe-apac-06.sun.com
 (fe-apac-06.sun.com [192.18.19.177] (may be forged))
	by sineb-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m085wIhq028517	for
 <PSARC-EXT@Sun.COM>; Tue, 08 Jan 2008 05:58:18 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUB00D019R66X00@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for PSARC-EXT@Sun.COM (ORCPT PSARC-EXT@Sun.COM); Tue,
 08 Jan 2008 13:58:18 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUB00C099X4UF60@mail-apac.sun.com> for PSARC-EXT@Sun.COM
 (ORCPT PSARC-EXT@Sun.COM); Tue, 08 Jan 2008 13:58:17 +0800 (SGT)
Date: Tue, 08 Jan 2008 16:58:15 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: Re: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008]
In-reply-to: <4782FB36.2060501@Sun.COM>
Sender: Alan.Hargreaves@sun.com
To: Darren Reed <Darren.Reed@sun.com>
Cc: PSARC-EXT@sun.com
Message-id: <478310F7.8090706@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <4782FB36.2060501@Sun.COM>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 852

Darren Reed wrote:
> Given that you're tracing setting a variable, isn't it also
> worthwhile generating an event for "unset"?
>
> e.g. if a dtrace script is following variable assignments
> and my shell script does this:
>
> FOO=bar
> unset FOO
> echo ${FOO}
>
> the dtrace script's idea of the state of affairs when echo
> is executed is going to be quite different to the shell's.
>
> Darren
>
This looks like a good idea. It also suggests that the probes might be 
better named variable-set and variable-unset. Unset looks trivial to 
add, so I can do that and I'll add this change to the spec and repost in 
a day or so in case there are any other comments that make sense to 
modify the spec..

alan.

-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems


From Alan.Hargreaves@sun.com Tue Jan  8 13:13:16 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m08LDFLM026281
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 8 Jan 2008 13:13:16 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m08LD4i7025708
	for <@sunmail2sca.sfbay.sun.com:PSARC-EXT@sun.com>; Tue, 8 Jan 2008 21:13:14 GMT
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUC00F05GA13X00@nwk-avmta-2.sfbay.sun.com> for PSARC-EXT@sun.com
 (ORCPT PSARC-EXT@Sun.COM); Tue, 08 Jan 2008 13:13:13 -0800 (PST)
Received: from sineb-mail-2.sun.com ([192.18.19.7])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUC004EAG9ZSDD0@nwk-avmta-2.sfbay.sun.com> for
 PSARC-EXT@sun.com (ORCPT PSARC-EXT@Sun.COM); Tue,
 08 Jan 2008 13:13:12 -0800 (PST)
Received: from fe-apac-04.sun.com
 (fe-apac-04.sun.com [192.18.19.175] (may be forged))
	by sineb-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m08LDAeR000767	for
 <PSARC-EXT@Sun.COM>; Tue, 08 Jan 2008 21:13:10 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUC00401EPUQZ00@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for PSARC-EXT@Sun.COM (ORCPT PSARC-EXT@Sun.COM); Wed,
 09 Jan 2008 05:13:10 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUC00FEWG9WH6N0@mail-apac.sun.com> for PSARC-EXT@Sun.COM
 (ORCPT PSARC-EXT@Sun.COM); Wed, 09 Jan 2008 05:13:10 +0800 (SGT)
Date: Wed, 09 Jan 2008 08:13:08 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: Re: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008] - Spec Update
In-reply-to: <478310F7.8090706@Sun.COM>
Sender: Alan.Hargreaves@sun.com
To: Darren Reed <Darren.Reed@sun.com>
Cc: PSARC-EXT@sun.com
Message-id: <4783E764.4040009@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <4782FB36.2060501@Sun.COM> <478310F7.8090706@Sun.COM>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 6839

As promised based on Darren's suggestion, I have updated the spec and 
included it below.

Changes
-------
1. The variable-assign probe has been renamed to variable-set.
2. Added the variable-unset probe
3. Corrected a typo in the probe list.

In the light of adding variable-unset, it seems to m e that the name 
variable set is more consistent than variable-assign.

Regards,
Alan.

=========================

The sh provider makes available probes that can be used to observe the
behaviour of bourne shell scripts.

Probes
------

The sh provider makes available the following probes as exports:

builtin-entry   Fires on entry to a shell builtin command.
builtin-return  Fires on return from a shell builtin command.
command-entry   Fires when the shell execs an external command.
command-return  Fires on return from an external command.
function-entry  Fires on entry into a shell function.
function-return Pires on return from a shell function.
line            Fires before commands on a particular line of code are
		executed.
subshell-entry  Fires when the shell forks a subshell.
subshell-return Fires on return from a forked subshell.
script-start    Fires before any commands in a script are executed.
script-done     Fires on script exit.
variable-assign Fires on assignment to a variable.

The use of non-empty module or function names in a sh* probe is
undefined at this time.

Arguments
---------

builtin-entry,
command-entry,
function-entry

	char *	args[0]	Script Name
	char *	args[1]	Builtin/Command/Function Name
	int	args[2]	Line Number
	int	args[3]	# Arguments
	char **	args[4]	Pointer to argument list

builtin-return,
command-return,
function-return

	char *	args[0]	Script Name
	char *	args[1]	Builtin/Command/Function Name
	int	args[2]	Return Value

subshell-entry

	char *	args[0]	Script Name
	pid_t	args[1]	Forked Process ID

subshell-return

	char *	args[0]	Script Name
	int	args[1]	Return Value

line

	char *	args[0]	Script Name
	int	args[1]	Line Number

script-start

	char *	args[0]	Script Name

script-done

	char *	args[0]	Script Name
	int	args[1]	Exit Value

variable-set

	char *	args[0]	Script Name
	char *	args[1]	Variable Name
	char *	args[2]	Value

variable-unset

	char *	args[0] Script Name
	char *	args[1]	Variable Name

Examples
--------

1. Catching a variable assignment

	Say we want to determine which line in the following script has
	an assignment to WatchedVar:

	#!/bin/sh

	# starting script
	WatchedVar=Value
	unset WatchedVar
	# ending script

	We could use the following script

	#!/usr/sbin/dtrace -s

	#pragma D option quiet

	sh$target:::line { self->line = arg1; }
	sh$target:::variable-set /copyinstr(arg1) == "WatchedVar"/ {
	        printf("%d: %s=%s\n", self->line, copyinstr(arg1),
		    copyinstr(arg2))
	}
	sh$target:::variable-unset /copyinstr(arg1) == "WatchedVar"/ {
	        printf("%d: unset %s\n", self->line, copyinstr(arg1)); }


	$ ./watch.d -c ./var.sh
	4: WatchedVar=Value

2. Watching the time spent in functions

	#!/usr/sbin/dtrace -s

	#pragma D option quiet

	sh$target:::function-entry { self->start = vtimestamp }
	sh$target:::function-return {
		@[copyinstr(arg1)] = quantize(vtimestamp - self->start)
	}

	Similar for the other entry/return probes, with the exception
	of subshell as the probe name is unavailable.

3. Wasted time using external functions instead of builtins

	This script is copied from the DTrace toolkit. It's function
	and how it works should be relatively self explanatory.

#!/usr/sbin/dtrace -Zs
/*
  * sh_wasted.d - measure Bourne shell elapsed times for "wasted" commands.
  *               Written for the sh DTrace provider.
  *
  * $Id: sh_wasted.d 25 2007-09-12 09:51:58Z brendan $
  *
  * USAGE: sh_wasted.d { -p PID | -c cmd }       # hit Ctrl-C to end
  *
  * This script measures "wasted" commands - those which are called 
externally
  * but are in fact builtins to the shell. Ever seen a script which calls
  * /usr/bin/echo needlessly? This script measures that cost.
  *
  * FIELDS:
  *              FILE            Filename of the shell or shellscript
  *              NAME            Name of call
  *              TIME            Total elapsed time for calls (us)
  *
  * IDEA: Mike Shapiro
  *
  * Filename and call names are printed if available.
  *
  * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
  *
  * CDDL HEADER START
  *
  *  The contents of this file are subject to the terms of the
  *  Common Development and Distribution License, Version 1.0 only
  *  (the "License").  You may not use this file except in compliance
  *  with the License.
  *
  *  You can obtain a copy of the license at Docs/cddl1.txt
  *  or http://www.opensolaris.org/os/licensing.
  *  See the License for the specific language governing permissions
  *  and limitations under the License.
  *
  * CDDL HEADER END
  *
  * 09-Sep-2007  Brendan Gregg   Created this.
  */

#pragma D option quiet

dtrace:::BEGIN
{
         isbuiltin["echo"] = 1;
         isbuiltin["test"] = 1;
         /* add builtins here */

         printf("Tracing... Hit Ctrl-C to end.\n");
         self->start = timestamp;
}

sh$target:::command-entry
{
         self->command = timestamp;
}

sh$target:::command-return
{
         this->elapsed = timestamp - self->command;
         this->path = copyinstr(arg1);
         this->cmd = basename(this->path);
}

sh$target:::command-return
/self->command && !isbuiltin[this->cmd]/
{
         @types_cmd[basename(copyinstr(arg0)), this->path] = 
sum(this->elapsed);
         self->command = 0;
}

sh$target:::command-return
/self->command/
{
         @types_wasted[basename(copyinstr(arg0)), this->path] =
             sum(this->elapsed);
         self->command = 0;
}

proc:::exit
/pid == $target/
{
         exit(0);
}

dtrace:::END
{
         this->elapsed = (timestamp - self->start) / 1000;
         printf("Script duration: %d us\n", this->elapsed);

         normalize(@types_cmd, 1000);
         printf("\nExternal command elapsed times,\n");
         printf("   %-30s %-22s %8s\n", "FILE", "NAME", "TIME(us)");
         printa("   %-30s %-22s %@8d\n", @types_cmd);

         normalize(@types_wasted, 1000);
         printf("\nWasted command elapsed times,\n");
         printf("   %-30s %-22s %8s\n", "FILE", "NAME", "TIME(us)");
         printa("   %-30s %-22s %@8d\n", @types_wasted);
}


Stability
---------

Element Name    Class           Data Class
------------------------------------------
Provider        Uncommited      Uncommited
Module          Private         Private
Function        Private         Private
Name            Uncommited      Uncommited
Arguments       Uncommited      Uncommited
------------------------------------------



-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems

From Alan.Hargreaves@sun.com Tue Jan  8 14:11:21 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m08MBKvC029992
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 8 Jan 2008 14:11:21 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m08MB94B018789
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Tue, 8 Jan 2008 22:11:19 GMT
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUC0041HIYVML00@nwk-avmta-1.sfbay.Sun.COM> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Tue, 08 Jan 2008 14:11:19 -0800 (PST)
Received: from sineb-mail-2.sun.com ([192.18.19.7])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUC007P1IYRZQE0@nwk-avmta-1.sfbay.Sun.COM> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Tue,
 08 Jan 2008 14:11:17 -0800 (PST)
Received: from fe-apac-03.sun.com
 (fe-apac-03.sun.com [192.18.19.174] (may be forged))
	by sineb-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m08MBFwe001402	for
 <psarc-ext@sun.com>; Tue, 08 Jan 2008 22:11:15 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUC00G01IGOR200@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Wed,
 09 Jan 2008 06:11:15 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUC0080WIYPA0L1@mail-apac.sun.com> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Wed, 09 Jan 2008 06:11:15 +0800 (SGT)
Date: Wed, 09 Jan 2008 09:11:12 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: [RE-POST] Re: DTrace Provider for Bourne Shell [PSARC/2008/008
 FastTrack timeout 01/16/2008] - Spec Update
In-reply-to: <4783E764.4040009@Sun.COM>
Sender: Alan.Hargreaves@sun.com
To: Darren Reed <Darren.Reed@sun.com>
Cc: psarc-ext@sun.com, dtrace-discuss@opensolaris.org
Message-id: <4783F500.3090109@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <4782FB36.2060501@Sun.COM> <478310F7.8090706@Sun.COM>
 <4783E764.4040009@Sun.COM>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 7076

Reposting as I just had another problem pointed out to me, in that I 
left variable-assign in the initial list of probes and forgot to add in 
the new variable-set. Thanks Michael.

alan.

Alan Hargreaves wrote:
> As promised based on Darren's suggestion, I have updated the spec and 
> included it below.
> 
> Changes
> -------
> 1. The variable-assign probe has been renamed to variable-set.
> 2. Added the variable-unset probe
> 3. Corrected a typo in the probe list.
> 
> In the light of adding variable-unset, it seems to m e that the name 
> variable set is more consistent than variable-assign.
> 

The sh provider makes available probes that can be used to observe the
behaviour of bourne shell scripts.

Probes
------

The sh provider makes available the following probes as exports:

builtin-entry   Fires on entry to a shell builtin command.
builtin-return  Fires on return from a shell builtin command.
command-entry   Fires when the shell execs an external command.
command-return  Fires on return from an external command.
function-entry  Fires on entry into a shell function.
function-return Pires on return from a shell function.
line            Fires before commands on a particular line of code are
		executed.
subshell-entry  Fires when the shell forks a subshell.
subshell-return Fires on return from a forked subshell.
script-start    Fires before any commands in a script are executed.
script-done     Fires on script exit.
variable-set	Fires on assignment to a variable.
variable-unset	Fires when a variable is unset.

The use of non-empty module or function names in a sh* probe is
undefined at this time.

Arguments
---------

builtin-entry,
command-entry,
function-entry

	char *	args[0]	Script Name
	char *	args[1]	Builtin/Command/Function Name
	int	args[2]	Line Number
	int	args[3]	# Arguments
	char **	args[4]	Pointer to argument list

builtin-return,
command-return,
function-return

	char *	args[0]	Script Name
	char *	args[1]	Builtin/Command/Function Name
	int	args[2]	Return Value

subshell-entry

	char *	args[0]	Script Name
	pid_t	args[1]	Forked Process ID

subshell-return

	char *	args[0]	Script Name
	int	args[1]	Return Value

line

	char *	args[0]	Script Name
	int	args[1]	Line Number

script-start

	char *	args[0]	Script Name

script-done

	char *	args[0]	Script Name
	int	args[1]	Exit Value

variable-set

	char *	args[0]	Script Name
	char *	args[1]	Variable Name
	char *	args[2]	Value

variable-unset

	char *	args[0] Script Name
	char *	args[1]	Variable Name

Examples
--------

1. Catching a variable assignment

	Say we want to determine which line in the following script has
	an assignment to WatchedVar:

	#!/bin/sh

	# starting script
	WatchedVar=Value
	unset WatchedVar
	# ending script

	We could use the following script

	#!/usr/sbin/dtrace -s

	#pragma D option quiet

	sh$target:::line { self->line = arg1; }
	sh$target:::variable-set /copyinstr(arg1) == "WatchedVar"/ {
	        printf("%d: %s=%s\n", self->line, copyinstr(arg1),
		    copyinstr(arg2))
	}
	sh$target:::variable-unset /copyinstr(arg1) == "WatchedVar"/ {
	        printf("%d: unset %s\n", self->line, copyinstr(arg1)); }


	$ ./watch.d -c ./var.sh
	4: WatchedVar=Value

2. Watching the time spent in functions

	#!/usr/sbin/dtrace -s

	#pragma D option quiet

	sh$target:::function-entry { self->start = vtimestamp }
	sh$target:::function-return {
		@[copyinstr(arg1)] = quantize(vtimestamp - self->start)
	}

	Similar for the other entry/return probes, with the exception
	of subshell as the probe name is unavailable.

3. Wasted time using external functions instead of builtins

	This script is copied from the DTrace toolkit. It's function
	and how it works should be relatively self explanatory.

#!/usr/sbin/dtrace -Zs
/*
  * sh_wasted.d - measure Bourne shell elapsed times for "wasted" commands.
  *               Written for the sh DTrace provider.
  *
  * $Id: sh_wasted.d 25 2007-09-12 09:51:58Z brendan $
  *
  * USAGE: sh_wasted.d { -p PID | -c cmd }       # hit Ctrl-C to end
  *
  * This script measures "wasted" commands - those which are called 
externally
  * but are in fact builtins to the shell. Ever seen a script which calls
  * /usr/bin/echo needlessly? This script measures that cost.
  *
  * FIELDS:
  *              FILE            Filename of the shell or shellscript
  *              NAME            Name of call
  *              TIME            Total elapsed time for calls (us)
  *
  * IDEA: Mike Shapiro
  *
  * Filename and call names are printed if available.
  *
  * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
  *
  * CDDL HEADER START
  *
  *  The contents of this file are subject to the terms of the
  *  Common Development and Distribution License, Version 1.0 only
  *  (the "License").  You may not use this file except in compliance
  *  with the License.
  *
  *  You can obtain a copy of the license at Docs/cddl1.txt
  *  or http://www.opensolaris.org/os/licensing.
  *  See the License for the specific language governing permissions
  *  and limitations under the License.
  *
  * CDDL HEADER END
  *
  * 09-Sep-2007  Brendan Gregg   Created this.
  */

#pragma D option quiet

dtrace:::BEGIN
{
         isbuiltin["echo"] = 1;
         isbuiltin["test"] = 1;
         /* add builtins here */

         printf("Tracing... Hit Ctrl-C to end.\n");
         self->start = timestamp;
}

sh$target:::command-entry
{
         self->command = timestamp;
}

sh$target:::command-return
{
         this->elapsed = timestamp - self->command;
         this->path = copyinstr(arg1);
         this->cmd = basename(this->path);
}

sh$target:::command-return
/self->command && !isbuiltin[this->cmd]/
{
         @types_cmd[basename(copyinstr(arg0)), this->path] = 
sum(this->elapsed);
         self->command = 0;
}

sh$target:::command-return
/self->command/
{
         @types_wasted[basename(copyinstr(arg0)), this->path] =
             sum(this->elapsed);
         self->command = 0;
}

proc:::exit
/pid == $target/
{
         exit(0);
}

dtrace:::END
{
         this->elapsed = (timestamp - self->start) / 1000;
         printf("Script duration: %d us\n", this->elapsed);

         normalize(@types_cmd, 1000);
         printf("\nExternal command elapsed times,\n");
         printf("   %-30s %-22s %8s\n", "FILE", "NAME", "TIME(us)");
         printa("   %-30s %-22s %@8d\n", @types_cmd);

         normalize(@types_wasted, 1000);
         printf("\nWasted command elapsed times,\n");
         printf("   %-30s %-22s %8s\n", "FILE", "NAME", "TIME(us)");
         printa("   %-30s %-22s %@8d\n", @types_wasted);
}


Stability
---------

Element Name    Class           Data Class
------------------------------------------
Provider        Uncommited      Uncommited
Module          Private         Private
Function        Private         Private
Name            Uncommited      Uncommited
Arguments       Uncommited      Uncommited
------------------------------------------


-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems

From Alan.Hargreaves@sun.com Tue Jan  8 14:24:44 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m08MOg0D000513
	for <psarc-ext@sac.sfbay.Sun.COM>; Tue, 8 Jan 2008 14:24:43 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m08MOavg029745
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Wed, 9 Jan 2008 06:24:42 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUC00503JL3UQ00@nwk-avmta-1.sfbay.Sun.COM> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Tue, 08 Jan 2008 14:24:39 -0800 (PST)
Received: from sineb-mail-2.sun.com ([192.18.19.7])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUC005FCJL14R00@nwk-avmta-1.sfbay.Sun.COM> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Tue,
 08 Jan 2008 14:24:38 -0800 (PST)
Received: from fe-apac-04.sun.com
 (fe-apac-04.sun.com [192.18.19.175] (may be forged))
	by sineb-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m08MObab001592	for
 <psarc-ext@sun.com>; Tue, 08 Jan 2008 22:24:37 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUC00601JEDK800@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Wed,
 09 Jan 2008 06:24:37 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUC00FXAJKZH3O0@mail-apac.sun.com> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Wed, 09 Jan 2008 06:24:37 +0800 (SGT)
Date: Wed, 09 Jan 2008 09:24:34 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: Re: [RE-POST] Re: DTrace Provider for Bourne Shell [PSARC/2008/008
 FastTrack timeout 01/16/2008] - Spec Update
In-reply-to: <4783F500.3090109@Sun.COM>
Sender: Alan.Hargreaves@sun.com
To: Darren Reed <Darren.Reed@sun.com>
Cc: psarc-ext@sun.com, dtrace-discuss@opensolaris.org
Message-id: <4783F822.6000906@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <4782FB36.2060501@Sun.COM> <478310F7.8090706@Sun.COM>
 <4783E764.4040009@Sun.COM> <4783F500.3090109@Sun.COM>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 418

And of course I now see that I missed a line out cutting and pasting the 
first example. Rather than repost the whole thing it is included below.

> 1. Catching a variable assignment
  ...
>     $ ./watch.d -c ./var.sh
>     4: WatchedVar=Value
> 
	5: unset WatchedVar

Alan
-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems

From jek3@sun.com Tue Jan  8 15:09:31 2008
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m08N9V2m002240
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 8 Jan 2008 15:09:31 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m08N9PrI010229
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 8 Jan 2008 15:09:31 -0800 (PST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUC0091RLNRKZ10@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 08 Jan 2008 15:09:27 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.63])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUC009FYLNQVW00@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 08 Jan 2008 15:09:26 -0800 (PST)
Received: from [129.150.12.37]
 (vpn-129-150-12-37.SFBay.Sun.COM [129.150.12.37])	by
 jurassic-x4600.sfbay.sun.com (8.14.2+Sun/8.14.2) with ESMTP id m08N9PUr797149;
 Tue, 08 Jan 2008 15:09:25 -0800 (PST)
Date: Tue, 08 Jan 2008 13:08:40 -1000
From: Joseph Kowalski <jek3@sun.com>
Subject: Re: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008]
In-reply-to: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
To: Alan Hargreaves <ah89892@sac.sfbay.sun.com>
Cc: PSARC-ext@sun.com, dtrace-discuss@opensolaris.org
Message-id: <47840278.2020102@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071119)
Status: RO
Content-Length: 185

Alan Hargreaves wrote:
> I am sponsoring the following fast track for myself.
How will this be documented?  Some of the materials look like
EXAMPLES, but I'm not sure where...

- jek3


From Alan.Hargreaves@sun.com Tue Jan  8 15:19:28 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m08NJR5q003306
	for <psarc-ext@sac.sfbay.Sun.COM>; Tue, 8 Jan 2008 15:19:28 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m08NJLc4023206
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 9 Jan 2008 07:19:26 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUC00B05M4C4700@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 08 Jan 2008 15:19:25 -0800 (PST)
Received: from sineb-mail-1.sun.com ([192.18.19.6])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUC005NQM4A4V40@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 08 Jan 2008 15:19:24 -0800 (PST)
Received: from fe-apac-03.sun.com
 (fe-apac-03.sun.com [192.18.19.174] (may be forged))
	by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m08NJMha009935	for
 <PSARC-ext@sun.com>; Tue, 08 Jan 2008 23:19:22 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUC00I01M40IF00@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Wed,
 09 Jan 2008 07:19:22 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUC0082OM48A0L1@mail-apac.sun.com>; Wed,
 09 Jan 2008 07:19:22 +0800 (SGT)
Date: Wed, 09 Jan 2008 10:19:19 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: Re: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008]
In-reply-to: <47840278.2020102@sun.com>
Sender: Alan.Hargreaves@sun.com
To: Joseph Kowalski <jek3@sun.com>
Cc: Alan Hargreaves <ah89892@sac.sfbay.sun.com>, PSARC-ext@sun.com,
        dtrace-discuss@opensolaris.org
Message-id: <478404F7.7050103@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <47840278.2020102@sun.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 472

Joseph Kowalski wrote:
> Alan Hargreaves wrote:
>> I am sponsoring the following fast track for myself.
> How will this be documented?  Some of the materials look like
> EXAMPLES, but I'm not sure where...
> 
> - jek3
> 

I am currently taking the spec and turning it into documentation for the 
  Reference Manual Wiki.

alan.

-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems

From Alan.Hargreaves@sun.com Tue Jan  8 16:36:02 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m090a1LS007039
	for <psarc-ext@sac.sfbay.Sun.COM>; Tue, 8 Jan 2008 16:36:01 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m090Zub0021952
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 9 Jan 2008 08:36:00 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUC0070DPNX5G00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 08 Jan 2008 17:35:57 -0700 (MST)
Received: from sineb-mail-1.sun.com ([192.18.19.6])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUC004GGPNV3R10@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 08 Jan 2008 17:35:56 -0700 (MST)
Received: from fe-apac-04.sun.com
 (fe-apac-04.sun.com [192.18.19.175] (may be forged))
	by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m090ZsHM012519	for
 <PSARC-ext@sun.com>; Wed, 09 Jan 2008 00:35:54 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUC00801O9OGS00@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Wed,
 09 Jan 2008 08:35:54 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUC00F7NPNSH3P0@mail-apac.sun.com>; Wed,
 09 Jan 2008 08:35:54 +0800 (SGT)
Date: Wed, 09 Jan 2008 11:35:51 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: Re: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008]
In-reply-to: <478404F7.7050103@Sun.COM>
Sender: Alan.Hargreaves@sun.com
To: Joseph Kowalski <jek3@sun.com>
Cc: Alan Hargreaves <ah89892@sac.sfbay.sun.com>, PSARC-ext@sun.com,
        dtrace-discuss@opensolaris.org
Message-id: <478416E7.7010901@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <47840278.2020102@sun.com> <478404F7.7050103@Sun.COM>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 708

Alan Hargreaves wrote:
> Joseph Kowalski wrote:
>> Alan Hargreaves wrote:
>>> I am sponsoring the following fast track for myself.
>> How will this be documented?  Some of the materials look like
>> EXAMPLES, but I'm not sure where...
>>
>> - jek3
>>
> 
> I am currently taking the spec and turning it into documentation for the 
>  Reference Manual Wiki.
> 
> alan.
> 

There is documentation up (amazingly similar to the case funnily enough) 
under the proposed providers section at http://wikis.sun.com at 
http://wikis.sun.com/display/DTrace/sh+Provider

alan.
-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems

From Alan.Hargreaves@sun.com Wed Jan  9 10:19:27 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m09IJQUL000214
	for <psarc-ext@sac.sfbay.Sun.COM>; Wed, 9 Jan 2008 10:19:26 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m09IJBfZ001256
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Thu, 10 Jan 2008 02:19:24 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUE00L092WC3700@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@Sun.COM); Wed, 09 Jan 2008 11:19:24 -0700 (MST)
Received: from sineb-mail-1.sun.com ([192.18.19.6])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUE00ED52WAN140@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@Sun.COM); Wed,
 09 Jan 2008 11:19:24 -0700 (MST)
Received: from fe-apac-04.sun.com
 (fe-apac-04.sun.com [192.18.19.175] (may be forged))
	by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m09IJMZ9005459	for
 <PSARC-ext@Sun.COM>; Wed, 09 Jan 2008 18:19:22 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUE00B011UUUV00@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for PSARC-ext@Sun.COM (ORCPT PSARC-ext@Sun.COM); Thu,
 10 Jan 2008 02:19:22 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUE005I72W78810@mail-apac.sun.com>; Thu,
 10 Jan 2008 02:19:22 +0800 (SGT)
Date: Thu, 10 Jan 2008 05:19:19 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: Re: DTrace Provider for Bourne Shell [PSARC/2008/008 FastTrack timeout
 01/16/2008]
In-reply-to: <478416E7.7010901@Sun.COM>
Sender: Alan.Hargreaves@sun.com
To: Joseph Kowalski <jek3@sun.com>
Cc: PSARC-ext@sun.com, dtrace-discuss@opensolaris.org
Message-id: <47851027.9000806@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <47840278.2020102@sun.com> <478404F7.7050103@Sun.COM>
 <478416E7.7010901@Sun.COM>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 195

This case was approved in the meeting today.

alan.
-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems

From rmilkowski@task.gda.pl Thu Jan 10 00:40:46 2008
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m0A8ejOi028201
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 10 Jan 2008 00:40:45 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m0A8efO4027581;
	Thu, 10 Jan 2008 00:40:43 -0800 (PST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUF00J0B6RUJL00@brm-avmta-1.central.sun.com>; Thu,
 10 Jan 2008 01:40:42 -0700 (MST)
Received: from brmea-mail-4.sun.com ([192.18.98.36])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUF002E46RT7Y90@brm-avmta-1.central.sun.com>; Thu,
 10 Jan 2008 01:40:41 -0700 (MST)
Received: from relay43i.sun.com ([192.5.209.74])
	by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m0A8U0Ge011193; Thu,
 10 Jan 2008 08:40:41 +0000 (GMT)
Received: from mms49es.sun.com ([160.41.221.233] [160.41.221.233])
 by relay43i.sun.com with ESMTP id BT-MMP-675912; Thu,
 10 Jan 2008 08:40:40 +0000 (Z)
Received: from relay42i.sun.com (relay42i.sun.com [192.5.209.72])
 by mms49es.sun.com with ESMTP id BT-MMP-1641385; Thu,
 10 Jan 2008 08:40:40 +0000 (Z)
Received: from bojer.task.gda.pl ([153.19.250.250] [153.19.250.250])
 by relay4i.sun.com with ESMTP id BT-MMP-22415828; Thu,
 10 Jan 2008 08:40:40 +0000 (Z)
Received: from localhost (localhost [127.0.0.1])	by bojer.task.gda.pl (Postfix)
 with ESMTP id B1361BF42; Thu, 10 Jan 2008 09:40:39 +0100 (CET)
Received: from bojer.task.gda.pl ([127.0.0.1])
	by localhost (bojer.task.gda.pl [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id J2Ahn+E25t7K; Thu, 10 Jan 2008 09:40:37 +0100 (CET)
Received: from localhost (e1-1.ns500-1.ts.milt.as9105.net [212.74.112.53])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)	by bojer.task.gda.pl (Postfix)
 with ESMTP id CD76FBEC3; Thu, 10 Jan 2008 09:40:36 +0100 (CET)
Date: Thu, 10 Jan 2008 08:40:34 +0000
From: Robert Milkowski <rmilkowski@task.gda.pl>
Subject: Re[2]: [dtrace-discuss] DTrace Provider for Bourne Shell
 [PSARC/2008/008 FastTrack timeout 01/16/2008]
In-reply-to: <47851027.9000806@Sun.COM>
To: Alan Hargreaves <Alan.Hargreaves@sun.com>
Cc: Joseph Kowalski <jek3@sun.com>, PSARC-ext@sun.com,
        dtrace-discuss@opensolaris.org
Reply-to: Robert Milkowski <rmilkowski@task.gda.pl>
Message-id: <1088432570.20080110084034@task.gda.pl>
Organization: CI TASK http://www.task.gda.pl
MIME-version: 1.0
X-Mailer: The Bat! (v3.71.03) Professional
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-Priority: 3 (Normal)
X-PMX-Version: 5.2.0.264296
X-Brightmail-Tracker: AAAAAA==
X-Virus-Scanned: amavisd-new at task.gda.pl
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <47840278.2020102@sun.com> <478404F7.7050103@Sun.COM>
 <478416E7.7010901@Sun.COM> <47851027.9000806@Sun.COM>
Status: RO
Content-Length: 441

Hello Alan,

Wednesday, January 9, 2008, 6:19:19 PM, you wrote:

AH> This case was approved in the meeting today.

AH> alan.


good.

btw: have you measured for severa scripts what's the performance
impact of sh with and without usdt provider probes?
Shouldn't by much but still...

-- 
Best regards,
 Robert Milkowski                           mailto:rmilkowski@task.gda.pl
                                       http://milek.blogspot.com


From Alan.Hargreaves@sun.com Thu Jan 10 00:53:25 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m0A8rOMv028262
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 10 Jan 2008 00:53:24 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m0A8rMT0025022
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Thu, 10 Jan 2008 08:53:23 GMT
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JUF0060X7CX8V00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Thu, 10 Jan 2008 00:53:21 -0800 (PST)
Received: from sineb-mail-1.sun.com ([192.18.19.6])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JUF00HJP7CVUQ80@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Thu,
 10 Jan 2008 00:53:20 -0800 (PST)
Received: from fe-apac-05.sun.com
 (fe-apac-05.sun.com [192.18.19.176] (may be forged))
	by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m0A8rI2M015448	for
 <PSARC-ext@sun.com>; Thu, 10 Jan 2008 08:53:18 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JUF00J0179UAP00@mail-apac.sun.com>
 (original mail from Alan.Hargreaves@Sun.COM)
 for PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Thu,
 10 Jan 2008 16:53:18 +0800 (SGT)
Received: from [129.158.12.60] by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JUF00LDC7CSPB59@mail-apac.sun.com>; Thu,
 10 Jan 2008 16:53:18 +0800 (SGT)
Date: Thu, 10 Jan 2008 19:53:15 +1100
From: Alan Hargreaves <Alan.Hargreaves@sun.com>
Subject: Re: [dtrace-discuss] DTrace Provider for Bourne Shell [PSARC/2008/008
 FastTrack timeout 01/16/2008]
In-reply-to: <1088432570.20080110084034@task.gda.pl>
Sender: Alan.Hargreaves@sun.com
To: Robert Milkowski <rmilkowski@task.gda.pl>
Cc: Joseph Kowalski <jek3@sun.com>, PSARC-ext@sun.com,
        dtrace-discuss@opensolaris.org
Message-id: <4785DCFB.3020108@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200801080159.m081xlJj027681@sac.sfbay.sun.com>
 <47840278.2020102@sun.com> <478404F7.7050103@Sun.COM>
 <478416E7.7010901@Sun.COM> <47851027.9000806@Sun.COM>
 <1088432570.20080110084034@task.gda.pl>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 546

Robert Milkowski wrote:
> Hello Alan,
> 
> Wednesday, January 9, 2008, 6:19:19 PM, you wrote:
> 
> AH> This case was approved in the meeting today.
> 
> AH> alan.
> 
> 
> good.
> 
> btw: have you measured for severa scripts what's the performance
> impact of sh with and without usdt provider probes?
> Shouldn't by much but still...
> 

I have not measured, but the probes really are miniscule.

alan.
-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Staff Engineer (Kernel/VOSJEC/Performance)
Systems Technical Support Centre
Sun Microsystems

