From sacadmin Sat Feb 14 20:31:58 2009
Received: from jurassic-x4600.sfbay.sun.com (cretaceous.SFBay.Sun.COM [129.146.17.63])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1F4Vv8q020756;
	Sat, 14 Feb 2009 20:31:57 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com (localhost [127.0.0.1])
	by jurassic-x4600.sfbay.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n1F4VvV5536122
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 14 Feb 2009 20:31:57 -0800 (PST)
Received: (from dp@localhost)
	by jurassic-x4600.sfbay.sun.com (8.14.3+Sun/8.14.3/Submit) id n1F4Vv0u536118;
	Sat, 14 Feb 2009 20:31:57 -0800 (PST)
Date: Sat, 14 Feb 2009 20:31:57 -0800 (PST)
From: Dan Price <Daniel.Price@sun.com>
Message-Id: <200902150431.n1F4Vv0u536118@jurassic-x4600.sfbay.sun.com>
To: PSARC-record@sac.sfbay.sun.com
Cc: cmynhier@gmail.com, daniel.price@sun.com, john.levon@sun.com
Subject: Time stamp option for xxstat commands [PSARC/2009/105 FastTrack]
Status: RO
Content-Length: 568


Template Version: @(#)sac_nextcase %I% %G% SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 Time stamp option for xxstat commands
    1.2. Name of Document Author/Supplier:
	 Author:  Chad Mynhier
    1.3  Date of This Document:
	14 February, 2009
4. Technical Description
    See the case directory for more detail

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


From dp@eng.sun.com Sat Feb 14 20:36:05 2009
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 n1F4a4Ts020798
	for <psarc-ext@sac.sfbay.sun.com>; Sat, 14 Feb 2009 20:36:05 -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 n1F4Znwq008329;
	Sun, 15 Feb 2009 12:36:00 +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 <0KF300113BFXLG00@nwk-avmta-1.sfbay.Sun.COM>; Sat,
 14 Feb 2009 20:35:57 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.59])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KF300KUWBFDEZ80@nwk-avmta-1.sfbay.Sun.COM>; Sat,
 14 Feb 2009 20:35:37 -0800 (PST)
Received: from xanadu (xanadu.SFBay.Sun.COM [129.146.228.194])
	by jurassic-x4600.sfbay.sun.com (8.14.3+Sun/8.14.3)
 with ESMTP id n1F4ZbGg536291; Sat, 14 Feb 2009 20:35:37 -0800 (PST)
Date: Sat, 14 Feb 2009 20:35:38 -0800
From: Dan Price <dp@eng.sun.com>
Subject: PSARC/2009/105 Time stamp option for xxstat commands
To: PSARC-ext@sun.com
Cc: cmynhier@gmail.com, daniel.price@sun.com, john.levon@sun.com
Message-id: <20090215043537.GB14660@eng.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
User-Agent: Mutt/1.5.14 (2007-02-12)
Status: RO
Content-Length: 10897


I'm pleased to sponsor the following fast-track for Chad Mynhier.
Chad is enhancing some of the various "stat" commands to support
a time stamp option in keeping with a similar option provided by
iostat(1m).  This case also defines a uniform specification for
this option which future cases can reference in order to add
timestamp options to other "stat" commands.

For those who use the *stat commands to do monitoring over long
periods of time, this will be a welcome addition.

Please ensure that you CC Chad on all correspondance.

        -dp

---------------------------------------------------------------------------
Time stamp option for xxstat commands
Chad Mynhier <cmynhier@gmail.com>

SUMMARY
	This fast-track enhances the mpstat(1M), vmstat(1M), and
	prstat(1M) commands to address an existing RFE[1] requesting an
	option for each of these commands to emit a time stamp.  In
	addition, this fast-track enhances the existing time stamp
	functionality in iostat(1M) to print a locale-specific time
	stamp, if the standard date format is requested.

	This fast-track also sets a precedent that all "*stat" commands
	that print statistics at a regular interval should implement a
	timestamp feature similar to the one described here.

DETAILS

    Overview

	Currently, the iostat(1M) and fsstat(1M) commands provide an
	option to print a time stamp in either standard date format or
	traditional Unix time for each set of data.  For example:

# iostat -T d 1
Sat Jan 24 12:34:34 2009
   tty        sd0           sd1           sd2            cpu
 tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
   0    8  39   1   24   39   1   22    0   0    0    1  1  0 98
Sat Jan 24 12:34:35 2009
   0  220   0   0    0    0   0    0    0   0    0    0  1  0 99
Sat Jan 24 12:34:36 2009
   0   92   0   0    0    0   0    0    0   0    0    0  1  0 99
^C# 
# 
# fsstat -T u tmpfs 1
 new  name   name  attr  attr lookup rddir  read read  write write
 file remov  chng   get   set    ops   ops   ops bytes   ops bytes
2.57M 1.63M 25.9K 36.3M 70.8K  26.1M 4.67K  118M  464G 65.8M  253G tmpfs
1232818548
    0     0     0     0     0      0     0     0     0     0     0 tmpfs
1232818549
    0     0     0     0     0      0     0     0     0     0     0 tmpfs
1232818550
    0     0     0     0     0      0     0     0     0     0     0 tmpfs
^C# 

	The mpstat(1M), vmstat(1M), and prstat(1M) commands do not
	provide such an option.  This option is useful when gathering
	data to correlate with a transient system or application
	problem whose time is known after the fact.  While this problem
	can be worked around by wrapping the command in a script that
	adds a time stamp to the output, it would be better to provide
	consistency with iostat(1M) and fsstat(1M).

	Additionally, the time stamp currently emitted by iostat(1M) is
	printed unconditionally in the format specified by the C
	locale.  For example:

# locale
LANG=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME=fr
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
# iostat -T d 3
Mon Jan 26 12:03:42 2009
   tty        sd0           sd1           sd2            cpu
 tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
   0    8  43   1   24   43   1   22    0   0    0    1  1  0 98
Mon Jan 26 12:03:45 2009
   0   73   0   0    0    0   0    0    0   0    0    0  0  0 99
^C# 

	We plan to address these issues as follows:

	1. We will add the "[-T d | u]" option to vmstat(1M) and mpstat(1M)
	   to mirror that option in iostat(1M) and fsstat(1M).

	2. We will add the the "[-d d | u]" option to prstat(1M) to print a 
	   time stamp.

	3.  We will modify iostat(1M) to print the time stamp in a
	    locale-specific format (i.e., printing local time using
	    strftime(3C) with the correct format string for the locale.)

	There are two possible options for the placement of the
	time stamp in the output.  The first option is to emit the
	time stamp on a separate line prior to each set of data.  The
	second option is to print the time stamp as an additional column
	in the output.  We choose the first option for two reasons.
	The first of these is that there is a precedent in how
	iostat(1M) and fsstat(1M) output the time stamp, as shown
	above.  The second is that the time stamp would consume a large
	number of columns, and these utilities are designed (for the
	most part) to fit in 80 columns.

	Because the output of mpstat(1M) and prstat(1M) typically
	includes multiple rows, we also have the option of printing one
	time stamp per row.  We choose instead to print one time stamp
	per sampling period.  This follows the precedent set by
	iostat(1M), and it allows the most data to be printed on a
	single screen.  Note that this also applies to those modes of
	prstat(1M) that involve printing two separate sets of data,
	such as per-process and per-zone statistics.  Only one
	time stamp is shown in these cases.

	It could be argued that the time stamp option only makes sense
	in conjunction with the "-c" option of prstat(1M), given that
	otherwise the time stamp is overwritten with each sample.  For
	the sake of completeness, however, we propose implementing the
	time stamp option as an independent option that can be used in
	either mode.

EXAMPLE

	This example shows mpstat(1M) output using a standard date
	format time stamp:

# ./mpstat -T d 1
Sat Jan 24 13:14:59 2009
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  0  201   0   77  2219  127   87    3    2   14    1   241    1   1   0  98
  1  209   0   73   173   26   92    3    2   15    1   246    1   1   0  98
  2  203   0  105   165   24   94    2    2   14    1   240    1   1   0  98
  3  207   0   73   177   25   97    3    2   14    1   243    1   1   0  98
Sat Jan 24 13:15:00 2009
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  0 18387   0 3246 10899  111  455  222   82  518   79 17262   71  29   0   0
  1 24517   0 3635  8790    9  482  210   66  624   86 22727   63  37   0   0
  2 20614   0 8964  7016   75  460  189   68  573   83 17889   61  39   0   0
  3 23650   0 13319  5535   21  442  186   69  546   75 17211   64  36   0   0
Sat Jan 24 13:15:01 2009
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  0 21763   0 4950 13096  130  491  187   89  521   46 15574   62  38   0   0
  1 19702   0 12835  8601   48  478  219   86  482   76 16697   64  36   0   0
  2 16842   0 11385  9045   62  396  195   69  418   62 14106   74  26   0   0
  3 29149   0 8459 10058   18  538  216   85  665  103 24843   55  45   0   0
Sat Jan 24 13:15:02 2009
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  0 27958   0 10245 21765  125  657  212  127  817  144 21165   46  52   0   3
  1 26394   0 8131 20657   28  703  196  118  847  142 19734   45  52   0   3
  2 26998   0 44518  8242  114  478  174  106  778  100 17544   38  61   0   1
  3 16175   0 4904 20502   33  553  140  115  506   55 14710   54  38   0   8
^C# 


	This example shows vmstat(1M) output using a traditional Unix
	time stamp:

# ./vmstat -T u 1
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr f0 s0 s1 s2   in   sy   cs us sy id
1232820946
 0 0 0 3666444 2642924 59 824 0 0  0  0  4  0  1  1 -1 2735  974  370  1  1 98
1232820947
 5 0 0 2521192 1540320 5071 92284 0 0 0 0 0 0 22 20  0 54794 83465 1661 63 37 0
1232820948
 4 0 0 2495436 1511176 5642 87339 0 0 0 0 0 0 28 28  0 39021 59198 1570 67 33 0
1232820949
 3 0 0 2525936 1545120 5767 81687 0 0 0 0 0 0 20 20  0 31799 60757 1697 69 31 0
^C# 


	This example shows prstat(1M) output using a standard date
	format time stamp (with the -c option):

# amd64/prstat -c -d d -n 5 1
Sat Jan 24 13:17:42 2009
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
  6920 mynhier  5760K 4664K sleep    0    4   0:00:00 0.5% dmake/1
 13928 mynhier    25M   24M sleep    0    4   0:00:00 0.3% dmake/1
  9229 mynhier    21M   17M cpu3     0    4   0:00:00 0.3% dmake/1
  1504 noaccess  101M   76M sleep   59    0   0:43:09 0.0% java/18
  9315 root     3772K 2568K cpu1    39    0   0:00:00 0.0% prstat/1
Total: 95 processes, 256 lwps, load averages: 6.93, 4.99, 2.46
Sat Jan 24 13:17:43 2009
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
  6920 mynhier  5840K 4748K sleep    0    4   0:00:00 0.5% dmake/1
  9229 mynhier    22M   21M sleep   38    4   0:00:00 0.4% dmake/1
  9528 mynhier    15M   12M run      0    4   0:00:00 0.4% acomp/1
  9430 mynhier    10M 9628K sleep    0    4   0:00:00 0.4% dmake/1
 13928 mynhier    25M   24M sleep   38    4   0:00:00 0.3% dmake/1
Total: 114 processes, 274 lwps, load averages: 6.91, 4.99, 2.47
# 

	This example shows a screenshot of the above command without
	the -c option.  (There's little difference to be seen between
	the previous example and this one, but this one is included in
	order to explicitly show the placement of the time stamp in
	this mode.):

Sat Jan 24 13:20:25 2009
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
  4992 mynhier    29M   26M cpu2     0    4   0:00:00 1.1% ube/1
   537 mynhier    13M   12M sleep   39    4   0:00:01 1.1% dmake/1
  5045 mynhier    45M   41M run      0    4   0:00:00 0.4% ube/1
  5145 mynhier    21M   12M run      0    4   0:00:00 0.1% iropt/1
   386 mynhier    30M   29M sleep   47    4   0:00:00 0.1% dmake/1
Total: 144 processes, 302 lwps, load averages: 6.76, 5.72, 3.17

	This example shows iostat(1M) output using the French locale:

# ./iostat -T d 3
lundi 26 janvier 2009 12 h 08 EST
   tty        sd0           sd1           sd2            cpu
 tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
   0    8  43   1   24   43   1   22    0   0    0    1  1  0 98
lundi 26 janvier 2009 12 h 08 EST
   0   76   0   0    0    0   0    0    0   0    0    0  0  0 100
^C# 

DOCUMENTATION

	This fast-track proposes adding the following text to the man
	pages for mpstat(1M), vmstat(1M), and prstat(1M), with the
	exception that the prstat(1M) shall be listed as "-d":

	-T u | d
		Emit a time stamp.

		Specify u for a printed representation of the internal
		representation  of  time.  See time(2).  Specify d for
		standard date format. See date(1).

	Additionally, the option should be added to the SYNOPSIS
	section of the man pages for each of these.

	(The iostat(1M) man page should be changed to read, "See
	date(1)."  rather than "See ctime(3C)." to reflect the
	localization change.)

REFERENCES

[1] would like a timestamp option like iostat has added to mpstat, vmstat
    and prstat
    (http://bugs.opensolaris.org/view_bug.do?bug_id=4775687)
---------------------------------------------------------------------------

-- 
Daniel Price, Solaris Kernel Engineering    http://blogs.sun.com/dp

From gdamore@sun.com Sun Feb 15 09:12:09 2009
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1FHC9Cn009806
	for <psarc-ext@sac.sfbay.sun.com>; Sun, 15 Feb 2009 09:12:09 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1FHC56X016099;
	Sun, 15 Feb 2009 09:12:07 -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 <0KF400D03AG7O100@nwk-avmta-1.sfbay.Sun.COM>; Sun,
 15 Feb 2009 09:12:07 -0800 (PST)
Received: from sca-es-mail-1.sun.com ([192.18.43.132])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KF400765AG6X910@nwk-avmta-1.sfbay.Sun.COM>; Sun,
 15 Feb 2009 09:12:06 -0800 (PST)
Received: from fe-sfbay-09.sun.com ([192.18.43.129])
	by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n1FHC6G1014021;
 Sun, 15 Feb 2009 09:12:06 -0800 (PST)
Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com
 (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 23 2008))
 id <0KF400G009HA0L00@fe-sfbay-09.sun.com>; Sun,
 15 Feb 2009 08:53:11 -0800 (PST)
Received: from [192.168.251.11] ([unknown] [76.93.15.33])
 by fe-sfbay-09.sun.com
 (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 23 2008))
 with ESMTPSA id <0KF400H1F9KMK300@fe-sfbay-09.sun.com>; Sun,
 15 Feb 2009 08:53:11 -0800 (PST)
Date: Sun, 15 Feb 2009 09:12:05 -0800
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: PSARC/2009/105 Time stamp option for xxstat commands
In-reply-to: <20090215043537.GB14660@eng.sun.com>
Sender: Garrett.Damore@sun.com
To: Dan Price <dp@eng.sun.com>
Cc: PSARC-ext@sun.com, cmynhier@gmail.com, Daniel.Price@sun.com,
        john.levon@sun.com
Message-id: <49984CE5.3010606@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <20090215043537.GB14660@eng.sun.com>
User-Agent: Thunderbird 2.0.0.18 (X11/20081201)
Status: RO
Content-Length: 11321

+1

Dan Price wrote:
> I'm pleased to sponsor the following fast-track for Chad Mynhier.
> Chad is enhancing some of the various "stat" commands to support
> a time stamp option in keeping with a similar option provided by
> iostat(1m).  This case also defines a uniform specification for
> this option which future cases can reference in order to add
> timestamp options to other "stat" commands.
>
> For those who use the *stat commands to do monitoring over long
> periods of time, this will be a welcome addition.
>
> Please ensure that you CC Chad on all correspondance.
>
>         -dp
>
> ---------------------------------------------------------------------------
> Time stamp option for xxstat commands
> Chad Mynhier <cmynhier@gmail.com>
>
> SUMMARY
> 	This fast-track enhances the mpstat(1M), vmstat(1M), and
> 	prstat(1M) commands to address an existing RFE[1] requesting an
> 	option for each of these commands to emit a time stamp.  In
> 	addition, this fast-track enhances the existing time stamp
> 	functionality in iostat(1M) to print a locale-specific time
> 	stamp, if the standard date format is requested.
>
> 	This fast-track also sets a precedent that all "*stat" commands
> 	that print statistics at a regular interval should implement a
> 	timestamp feature similar to the one described here.
>
> DETAILS
>
>     Overview
>
> 	Currently, the iostat(1M) and fsstat(1M) commands provide an
> 	option to print a time stamp in either standard date format or
> 	traditional Unix time for each set of data.  For example:
>
> # iostat -T d 1
> Sat Jan 24 12:34:34 2009
>    tty        sd0           sd1           sd2            cpu
>  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
>    0    8  39   1   24   39   1   22    0   0    0    1  1  0 98
> Sat Jan 24 12:34:35 2009
>    0  220   0   0    0    0   0    0    0   0    0    0  1  0 99
> Sat Jan 24 12:34:36 2009
>    0   92   0   0    0    0   0    0    0   0    0    0  1  0 99
> ^C# 
> # 
> # fsstat -T u tmpfs 1
>  new  name   name  attr  attr lookup rddir  read read  write write
>  file remov  chng   get   set    ops   ops   ops bytes   ops bytes
> 2.57M 1.63M 25.9K 36.3M 70.8K  26.1M 4.67K  118M  464G 65.8M  253G tmpfs
> 1232818548
>     0     0     0     0     0      0     0     0     0     0     0 tmpfs
> 1232818549
>     0     0     0     0     0      0     0     0     0     0     0 tmpfs
> 1232818550
>     0     0     0     0     0      0     0     0     0     0     0 tmpfs
> ^C# 
>
> 	The mpstat(1M), vmstat(1M), and prstat(1M) commands do not
> 	provide such an option.  This option is useful when gathering
> 	data to correlate with a transient system or application
> 	problem whose time is known after the fact.  While this problem
> 	can be worked around by wrapping the command in a script that
> 	adds a time stamp to the output, it would be better to provide
> 	consistency with iostat(1M) and fsstat(1M).
>
> 	Additionally, the time stamp currently emitted by iostat(1M) is
> 	printed unconditionally in the format specified by the C
> 	locale.  For example:
>
> # locale
> LANG=
> LC_CTYPE="C"
> LC_NUMERIC="C"
> LC_TIME=fr
> LC_COLLATE="C"
> LC_MONETARY="C"
> LC_MESSAGES="C"
> LC_ALL=
> # iostat -T d 3
> Mon Jan 26 12:03:42 2009
>    tty        sd0           sd1           sd2            cpu
>  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
>    0    8  43   1   24   43   1   22    0   0    0    1  1  0 98
> Mon Jan 26 12:03:45 2009
>    0   73   0   0    0    0   0    0    0   0    0    0  0  0 99
> ^C# 
>
> 	We plan to address these issues as follows:
>
> 	1. We will add the "[-T d | u]" option to vmstat(1M) and mpstat(1M)
> 	   to mirror that option in iostat(1M) and fsstat(1M).
>
> 	2. We will add the the "[-d d | u]" option to prstat(1M) to print a 
> 	   time stamp.
>
> 	3.  We will modify iostat(1M) to print the time stamp in a
> 	    locale-specific format (i.e., printing local time using
> 	    strftime(3C) with the correct format string for the locale.)
>
> 	There are two possible options for the placement of the
> 	time stamp in the output.  The first option is to emit the
> 	time stamp on a separate line prior to each set of data.  The
> 	second option is to print the time stamp as an additional column
> 	in the output.  We choose the first option for two reasons.
> 	The first of these is that there is a precedent in how
> 	iostat(1M) and fsstat(1M) output the time stamp, as shown
> 	above.  The second is that the time stamp would consume a large
> 	number of columns, and these utilities are designed (for the
> 	most part) to fit in 80 columns.
>
> 	Because the output of mpstat(1M) and prstat(1M) typically
> 	includes multiple rows, we also have the option of printing one
> 	time stamp per row.  We choose instead to print one time stamp
> 	per sampling period.  This follows the precedent set by
> 	iostat(1M), and it allows the most data to be printed on a
> 	single screen.  Note that this also applies to those modes of
> 	prstat(1M) that involve printing two separate sets of data,
> 	such as per-process and per-zone statistics.  Only one
> 	time stamp is shown in these cases.
>
> 	It could be argued that the time stamp option only makes sense
> 	in conjunction with the "-c" option of prstat(1M), given that
> 	otherwise the time stamp is overwritten with each sample.  For
> 	the sake of completeness, however, we propose implementing the
> 	time stamp option as an independent option that can be used in
> 	either mode.
>
> EXAMPLE
>
> 	This example shows mpstat(1M) output using a standard date
> 	format time stamp:
>
> # ./mpstat -T d 1
> Sat Jan 24 13:14:59 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0  201   0   77  2219  127   87    3    2   14    1   241    1   1   0  98
>   1  209   0   73   173   26   92    3    2   15    1   246    1   1   0  98
>   2  203   0  105   165   24   94    2    2   14    1   240    1   1   0  98
>   3  207   0   73   177   25   97    3    2   14    1   243    1   1   0  98
> Sat Jan 24 13:15:00 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0 18387   0 3246 10899  111  455  222   82  518   79 17262   71  29   0   0
>   1 24517   0 3635  8790    9  482  210   66  624   86 22727   63  37   0   0
>   2 20614   0 8964  7016   75  460  189   68  573   83 17889   61  39   0   0
>   3 23650   0 13319  5535   21  442  186   69  546   75 17211   64  36   0   0
> Sat Jan 24 13:15:01 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0 21763   0 4950 13096  130  491  187   89  521   46 15574   62  38   0   0
>   1 19702   0 12835  8601   48  478  219   86  482   76 16697   64  36   0   0
>   2 16842   0 11385  9045   62  396  195   69  418   62 14106   74  26   0   0
>   3 29149   0 8459 10058   18  538  216   85  665  103 24843   55  45   0   0
> Sat Jan 24 13:15:02 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0 27958   0 10245 21765  125  657  212  127  817  144 21165   46  52   0   3
>   1 26394   0 8131 20657   28  703  196  118  847  142 19734   45  52   0   3
>   2 26998   0 44518  8242  114  478  174  106  778  100 17544   38  61   0   1
>   3 16175   0 4904 20502   33  553  140  115  506   55 14710   54  38   0   8
> ^C# 
>
>
> 	This example shows vmstat(1M) output using a traditional Unix
> 	time stamp:
>
> # ./vmstat -T u 1
>  kthr      memory            page            disk          faults      cpu
>  r b w   swap  free  re  mf pi po fr de sr f0 s0 s1 s2   in   sy   cs us sy id
> 1232820946
>  0 0 0 3666444 2642924 59 824 0 0  0  0  4  0  1  1 -1 2735  974  370  1  1 98
> 1232820947
>  5 0 0 2521192 1540320 5071 92284 0 0 0 0 0 0 22 20  0 54794 83465 1661 63 37 0
> 1232820948
>  4 0 0 2495436 1511176 5642 87339 0 0 0 0 0 0 28 28  0 39021 59198 1570 67 33 0
> 1232820949
>  3 0 0 2525936 1545120 5767 81687 0 0 0 0 0 0 20 20  0 31799 60757 1697 69 31 0
> ^C# 
>
>
> 	This example shows prstat(1M) output using a standard date
> 	format time stamp (with the -c option):
>
> # amd64/prstat -c -d d -n 5 1
> Sat Jan 24 13:17:42 2009
>    PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
>   6920 mynhier  5760K 4664K sleep    0    4   0:00:00 0.5% dmake/1
>  13928 mynhier    25M   24M sleep    0    4   0:00:00 0.3% dmake/1
>   9229 mynhier    21M   17M cpu3     0    4   0:00:00 0.3% dmake/1
>   1504 noaccess  101M   76M sleep   59    0   0:43:09 0.0% java/18
>   9315 root     3772K 2568K cpu1    39    0   0:00:00 0.0% prstat/1
> Total: 95 processes, 256 lwps, load averages: 6.93, 4.99, 2.46
> Sat Jan 24 13:17:43 2009
>    PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
>   6920 mynhier  5840K 4748K sleep    0    4   0:00:00 0.5% dmake/1
>   9229 mynhier    22M   21M sleep   38    4   0:00:00 0.4% dmake/1
>   9528 mynhier    15M   12M run      0    4   0:00:00 0.4% acomp/1
>   9430 mynhier    10M 9628K sleep    0    4   0:00:00 0.4% dmake/1
>  13928 mynhier    25M   24M sleep   38    4   0:00:00 0.3% dmake/1
> Total: 114 processes, 274 lwps, load averages: 6.91, 4.99, 2.47
> # 
>
> 	This example shows a screenshot of the above command without
> 	the -c option.  (There's little difference to be seen between
> 	the previous example and this one, but this one is included in
> 	order to explicitly show the placement of the time stamp in
> 	this mode.):
>
> Sat Jan 24 13:20:25 2009
>    PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
>   4992 mynhier    29M   26M cpu2     0    4   0:00:00 1.1% ube/1
>    537 mynhier    13M   12M sleep   39    4   0:00:01 1.1% dmake/1
>   5045 mynhier    45M   41M run      0    4   0:00:00 0.4% ube/1
>   5145 mynhier    21M   12M run      0    4   0:00:00 0.1% iropt/1
>    386 mynhier    30M   29M sleep   47    4   0:00:00 0.1% dmake/1
> Total: 144 processes, 302 lwps, load averages: 6.76, 5.72, 3.17
>
> 	This example shows iostat(1M) output using the French locale:
>
> # ./iostat -T d 3
> lundi 26 janvier 2009 12 h 08 EST
>    tty        sd0           sd1           sd2            cpu
>  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
>    0    8  43   1   24   43   1   22    0   0    0    1  1  0 98
> lundi 26 janvier 2009 12 h 08 EST
>    0   76   0   0    0    0   0    0    0   0    0    0  0  0 100
> ^C# 
>
> DOCUMENTATION
>
> 	This fast-track proposes adding the following text to the man
> 	pages for mpstat(1M), vmstat(1M), and prstat(1M), with the
> 	exception that the prstat(1M) shall be listed as "-d":
>
> 	-T u | d
> 		Emit a time stamp.
>
> 		Specify u for a printed representation of the internal
> 		representation  of  time.  See time(2).  Specify d for
> 		standard date format. See date(1).
>
> 	Additionally, the option should be added to the SYNOPSIS
> 	section of the man pages for each of these.
>
> 	(The iostat(1M) man page should be changed to read, "See
> 	date(1)."  rather than "See ctime(3C)." to reflect the
> 	localization change.)
>
> REFERENCES
>
> [1] would like a timestamp option like iostat has added to mpstat, vmstat
>     and prstat
>     (http://bugs.opensolaris.org/view_bug.do?bug_id=4775687)
> ---------------------------------------------------------------------------
>
>   


From cmynhier@gmail.com Sun Feb 15 10:49:05 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1FIn4Go013227
	for <psarc-ext@sac.sfbay.sun.com>; Sun, 15 Feb 2009 10:49:05 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1FIn32u023847;
	Sun, 15 Feb 2009 10:49:03 -0800 (PST)
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 <0KF400001EXQ2O00@nwk-avmta-2.sfbay.sun.com>; Sun,
 15 Feb 2009 10:49:02 -0800 (PST)
Received: from sca-ea-mail-3.sun.com ([192.18.43.21])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KF400LG1EXPVF00@nwk-avmta-2.sfbay.sun.com>; Sun,
 15 Feb 2009 10:49:02 -0800 (PST)
Received: from relay15i.sun.com
 (ip125.net129179-4.block1.us.syntegra.com [129.179.4.125])
	by sca-ea-mail-3.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n1FIn1Sf005410;
 Sun, 15 Feb 2009 18:49:01 +0000 (GMT)
Received: from mmp12es.mmp.us.syntegra.com ([160.41.208.12] [160.41.208.12])
 by relay15i.sun.com with ESMTP id BT-MMP-4574216; Sun,
 15 Feb 2009 18:49:01 +0000 (Z)
Received: from relay13i.sun.com (relay13i.sun.com [129.179.4.123])
 by mmp12es.mmp.us.syntegra.com with ESMTP id BT-MMP-21027311; Sun,
 15 Feb 2009 18:49:01 +0000 (Z)
Received: from mail-qy0-f20.google.com ([209.85.221.20] [209.85.221.20])
 by relay1i.sun.com with ESMTP id BT-MMP-10733444; Sun,
 15 Feb 2009 18:49:01 +0000 (Z)
Received: by qyk13 with SMTP id 13so2985794qyk.8 for <multiple recipients>;
 Sun, 15 Feb 2009 10:48:50 -0800 (PST)
Received: by 10.224.37.76 with SMTP id w12mr468256qad.136.1234723730906; Sun,
 15 Feb 2009 10:48:50 -0800 (PST)
Date: Sun, 15 Feb 2009 13:48:50 -0500
From: Chad Mynhier <cmynhier@gmail.com>
Subject: Re: PSARC/2009/105 Time stamp option for xxstat commands
In-reply-to: <20090215043537.GB14660@eng.sun.com>
To: Dan Price <dp@eng.sun.com>
Cc: PSARC-ext@sun.com, daniel.price@sun.com, john.levon@sun.com
Message-id: <3cf3989e0902151048q7fab2d48o88df5e388e5f3ba6@mail.gmail.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references
 :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding;
 bh=DWnPP4quzgbd8K55f6yscBv7870wMljLdGSyYiSmSnc=;
 b=mLZvF8WY7XngMm1srbGqsxv3lULgR3MQk7fJ4FRao6+K48K3mvcASMAZt16QRNnhZX
 DOBMSSDNARjODLRHb/PN9T2YVWYZ7ach7XEriTEnESiDMPEY7T+oZaslHkwQ3kSaz+Hk
 GHEpEeBBKuLwn/ee657C92Ye+SVE0E1aOY51E=
DomainKey-Signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type:content-transfer-encoding;
 b=vl258sSx7xGHtuuzHeCmJk6PkTYuDbw51mUGC7gJZT23Zd+FxmlHMJwzBkos/LUdQX
 HZqme61wzd8yjb6Liur/x2oq+leBayxPD5w2RULyCj6x3CcKWVttKMLymP25Rxa/HHqN
 XYT/OYiXSzt2qpR30uK8/kjbv7B9KvwEGNbGE=
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=0.0/5.0, scanned in 0.058sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <20090215043537.GB14660@eng.sun.com>
Status: RO
Content-Length: 1328

On Sat, Feb 14, 2009 at 11:35 PM, Dan Price <dp@eng.sun.com> wrote:
>
> I'm pleased to sponsor the following fast-track for Chad Mynhier.
> Chad is enhancing some of the various "stat" commands to support
> a time stamp option in keeping with a similar option provided by
> iostat(1m).  This case also defines a uniform specification for
> this option which future cases can reference in order to add
> timestamp options to other "stat" commands.

FTR, the one-pager specifically addresses adding the timestamp option
mpstat(1M), vmstat(1M), and prstat(1M) (per 4775687) and fixing the
timestamp option for iostat(1M) (which I'm considering to be within
the scope of the fix for 4775687, given that I've made the timestamp
processing for everything under usr/src/cmd/stat common.)

In addition, kstat(1M) needs to be converted to be locale-specific,
and the following commands would need a timestamp option added to meet
the proposed standard:

/usr/bin/busstat
/usr/bin/ctstat
/usr/bin/dsstat
/usr/bin/netstat
/usr/bin/nfsstat
/usr/bin/poolstat
/usr/bin/rcapstat
/usr/sbin/auditstat
/usr/sbin/cpustat
/usr/sbin/fmstat
/usr/sbin/intrstat
/usr/sbin/ipfstat
/usr/sbin/ndmpstat
/usr/sbin/syncstat
/usr/sbin/trapstat
/usr/sbin/zpool iostat

(This is an attempt at an exhaustive list, but it's possible I've
missed something.)

Chad

From Joerg.Schilling@fokus.fraunhofer.de Tue Feb 17 02:14:02 2009
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 n1HAE1Tl017591
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 17 Feb 2009 02:14:02 -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 n1HADvRI010594;
	Tue, 17 Feb 2009 18:13:59 +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 <0KF700D0TGFAKS00@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 17 Feb 2009 02:13:58 -0800 (PST)
Received: from sca-ea-mail-3.sun.com ([192.18.43.21])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KF7004UIGF9TKD0@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 17 Feb 2009 02:13:57 -0800 (PST)
Received: from relay43i.sun.com ([192.5.209.74])
	by sca-ea-mail-3.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n1HAB9mU022997;
 Tue, 17 Feb 2009 10:13:57 +0000 (GMT)
Received: from mmp41es.mmp.us.syntegra.com ([160.41.221.10] [160.41.221.10])
 by relay43i.sun.com with ESMTP id BT-MMP-1664356; Tue,
 17 Feb 2009 10:13:57 +0000 (Z)
Received: from relay42i.sun.com (relay42i.sun.com [192.5.209.72])
 by mmp41es.mmp.us.syntegra.com with ESMTP id BT-MMP-12535296; Tue,
 17 Feb 2009 10:13:54 +0000 (Z)
Received: from iron02.fraunhofer.de ([153.96.1.56] [153.96.1.56])
 by relay4i.sun.com with ESMTP id BT-MMP-15123909; Tue,
 17 Feb 2009 10:13:54 +0000 (Z)
Received: from pluto.fokus.fraunhofer.de ([195.37.77.164])
 by iron02.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-SHA; Tue,
 17 Feb 2009 11:13:52 +0100
Received: from EXCHSRV.fokus.fraunhofer.de (bohr [10.147.9.231])
	by pluto.fokus.fraunhofer.de (8.13.7/8.13.7) with SMTP id n1HADqWN026564; Tue,
 17 Feb 2009 11:13:53 +0100 (MET)
Received: from rigel ([10.147.65.195]) by EXCHSRV.fokus.fraunhofer.de with
 Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Feb 2009 11:13:52 +0100
Date: Tue, 17 Feb 2009 11:13:52 +0100
From: Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
Subject: Re: PSARC/2009/105 Time stamp option for xxstat commands
In-reply-to: <20090215043537.GB14660@eng.sun.com>
To: PSARC-ext@sun.com, dp@eng.sun.com
Cc: daniel.price@sun.com
Message-id: <499a8de0.fTFM/C409f+OQhcW%Joerg.Schilling@fokus.fraunhofer.de>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=0.0/5.0, scanned in 2.338sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <20090215043537.GB14660@eng.sun.com>
User-Agent: nail 11.22 3/20/05
X-OriginalArrivalTime: 17 Feb 2009 10:13:52.0898 (UTC)
 FILETIME=[6F2FB620:01C990E8]
Status: RO
Content-Length: 835

Dan Price <dp@eng.sun.com> wrote:

>
> I'm pleased to sponsor the following fast-track for Chad Mynhier.
> Chad is enhancing some of the various "stat" commands to support
> a time stamp option in keeping with a similar option provided by
> iostat(1m).  This case also defines a uniform specification for
> this option which future cases can reference in order to add
> timestamp options to other "stat" commands.
>
> For those who use the *stat commands to do monitoring over long
> periods of time, this will be a welcome addition.

+1

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily

From dp@eng.sun.com Thu Feb 26 11:46:12 2009
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 n1QJkCkV005474
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 26 Feb 2009 11:46:12 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1QJjw0n007765;
	Thu, 26 Feb 2009 12:46:10 -0700 (MST)
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 <0KFO00I4CUWX1J00@nwk-avmta-2.sfbay.sun.com>; Thu,
 26 Feb 2009 11:46:09 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.63])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFO00FLEUWVMG30@nwk-avmta-2.sfbay.sun.com>; Thu,
 26 Feb 2009 11:46:07 -0800 (PST)
Received: from xanadu (xanadu.SFBay.Sun.COM [129.146.228.194])
	by jurassic-x4600.sfbay.sun.com (8.14.3+Sun/8.14.3)
 with ESMTP id n1QJk29s421920; Thu, 26 Feb 2009 11:46:02 -0800 (PST)
Date: Thu, 26 Feb 2009 11:46:09 -0800
From: Dan Price <dp@eng.sun.com>
Subject: Re: PSARC/2009/105 Time stamp option for xxstat commands
In-reply-to: <20090215043537.GB14660@eng.sun.com>
To: PSARC-ext@sun.com
Cc: cmynhier@gmail.com, daniel.price@sun.com, john.levon@sun.com
Message-id: <20090226194609.GL1495@eng.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <20090215043537.GB14660@eng.sun.com>
User-Agent: Mutt/1.5.14 (2007-02-12)
Status: RO
Content-Length: 12343


PSARC-- I made a grave error in filing this case, which is that I forgot
to update the IAM file to change the state of the case to Waiting Fast
Track after I mailed the proposal out to the case.  As a result this
case was not considered yesterday at ARC business.  This was a careless
oversight on my part and should in no way reflects on the author of this
case, Chad Mynhier.

I have apologized to Chad, and I would appreciate it very much if the
ARC would allow me to set the timer to tomorrow, Friday, Feb 27 2009, at
close-of-business pacific time.  In this way we can avoid further delay.
This case has thus far been non-controversial.

I have altered the IAM file to set the timer to tomorrow; please
let us know if this is not acceptable.

Thanks.  Again, please accept my apologies.

        -dp

On Sat 14 Feb 2009 at 08:35PM, Dan Price wrote:
> 
> I'm pleased to sponsor the following fast-track for Chad Mynhier.
> Chad is enhancing some of the various "stat" commands to support
> a time stamp option in keeping with a similar option provided by
> iostat(1m).  This case also defines a uniform specification for
> this option which future cases can reference in order to add
> timestamp options to other "stat" commands.
> 
> For those who use the *stat commands to do monitoring over long
> periods of time, this will be a welcome addition.
> 
> Please ensure that you CC Chad on all correspondance.
> 
>         -dp
> 
> ---------------------------------------------------------------------------
> Time stamp option for xxstat commands
> Chad Mynhier <cmynhier@gmail.com>
> 
> SUMMARY
> 	This fast-track enhances the mpstat(1M), vmstat(1M), and
> 	prstat(1M) commands to address an existing RFE[1] requesting an
> 	option for each of these commands to emit a time stamp.  In
> 	addition, this fast-track enhances the existing time stamp
> 	functionality in iostat(1M) to print a locale-specific time
> 	stamp, if the standard date format is requested.
> 
> 	This fast-track also sets a precedent that all "*stat" commands
> 	that print statistics at a regular interval should implement a
> 	timestamp feature similar to the one described here.
> 
> DETAILS
> 
>     Overview
> 
> 	Currently, the iostat(1M) and fsstat(1M) commands provide an
> 	option to print a time stamp in either standard date format or
> 	traditional Unix time for each set of data.  For example:
> 
> # iostat -T d 1
> Sat Jan 24 12:34:34 2009
>    tty        sd0           sd1           sd2            cpu
>  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
>    0    8  39   1   24   39   1   22    0   0    0    1  1  0 98
> Sat Jan 24 12:34:35 2009
>    0  220   0   0    0    0   0    0    0   0    0    0  1  0 99
> Sat Jan 24 12:34:36 2009
>    0   92   0   0    0    0   0    0    0   0    0    0  1  0 99
> ^C# 
> # 
> # fsstat -T u tmpfs 1
>  new  name   name  attr  attr lookup rddir  read read  write write
>  file remov  chng   get   set    ops   ops   ops bytes   ops bytes
> 2.57M 1.63M 25.9K 36.3M 70.8K  26.1M 4.67K  118M  464G 65.8M  253G tmpfs
> 1232818548
>     0     0     0     0     0      0     0     0     0     0     0 tmpfs
> 1232818549
>     0     0     0     0     0      0     0     0     0     0     0 tmpfs
> 1232818550
>     0     0     0     0     0      0     0     0     0     0     0 tmpfs
> ^C# 
> 
> 	The mpstat(1M), vmstat(1M), and prstat(1M) commands do not
> 	provide such an option.  This option is useful when gathering
> 	data to correlate with a transient system or application
> 	problem whose time is known after the fact.  While this problem
> 	can be worked around by wrapping the command in a script that
> 	adds a time stamp to the output, it would be better to provide
> 	consistency with iostat(1M) and fsstat(1M).
> 
> 	Additionally, the time stamp currently emitted by iostat(1M) is
> 	printed unconditionally in the format specified by the C
> 	locale.  For example:
> 
> # locale
> LANG=
> LC_CTYPE="C"
> LC_NUMERIC="C"
> LC_TIME=fr
> LC_COLLATE="C"
> LC_MONETARY="C"
> LC_MESSAGES="C"
> LC_ALL=
> # iostat -T d 3
> Mon Jan 26 12:03:42 2009
>    tty        sd0           sd1           sd2            cpu
>  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
>    0    8  43   1   24   43   1   22    0   0    0    1  1  0 98
> Mon Jan 26 12:03:45 2009
>    0   73   0   0    0    0   0    0    0   0    0    0  0  0 99
> ^C# 
> 
> 	We plan to address these issues as follows:
> 
> 	1. We will add the "[-T d | u]" option to vmstat(1M) and mpstat(1M)
> 	   to mirror that option in iostat(1M) and fsstat(1M).
> 
> 	2. We will add the the "[-d d | u]" option to prstat(1M) to print a 
> 	   time stamp.
> 
> 	3.  We will modify iostat(1M) to print the time stamp in a
> 	    locale-specific format (i.e., printing local time using
> 	    strftime(3C) with the correct format string for the locale.)
> 
> 	There are two possible options for the placement of the
> 	time stamp in the output.  The first option is to emit the
> 	time stamp on a separate line prior to each set of data.  The
> 	second option is to print the time stamp as an additional column
> 	in the output.  We choose the first option for two reasons.
> 	The first of these is that there is a precedent in how
> 	iostat(1M) and fsstat(1M) output the time stamp, as shown
> 	above.  The second is that the time stamp would consume a large
> 	number of columns, and these utilities are designed (for the
> 	most part) to fit in 80 columns.
> 
> 	Because the output of mpstat(1M) and prstat(1M) typically
> 	includes multiple rows, we also have the option of printing one
> 	time stamp per row.  We choose instead to print one time stamp
> 	per sampling period.  This follows the precedent set by
> 	iostat(1M), and it allows the most data to be printed on a
> 	single screen.  Note that this also applies to those modes of
> 	prstat(1M) that involve printing two separate sets of data,
> 	such as per-process and per-zone statistics.  Only one
> 	time stamp is shown in these cases.
> 
> 	It could be argued that the time stamp option only makes sense
> 	in conjunction with the "-c" option of prstat(1M), given that
> 	otherwise the time stamp is overwritten with each sample.  For
> 	the sake of completeness, however, we propose implementing the
> 	time stamp option as an independent option that can be used in
> 	either mode.
> 
> EXAMPLE
> 
> 	This example shows mpstat(1M) output using a standard date
> 	format time stamp:
> 
> # ./mpstat -T d 1
> Sat Jan 24 13:14:59 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0  201   0   77  2219  127   87    3    2   14    1   241    1   1   0  98
>   1  209   0   73   173   26   92    3    2   15    1   246    1   1   0  98
>   2  203   0  105   165   24   94    2    2   14    1   240    1   1   0  98
>   3  207   0   73   177   25   97    3    2   14    1   243    1   1   0  98
> Sat Jan 24 13:15:00 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0 18387   0 3246 10899  111  455  222   82  518   79 17262   71  29   0   0
>   1 24517   0 3635  8790    9  482  210   66  624   86 22727   63  37   0   0
>   2 20614   0 8964  7016   75  460  189   68  573   83 17889   61  39   0   0
>   3 23650   0 13319  5535   21  442  186   69  546   75 17211   64  36   0   0
> Sat Jan 24 13:15:01 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0 21763   0 4950 13096  130  491  187   89  521   46 15574   62  38   0   0
>   1 19702   0 12835  8601   48  478  219   86  482   76 16697   64  36   0   0
>   2 16842   0 11385  9045   62  396  195   69  418   62 14106   74  26   0   0
>   3 29149   0 8459 10058   18  538  216   85  665  103 24843   55  45   0   0
> Sat Jan 24 13:15:02 2009
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
>   0 27958   0 10245 21765  125  657  212  127  817  144 21165   46  52   0   3
>   1 26394   0 8131 20657   28  703  196  118  847  142 19734   45  52   0   3
>   2 26998   0 44518  8242  114  478  174  106  778  100 17544   38  61   0   1
>   3 16175   0 4904 20502   33  553  140  115  506   55 14710   54  38   0   8
> ^C# 
> 
> 
> 	This example shows vmstat(1M) output using a traditional Unix
> 	time stamp:
> 
> # ./vmstat -T u 1
>  kthr      memory            page            disk          faults      cpu
>  r b w   swap  free  re  mf pi po fr de sr f0 s0 s1 s2   in   sy   cs us sy id
> 1232820946
>  0 0 0 3666444 2642924 59 824 0 0  0  0  4  0  1  1 -1 2735  974  370  1  1 98
> 1232820947
>  5 0 0 2521192 1540320 5071 92284 0 0 0 0 0 0 22 20  0 54794 83465 1661 63 37 0
> 1232820948
>  4 0 0 2495436 1511176 5642 87339 0 0 0 0 0 0 28 28  0 39021 59198 1570 67 33 0
> 1232820949
>  3 0 0 2525936 1545120 5767 81687 0 0 0 0 0 0 20 20  0 31799 60757 1697 69 31 0
> ^C# 
> 
> 
> 	This example shows prstat(1M) output using a standard date
> 	format time stamp (with the -c option):
> 
> # amd64/prstat -c -d d -n 5 1
> Sat Jan 24 13:17:42 2009
>    PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
>   6920 mynhier  5760K 4664K sleep    0    4   0:00:00 0.5% dmake/1
>  13928 mynhier    25M   24M sleep    0    4   0:00:00 0.3% dmake/1
>   9229 mynhier    21M   17M cpu3     0    4   0:00:00 0.3% dmake/1
>   1504 noaccess  101M   76M sleep   59    0   0:43:09 0.0% java/18
>   9315 root     3772K 2568K cpu1    39    0   0:00:00 0.0% prstat/1
> Total: 95 processes, 256 lwps, load averages: 6.93, 4.99, 2.46
> Sat Jan 24 13:17:43 2009
>    PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
>   6920 mynhier  5840K 4748K sleep    0    4   0:00:00 0.5% dmake/1
>   9229 mynhier    22M   21M sleep   38    4   0:00:00 0.4% dmake/1
>   9528 mynhier    15M   12M run      0    4   0:00:00 0.4% acomp/1
>   9430 mynhier    10M 9628K sleep    0    4   0:00:00 0.4% dmake/1
>  13928 mynhier    25M   24M sleep   38    4   0:00:00 0.3% dmake/1
> Total: 114 processes, 274 lwps, load averages: 6.91, 4.99, 2.47
> # 
> 
> 	This example shows a screenshot of the above command without
> 	the -c option.  (There's little difference to be seen between
> 	the previous example and this one, but this one is included in
> 	order to explicitly show the placement of the time stamp in
> 	this mode.):
> 
> Sat Jan 24 13:20:25 2009
>    PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
>   4992 mynhier    29M   26M cpu2     0    4   0:00:00 1.1% ube/1
>    537 mynhier    13M   12M sleep   39    4   0:00:01 1.1% dmake/1
>   5045 mynhier    45M   41M run      0    4   0:00:00 0.4% ube/1
>   5145 mynhier    21M   12M run      0    4   0:00:00 0.1% iropt/1
>    386 mynhier    30M   29M sleep   47    4   0:00:00 0.1% dmake/1
> Total: 144 processes, 302 lwps, load averages: 6.76, 5.72, 3.17
> 
> 	This example shows iostat(1M) output using the French locale:
> 
> # ./iostat -T d 3
> lundi 26 janvier 2009 12 h 08 EST
>    tty        sd0           sd1           sd2            cpu
>  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id
>    0    8  43   1   24   43   1   22    0   0    0    1  1  0 98
> lundi 26 janvier 2009 12 h 08 EST
>    0   76   0   0    0    0   0    0    0   0    0    0  0  0 100
> ^C# 
> 
> DOCUMENTATION
> 
> 	This fast-track proposes adding the following text to the man
> 	pages for mpstat(1M), vmstat(1M), and prstat(1M), with the
> 	exception that the prstat(1M) shall be listed as "-d":
> 
> 	-T u | d
> 		Emit a time stamp.
> 
> 		Specify u for a printed representation of the internal
> 		representation  of  time.  See time(2).  Specify d for
> 		standard date format. See date(1).
> 
> 	Additionally, the option should be added to the SYNOPSIS
> 	section of the man pages for each of these.
> 
> 	(The iostat(1M) man page should be changed to read, "See
> 	date(1)."  rather than "See ctime(3C)." to reflect the
> 	localization change.)
> 
> REFERENCES
> 
> [1] would like a timestamp option like iostat has added to mpstat, vmstat
>     and prstat
>     (http://bugs.opensolaris.org/view_bug.do?bug_id=4775687)
> ---------------------------------------------------------------------------
> 
> -- 
> Daniel Price, Solaris Kernel Engineering    http://blogs.sun.com/dp

-- 
Daniel Price, Solaris Kernel Engineering    http://blogs.sun.com/dp

From carlsonj@phorcys.east.sun.com Thu Feb 26 11:51:09 2009
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 n1QJp9xw005539
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 26 Feb 2009 11:51:09 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1QJp1mn011582;
	Thu, 26 Feb 2009 12:51:08 -0700 (MST)
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 <0KFO00I0RV56BF00@nwk-avmta-2.sfbay.sun.com>; Thu,
 26 Feb 2009 11:51:06 -0800 (PST)
Received: from phorcys.east.sun.com ([129.148.174.143])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFO00F25V54MQ40@nwk-avmta-2.sfbay.sun.com>; Thu,
 26 Feb 2009 11:51:05 -0800 (PST)
Received: from phorcys.east.sun.com (localhost [127.0.0.1])
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n1QJp0t4014912; Thu,
 26 Feb 2009 14:51:00 -0500 (EST)
Received: (from carlsonj@localhost)
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3/Submit) id n1QJoxku014909; Thu,
 26 Feb 2009 14:50:59 -0500 (EST)
Date: Thu, 26 Feb 2009 14:50:59 -0500
From: James Carlson <james.d.carlson@sun.com>
Subject: Re: PSARC/2009/105 Time stamp option for xxstat commands
In-reply-to: <20090226194609.GL1495@eng.sun.com>
To: Dan Price <dp@eng.sun.com>
Cc: PSARC-ext@sun.com, Daniel.Price@sun.com
Message-id: <18854.62115.945237.399843@gargle.gargle.HOWL>
MIME-version: 1.0
X-Mailer: VM 7.01 under Emacs 21.3.1
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <20090215043537.GB14660@eng.sun.com>
 <20090226194609.GL1495@eng.sun.com>
Status: RO
Content-Length: 587

Dan Price writes:
> I have apologized to Chad, and I would appreciate it very much if the
> ARC would allow me to set the timer to tomorrow, Friday, Feb 27 2009, at
> close-of-business pacific time.  In this way we can avoid further delay.
> This case has thus far been non-controversial.

You've got your +1s already, and that sounds perfectly reasonable to
me.

-- 
James Carlson, Solaris Networking              <james.d.carlson@sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

From carlsonj@phorcys.east.sun.com Wed Mar 11 13:29:40 2009
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n2BKTeEs012991
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 11 Mar 2009 13:29:40 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n2BKTcGq012669;
	Wed, 11 Mar 2009 13:29:38 -0700 (PDT)
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 <0KGC00D45ZLDTD00@nwk-avmta-1.sfbay.Sun.COM>; Wed,
 11 Mar 2009 13:29:37 -0700 (PDT)
Received: from phorcys.east.sun.com ([129.148.174.143])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KGC000AYZLB3Y90@nwk-avmta-1.sfbay.Sun.COM>; Wed,
 11 Mar 2009 13:29:35 -0700 (PDT)
Received: from phorcys.east.sun.com (localhost [127.0.0.1])
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n2BKM2mO008723; Wed,
 11 Mar 2009 16:22:02 -0400 (EDT)
Received: (from carlsonj@localhost)
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3/Submit) id n2BKM2oM008720; Wed,
 11 Mar 2009 16:22:02 -0400 (EDT)
Date: Wed, 11 Mar 2009 16:22:02 -0400
From: James Carlson <james.d.carlson@sun.com>
Subject: Re: PSARC/2009/105 Time stamp option for xxstat commands
In-reply-to: <20090215043537.GB14660@eng.sun.com>
To: Dan Price <dp@eng.sun.com>
Cc: PSARC-ext@sun.com, cmynhier@gmail.com, daniel.price@sun.com,
        john.levon@sun.com
Message-id: <18872.7530.477216.355125@gargle.gargle.HOWL>
MIME-version: 1.0
X-Mailer: VM 7.01 under Emacs 21.3.1
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <20090215043537.GB14660@eng.sun.com>
Status: RO
Content-Length: 599

Dan Price writes:
> I'm pleased to sponsor the following fast-track for Chad Mynhier.
> Chad is enhancing some of the various "stat" commands to support
[...]

This fast-track request was approved last during ARC business in
Wednesday's meeting, though it had timed out long ago.

I'm marking it as approved now.

(Sponsors: please keep track of your sponsored fast-tracks.)

-- 
James Carlson, Solaris Networking              <james.d.carlson@sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

