Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jun 2014 07:06:43 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267898 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/sys
Message-ID:  <201406260706.s5Q76hYW014217@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Thu Jun 26 07:06:43 2014
New Revision: 267898
URL: http://svnweb.freebsd.org/changeset/base/267898

Log:
  Bring the following change from the illumos-joyent repository:
  
  commit 78e24ab6803bbe11ba37642624e1498ede5b239d
  Author: Bryan Cantrill <bryan@joyent.com>
  Date:   Thu Oct 31 01:20:54 2013
  
      OS-1688 DTrace count() with histogram
      OS-2360 DTrace full width distribution histograms
      OS-2361 DTrace frequency trails
  
  MFC after:	2 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out   (contents, props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,32 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option quiet
+#pragma D option encoding=utf8
+#pragma D option aggzoom
+
+tick-1ms
+/i++ < 320/
+{
+	@ = lquantize(i, 0, 640, 1, i);
+	@ = lquantize(641 - i, 0, 640, 1, i);
+}
+
+tick-1ms
+/i == 320/
+{
+	printa(@);
+	exit(0);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
==============================================================================
Binary file. No diff available.

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,46 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option agghist
+#pragma D option quiet
+
+BEGIN
+{
+	@["demerit"] = sum(-10);
+	@["wtf"] = sum(10);
+	@["bot"] = sum(20);
+
+	@bagnoogle["SOAP/XML"] = sum(1);
+	@bagnoogle["XACML store"] = sum(5);
+	@bagnoogle["SAML token"] = sum(6);
+
+	@stalloogle["breakfast"] = sum(-5);
+	@stalloogle["non-diet pepsi"] = sum(-20);
+	@stalloogle["parrot"] = sum(-100);
+
+	printa(@);
+	printa(@bagnoogle);
+	printa(@stalloogle);
+
+	printf("\nzoomed:");
+
+	setopt("aggzoom");
+	printa(@);
+	printa(@bagnoogle);
+	printa(@stalloogle);
+
+	exit(0);
+}
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,38 @@
+
+
+              key  ------------- Distribution ------------- count    
+          demerit                @@@@@|                     -10      
+              wtf                     |@@@@@                10       
+              bot                     |@@@@@@@@@@           20       
+
+
+              key  ------------- Distribution ------------- count    
+         SOAP/XML |@@@                                      1        
+      XACML store |@@@@@@@@@@@@@@@@@                        5        
+       SAML token |@@@@@@@@@@@@@@@@@@@@                     6        
+
+
+              key  ------------- Distribution ------------- count    
+           parrot         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100     
+   non-diet pepsi                                   @@@@@@| -20      
+        breakfast                                       @@| -5       
+
+zoomed:
+
+              key  ------------- Distribution ------------- count    
+          demerit           @@@@@@@@@@|                     -10      
+              wtf                     |@@@@@@@@@@           10       
+              bot                     |@@@@@@@@@@@@@@@@@@@  20       
+
+
+              key  ------------- Distribution ------------- count    
+         SOAP/XML |@@@@@@@                                  1        
+      XACML store |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@        5        
+       SAML token |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6        
+
+
+              key  ------------- Distribution ------------- count    
+           parrot   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100     
+   non-diet pepsi                                 @@@@@@@@| -20      
+        breakfast                                       @@| -5       
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,53 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option aggpack
+#pragma D option encoding=ascii
+#pragma D option quiet
+
+BEGIN
+{
+	@x = quantize(1 << 32);
+	@y[1] = quantize(1);
+	@z["mumble"] = quantize(1);
+	@xx["foo", (char)1, (short)2, (long)3] = quantize(1);
+
+	@neg = lquantize(-10, -10, 20, 1, -1);
+	@neg = lquantize(-5, -10, 20, 1, 1);
+	@neg = lquantize(0, -10, 20, 1, 1);
+
+	i = 0;
+}
+
+tick-1ms
+{
+	@a[i] = quantize(0, i);
+	@a[i] = quantize(1, 100 - i);
+	i++;
+}
+
+tick-1ms
+/i > 100/
+{
+	exit(0);
+}
+
+END
+{
+	setopt("aggzoom", "true");
+	printa(@neg);
+	setopt("aggzoom", "false");
+	printa(@neg);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,124 @@
+
+
+     min .--------------------------------. max      | count
+   < -10 : V    X    X                    : >= 20    | 1
+
+
+     min .--------------------------------. max      | count
+   < -10 : v    x    x                    : >= 20    | 1
+
+
+        min .---. max        | count
+ 2147483648 : X : 8589934592 | 1
+
+      key  min .---. max  | count
+        1    0 : X : 2    | 1
+
+              key  min .---. max  | count
+           mumble    0 : X : 2    | 1
+
+                                         key  min .---. max  | count
+              foo   1     2                3    0 : X : 2    | 1
+
+      key  min .---. max  | count
+      100    0 :X  : 2    | 100
+       99    0 :X_ : 2    | 100
+       98    0 :X_ : 2    | 100
+       97    0 :X_ : 2    | 100
+       96    0 :X_ : 2    | 100
+       95    0 :X_ : 2    | 100
+       94    0 :X_ : 2    | 100
+       93    0 :X_ : 2    | 100
+       92    0 :X_ : 2    | 100
+       91    0 :X_ : 2    | 100
+       90    0 :X_ : 2    | 100
+       89    0 :X_ : 2    | 100
+       88    0 :X_ : 2    | 100
+       87    0 :X_ : 2    | 100
+       86    0 :X_ : 2    | 100
+       85    0 :X_ : 2    | 100
+       84    0 :X_ : 2    | 100
+       83    0 :X_ : 2    | 100
+       82    0 :X_ : 2    | 100
+       81    0 :X_ : 2    | 100
+       80    0 :X_ : 2    | 100
+       79    0 :X_ : 2    | 100
+       78    0 :xx : 2    | 100
+       77    0 :xx : 2    | 100
+       76    0 :xx : 2    | 100
+       75    0 :xx : 2    | 100
+       74    0 :xx : 2    | 100
+       73    0 :xx : 2    | 100
+       72    0 :xx : 2    | 100
+       71    0 :xx : 2    | 100
+       70    0 :xx : 2    | 100
+       69    0 :xx : 2    | 100
+       68    0 :xx : 2    | 100
+       67    0 :xx : 2    | 100
+       66    0 :xx : 2    | 100
+       65    0 :xx : 2    | 100
+       64    0 :xx : 2    | 100
+       63    0 :xx : 2    | 100
+       62    0 :xx : 2    | 100
+       61    0 :xx : 2    | 100
+       60    0 :xx : 2    | 100
+       59    0 :xx : 2    | 100
+       58    0 :xx : 2    | 100
+       57    0 :xx : 2    | 100
+       56    0 :xx : 2    | 100
+       55    0 :xx : 2    | 100
+       54    0 :xx : 2    | 100
+       53    0 :xx : 2    | 100
+       52    0 :xx : 2    | 100
+       51    0 :xx : 2    | 100
+       50    0 :xx : 2    | 100
+       49    0 :xx : 2    | 100
+       48    0 :xx : 2    | 100
+       47    0 :xx : 2    | 100
+       46    0 :xx : 2    | 100
+       45    0 :xx : 2    | 100
+       44    0 :xx : 2    | 100
+       43    0 :xx : 2    | 100
+       42    0 :xx : 2    | 100
+       41    0 :xx : 2    | 100
+       40    0 :xx : 2    | 100
+       39    0 :xx : 2    | 100
+       38    0 :xx : 2    | 100
+       37    0 :xx : 2    | 100
+       36    0 :xx : 2    | 100
+       35    0 :xx : 2    | 100
+       34    0 :xx : 2    | 100
+       33    0 :xx : 2    | 100
+       32    0 :xx : 2    | 100
+       31    0 :xx : 2    | 100
+       30    0 :xx : 2    | 100
+       29    0 :xx : 2    | 100
+       28    0 :xx : 2    | 100
+       27    0 :xx : 2    | 100
+       26    0 :xx : 2    | 100
+       25    0 :xx : 2    | 100
+       24    0 :xx : 2    | 100
+       23    0 :xx : 2    | 100
+       22    0 :xx : 2    | 100
+       21    0 :_X : 2    | 100
+       20    0 :_X : 2    | 100
+       19    0 :_X : 2    | 100
+       18    0 :_X : 2    | 100
+       17    0 :_X : 2    | 100
+       16    0 :_X : 2    | 100
+       15    0 :_X : 2    | 100
+       14    0 :_X : 2    | 100
+       13    0 :_X : 2    | 100
+       12    0 :_X : 2    | 100
+       11    0 :_X : 2    | 100
+       10    0 :_X : 2    | 100
+        9    0 :_X : 2    | 100
+        8    0 :_X : 2    | 100
+        7    0 :_X : 2    | 100
+        6    0 :_X : 2    | 100
+        5    0 :_X : 2    | 100
+        4    0 :_X : 2    | 100
+        3    0 :_X : 2    | 100
+        2    0 :_X : 2    | 100
+        1    0 :_X : 2    | 100
+        0    0 : X : 2    | 100

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,75 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+#
+
+let width=8
+
+function outputchar
+{
+	banner $3 | awk -v line=$1 -v pos=$2 -v width=$width '{ \
+		for (i = 1; i <= length($0); i++) { \
+			if (substr($0, i, 1) == " ") \
+				continue; \
+			printf("\t@letter%d[%d] = lquantize(%d, 0, 40, 1);\n", \
+			    line, NR, i + (pos * width));
+		} \
+	}'
+}
+
+function outputstr
+{
+	let pos=0;
+	let line=0
+
+	printf "#pragma D option aggpack\n#pragma D option aggsortkey\n"
+
+	printf "BEGIN\n{\n"
+	for c in `echo "$1" | awk '{ \
+		for (i = 1; i <= length($0); i++) { \
+			c = substr($0, i, 1); \
+			printf("%s\n", c == " " ? "space" : \
+			    c == "\n" ? "newline" : c); \
+		} \
+	}'`; do
+		if [[ "$c" == "space" ]]; then
+			let line=line+1
+			let pos=0
+			continue
+		fi
+
+		outputchar $line $pos $c
+		let pos=pos+1
+	done
+
+	let i=0
+
+	while [[ $i -le $line ]]; do
+		printf "\tprinta(@letter%d);\n" $i
+		let i=i+1
+	done
+	printf "\texit(0);\n}\n"
+}
+
+dtrace -qs /dev/stdin -x encoding=utf8 <<EOF
+`outputstr "why must i do this"`
+EOF
+
+dtrace -qs /dev/stdin -x encoding=ascii -x aggzoom <<EOF
+`outputstr "i am not well"`
+EOF
+
+dtrace -qs /dev/stdin -x encoding=utf8 -x aggzoom <<EOF
+`outputstr "send help"`
+EOF
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,102 @@
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   ▂    ▂  ▂    ▂   ▂   ▂                 : >= 40    | 6
+        3     < 0 :   ▂    ▂  ▂    ▂    ▂ ▂                  : >= 40    | 6
+        4     < 0 :   ▂    ▂  ▂▂▂▂▂▂     ▂                   : >= 40    | 9
+        5     < 0 :   ▂ ▂▂ ▂  ▂    ▂     ▂                   : >= 40    | 7
+        6     < 0 :   ▂▂  ▂▂  ▂    ▂     ▂                   : >= 40    | 7
+        7     < 0 :   ▂    ▂  ▂    ▂     ▂                   : >= 40    | 5
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   ▂    ▂  ▂    ▂   ▂▂▂▂    ▂▂▂▂▂         : >= 40    | 13
+        3     < 0 :   ▂▂  ▂▂  ▂    ▂  ▂          ▂           : >= 40    | 8
+        4     < 0 :   ▂ ▂▂ ▂  ▂    ▂   ▂▂▂▂      ▂           : >= 40    | 11
+        5     < 0 :   ▂    ▂  ▂    ▂       ▂     ▂           : >= 40    | 6
+        6     < 0 :   ▂    ▂  ▂    ▂  ▂    ▂     ▂           : >= 40    | 7
+        7     < 0 :   ▂    ▂   ▂▂▂▂    ▂▂▂▂      ▂           : >= 40    | 11
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :      █                                   : >= 40    | 1
+        3     < 0 :      █                                   : >= 40    | 1
+        4     < 0 :      █                                   : >= 40    | 1
+        5     < 0 :      █                                   : >= 40    | 1
+        6     < 0 :      █                                   : >= 40    | 1
+        7     < 0 :      █                                   : >= 40    | 1
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   ▂▂▂▂▂    ▂▂▂▂                          : >= 40    | 9
+        3     < 0 :   ▃    ▃  ▃    ▃                         : >= 40    | 4
+        4     < 0 :   ▃    ▃  ▃    ▃                         : >= 40    | 4
+        5     < 0 :   ▃    ▃  ▃    ▃                         : >= 40    | 4
+        6     < 0 :   ▃    ▃  ▃    ▃                         : >= 40    | 4
+        7     < 0 :   ▂▂▂▂▂    ▂▂▂▂                          : >= 40    | 9
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :    ▂▂▂▂▂  ▂    ▂     ▂     ▂▂▂▂          : >= 40    | 12
+        3     < 0 :      ▂    ▂    ▂     ▂    ▂              : >= 40    | 5
+        4     < 0 :      ▂    ▂▂▂▂▂▂     ▂     ▂▂▂▂          : >= 40    | 12
+        5     < 0 :      ▂    ▂    ▂     ▂         ▂         : >= 40    | 5
+        6     < 0 :      ▂    ▂    ▂     ▂    ▂    ▂         : >= 40    | 6
+        7     < 0 :      ▂    ▂    ▂     ▂     ▂▂▂▂          : >= 40    | 8
+
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :      X                                   : >= 40    | 1
+        3     < 0 :      X                                   : >= 40    | 1
+        4     < 0 :      X                                   : >= 40    | 1
+        5     < 0 :      X                                   : >= 40    | 1
+        6     < 0 :      X                                   : >= 40    | 1
+        7     < 0 :      X                                   : >= 40    | 1
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :     XX    X    X                         : >= 40    | 4
+        3     < 0 :    X  X   XX  XX                         : >= 40    | 6
+        4     < 0 :   X    X  X XX X                         : >= 40    | 6
+        5     < 0 :   XXXXXX  X    X                         : >= 40    | 8
+        6     < 0 :   X    X  X    X                         : >= 40    | 4
+        7     < 0 :   X    X  X    X                         : >= 40    | 4
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   X    X   XXXX    XXXXX                 : >= 40    | 11
+        3     < 0 :   XX   X  X    X     X                   : >= 40    | 6
+        4     < 0 :   X X  X  X    X     X                   : >= 40    | 6
+        5     < 0 :   X  X X  X    X     X                   : >= 40    | 6
+        6     < 0 :   X   XX  X    X     X                   : >= 40    | 6
+        7     < 0 :   X    X   XXXX      X                   : >= 40    | 7
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   X    X  XXXXXX  X       X              : >= 40    | 10
+        3     < 0 :   X    X  X       X       X              : >= 40    | 5
+        4     < 0 :   X    X  XXXXX   X       X              : >= 40    | 9
+        5     < 0 :   X XX X  X       X       X              : >= 40    | 7
+        6     < 0 :   XX  XX  X       X       X              : >= 40    | 7
+        7     < 0 :   X    X  XXXXXX  XXXXXX  XXXXXX         : >= 40    | 20
+
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :    ████   ██████  █    █  █████          : >= 40    | 17
+        3     < 0 :   █       █       ██   █  █    █         : >= 40    | 7
+        4     < 0 :    ████   █████   █ █  █  █    █         : >= 40    | 14
+        5     < 0 :        █  █       █  █ █  █    █         : >= 40    | 7
+        6     < 0 :   █    █  █       █   ██  █    █         : >= 40    | 8
+        7     < 0 :    ████   ██████  █    █  █████          : >= 40    | 17
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   █    █  ██████  █       █████          : >= 40    | 14
+        3     < 0 :   █    █  █       █       █    █         : >= 40    | 6
+        4     < 0 :   ██████  █████   █       █    █         : >= 40    | 14
+        5     < 0 :   █    █  █       █       █████          : >= 40    | 9
+        6     < 0 :   █    █  █       █       █              : >= 40    | 5
+        7     < 0 :   █    █  ██████  ██████  █              : >= 40    | 15
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,42 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ < 30/
+{
+	@[1] = lquantize(i, 0, 40, 1, 1000);
+	@[2] = lquantize(i, 0, 40, 1, 1000);
+	@[3] = lquantize(i, 0, 40, 1, 1000);
+}
+
+tick-1ms
+/i == 40/
+{
+	@[1] = lquantize(0, 0, 40, 1, 1);
+	@[1] = lquantize(i, 0, 40, 1, 2000);
+	@[2] = lquantize(0, 0, 40, 1, 1);
+	@[2] = lquantize(i, 0, 40, 1, 2000);
+	@[3] = lquantize(0, 0, 40, 1, 1);
+	@[3] = lquantize(i, 0, 40, 1, 2000);
+
+	printa(@);
+	setopt("aggpack");
+	printa(@);
+	setopt("aggzoom");
+	printa(@);
+	exit(0);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,149 @@
+
+        1
+           value  ------------- Distribution ------------- count    
+             < 0 |                                         0        
+               0 |                                         1        
+               1 |@                                        1000     
+               2 |@                                        1000     
+               3 |@                                        1000     
+               4 |@                                        1000     
+               5 |@                                        1000     
+               6 |@                                        1000     
+               7 |@                                        1000     
+               8 |@                                        1000     
+               9 |@                                        1000     
+              10 |@                                        1000     
+              11 |@                                        1000     
+              12 |@                                        1000     
+              13 |@                                        1000     
+              14 |@                                        1000     
+              15 |@                                        1000     
+              16 |@                                        1000     
+              17 |@                                        1000     
+              18 |@                                        1000     
+              19 |@                                        1000     
+              20 |@                                        1000     
+              21 |@                                        1000     
+              22 |@                                        1000     
+              23 |@                                        1000     
+              24 |@                                        1000     
+              25 |@                                        1000     
+              26 |@                                        1000     
+              27 |@                                        1000     
+              28 |@                                        1000     
+              29 |@                                        1000     
+              30 |@                                        1000     
+              31 |                                         0        
+              32 |                                         0        
+              33 |                                         0        
+              34 |                                         0        
+              35 |                                         0        
+              36 |                                         0        
+              37 |                                         0        
+              38 |                                         0        
+              39 |                                         0        
+           >= 40 |@@                                       2000     
+
+        2
+           value  ------------- Distribution ------------- count    
+             < 0 |                                         0        
+               0 |                                         1        
+               1 |@                                        1000     
+               2 |@                                        1000     
+               3 |@                                        1000     
+               4 |@                                        1000     
+               5 |@                                        1000     
+               6 |@                                        1000     
+               7 |@                                        1000     
+               8 |@                                        1000     
+               9 |@                                        1000     
+              10 |@                                        1000     
+              11 |@                                        1000     
+              12 |@                                        1000     
+              13 |@                                        1000     
+              14 |@                                        1000     
+              15 |@                                        1000     
+              16 |@                                        1000     
+              17 |@                                        1000     
+              18 |@                                        1000     
+              19 |@                                        1000     
+              20 |@                                        1000     
+              21 |@                                        1000     
+              22 |@                                        1000     
+              23 |@                                        1000     
+              24 |@                                        1000     
+              25 |@                                        1000     
+              26 |@                                        1000     
+              27 |@                                        1000     
+              28 |@                                        1000     
+              29 |@                                        1000     
+              30 |@                                        1000     
+              31 |                                         0        
+              32 |                                         0        
+              33 |                                         0        
+              34 |                                         0        
+              35 |                                         0        
+              36 |                                         0        
+              37 |                                         0        
+              38 |                                         0        
+              39 |                                         0        
+           >= 40 |@@                                       2000     
+
+        3
+           value  ------------- Distribution ------------- count    
+             < 0 |                                         0        
+               0 |                                         1        
+               1 |@                                        1000     
+               2 |@                                        1000     
+               3 |@                                        1000     
+               4 |@                                        1000     
+               5 |@                                        1000     
+               6 |@                                        1000     
+               7 |@                                        1000     
+               8 |@                                        1000     
+               9 |@                                        1000     
+              10 |@                                        1000     
+              11 |@                                        1000     
+              12 |@                                        1000     
+              13 |@                                        1000     
+              14 |@                                        1000     
+              15 |@                                        1000     
+              16 |@                                        1000     
+              17 |@                                        1000     
+              18 |@                                        1000     
+              19 |@                                        1000     
+              20 |@                                        1000     
+              21 |@                                        1000     
+              22 |@                                        1000     
+              23 |@                                        1000     
+              24 |@                                        1000     
+              25 |@                                        1000     
+              26 |@                                        1000     
+              27 |@                                        1000     
+              28 |@                                        1000     
+              29 |@                                        1000     
+              30 |@                                        1000     
+              31 |                                         0        
+              32 |                                         0        
+              33 |                                         0        
+              34 |                                         0        
+              35 |                                         0        
+              36 |                                         0        
+              37 |                                         0        
+              38 |                                         0        
+              39 |                                         0        
+           >= 40 |@@                                       2000     
+
+
+
+      key     min .------------------------------------------. max      | count
+        1     < 0 : ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁         ▁: >= 40    | 32001
+        2     < 0 : ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁         ▁: >= 40    | 32001
+        3     < 0 : ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁         ▁: >= 40    | 32001
+
+
+      key     min .------------------------------------------. max      | count
+        1     < 0 : ▁▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄         █: >= 40    | 32001
+        2     < 0 : ▁▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄         █: >= 40    | 32001
+        3     < 0 : ▁▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄         █: >= 40    | 32001
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,34 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ < 90/
+{
+	@ = lquantize(i, 0, 100, 1, 1000);
+}
+
+tick-1ms
+/i == 100/
+{
+	@ = lquantize(i++, 0, 100, 1, 2000);
+	@ = lquantize(i++, 0, 100, 1, 3000);
+
+	printa(@);
+	setopt("aggzoom");
+	printa(@);
+	exit(0);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,211 @@
+
+
+           value  ------------- Distribution ------------- count    
+               0 |                                         0        
+               1 |                                         1000     
+               2 |                                         1000     
+               3 |                                         1000     
+               4 |                                         1000     
+               5 |                                         1000     
+               6 |                                         1000     
+               7 |                                         1000     
+               8 |                                         1000     
+               9 |                                         1000     
+              10 |                                         1000     
+              11 |                                         1000     
+              12 |                                         1000     
+              13 |                                         1000     
+              14 |                                         1000     
+              15 |                                         1000     
+              16 |                                         1000     
+              17 |                                         1000     
+              18 |                                         1000     
+              19 |                                         1000     
+              20 |                                         1000     
+              21 |                                         1000     
+              22 |                                         1000     
+              23 |                                         1000     
+              24 |                                         1000     
+              25 |                                         1000     
+              26 |                                         1000     
+              27 |                                         1000     
+              28 |                                         1000     
+              29 |                                         1000     
+              30 |                                         1000     
+              31 |                                         1000     
+              32 |                                         1000     
+              33 |                                         1000     
+              34 |                                         1000     
+              35 |                                         1000     
+              36 |                                         1000     
+              37 |                                         1000     
+              38 |                                         1000     
+              39 |                                         1000     
+              40 |                                         1000     
+              41 |                                         1000     
+              42 |                                         1000     
+              43 |                                         1000     
+              44 |                                         1000     
+              45 |                                         1000     
+              46 |                                         1000     
+              47 |                                         1000     
+              48 |                                         1000     
+              49 |                                         1000     
+              50 |                                         1000     
+              51 |                                         1000     
+              52 |                                         1000     
+              53 |                                         1000     
+              54 |                                         1000     
+              55 |                                         1000     
+              56 |                                         1000     
+              57 |                                         1000     
+              58 |                                         1000     
+              59 |                                         1000     
+              60 |                                         1000     
+              61 |                                         1000     
+              62 |                                         1000     
+              63 |                                         1000     
+              64 |                                         1000     
+              65 |                                         1000     
+              66 |                                         1000     
+              67 |                                         1000     
+              68 |                                         1000     
+              69 |                                         1000     
+              70 |                                         1000     
+              71 |                                         1000     
+              72 |                                         1000     
+              73 |                                         1000     
+              74 |                                         1000     
+              75 |                                         1000     
+              76 |                                         1000     
+              77 |                                         1000     
+              78 |                                         1000     
+              79 |                                         1000     
+              80 |                                         1000     
+              81 |                                         1000     
+              82 |                                         1000     
+              83 |                                         1000     
+              84 |                                         1000     
+              85 |                                         1000     
+              86 |                                         1000     
+              87 |                                         1000     
+              88 |                                         1000     
+              89 |                                         1000     
+              90 |                                         1000     
+              91 |                                         0        
+              92 |                                         0        
+              93 |                                         0        
+              94 |                                         0        
+              95 |                                         0        
+              96 |                                         0        
+              97 |                                         0        
+              98 |                                         0        
+              99 |                                         0        
+          >= 100 |@@                                       5000     
+
+
+
+           value  ------------- Distribution ------------- count    
+               0 |                                         0        
+               1 |@@@@@@@@                                 1000     
+               2 |@@@@@@@@                                 1000     
+               3 |@@@@@@@@                                 1000     
+               4 |@@@@@@@@                                 1000     
+               5 |@@@@@@@@                                 1000     
+               6 |@@@@@@@@                                 1000     
+               7 |@@@@@@@@                                 1000     
+               8 |@@@@@@@@                                 1000     
+               9 |@@@@@@@@                                 1000     
+              10 |@@@@@@@@                                 1000     
+              11 |@@@@@@@@                                 1000     
+              12 |@@@@@@@@                                 1000     
+              13 |@@@@@@@@                                 1000     
+              14 |@@@@@@@@                                 1000     
+              15 |@@@@@@@@                                 1000     
+              16 |@@@@@@@@                                 1000     
+              17 |@@@@@@@@                                 1000     
+              18 |@@@@@@@@                                 1000     
+              19 |@@@@@@@@                                 1000     
+              20 |@@@@@@@@                                 1000     
+              21 |@@@@@@@@                                 1000     
+              22 |@@@@@@@@                                 1000     
+              23 |@@@@@@@@                                 1000     
+              24 |@@@@@@@@                                 1000     
+              25 |@@@@@@@@                                 1000     
+              26 |@@@@@@@@                                 1000     
+              27 |@@@@@@@@                                 1000     
+              28 |@@@@@@@@                                 1000     
+              29 |@@@@@@@@                                 1000     
+              30 |@@@@@@@@                                 1000     
+              31 |@@@@@@@@                                 1000     
+              32 |@@@@@@@@                                 1000     
+              33 |@@@@@@@@                                 1000     
+              34 |@@@@@@@@                                 1000     
+              35 |@@@@@@@@                                 1000     
+              36 |@@@@@@@@                                 1000     
+              37 |@@@@@@@@                                 1000     
+              38 |@@@@@@@@                                 1000     
+              39 |@@@@@@@@                                 1000     
+              40 |@@@@@@@@                                 1000     
+              41 |@@@@@@@@                                 1000     
+              42 |@@@@@@@@                                 1000     
+              43 |@@@@@@@@                                 1000     
+              44 |@@@@@@@@                                 1000     
+              45 |@@@@@@@@                                 1000     
+              46 |@@@@@@@@                                 1000     
+              47 |@@@@@@@@                                 1000     
+              48 |@@@@@@@@                                 1000     
+              49 |@@@@@@@@                                 1000     
+              50 |@@@@@@@@                                 1000     
+              51 |@@@@@@@@                                 1000     
+              52 |@@@@@@@@                                 1000     
+              53 |@@@@@@@@                                 1000     
+              54 |@@@@@@@@                                 1000     
+              55 |@@@@@@@@                                 1000     
+              56 |@@@@@@@@                                 1000     
+              57 |@@@@@@@@                                 1000     
+              58 |@@@@@@@@                                 1000     
+              59 |@@@@@@@@                                 1000     
+              60 |@@@@@@@@                                 1000     
+              61 |@@@@@@@@                                 1000     
+              62 |@@@@@@@@                                 1000     
+              63 |@@@@@@@@                                 1000     
+              64 |@@@@@@@@                                 1000     
+              65 |@@@@@@@@                                 1000     
+              66 |@@@@@@@@                                 1000     
+              67 |@@@@@@@@                                 1000     
+              68 |@@@@@@@@                                 1000     
+              69 |@@@@@@@@                                 1000     
+              70 |@@@@@@@@                                 1000     
+              71 |@@@@@@@@                                 1000     
+              72 |@@@@@@@@                                 1000     
+              73 |@@@@@@@@                                 1000     
+              74 |@@@@@@@@                                 1000     
+              75 |@@@@@@@@                                 1000     
+              76 |@@@@@@@@                                 1000     
+              77 |@@@@@@@@                                 1000     
+              78 |@@@@@@@@                                 1000     
+              79 |@@@@@@@@                                 1000     
+              80 |@@@@@@@@                                 1000     
+              81 |@@@@@@@@                                 1000     
+              82 |@@@@@@@@                                 1000     
+              83 |@@@@@@@@                                 1000     
+              84 |@@@@@@@@                                 1000     
+              85 |@@@@@@@@                                 1000     
+              86 |@@@@@@@@                                 1000     
+              87 |@@@@@@@@                                 1000     
+              88 |@@@@@@@@                                 1000     
+              89 |@@@@@@@@                                 1000     
+              90 |@@@@@@@@                                 1000     
+              91 |                                         0        
+              92 |                                         0        
+              93 |                                         0        
+              94 |                                         0        
+              95 |                                         0        
+              96 |                                         0        
+              97 |                                         0        
+              98 |                                         0        
+              99 |                                         0        
+          >= 100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   5000     
+
+

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Thu Jun 26 06:03:39 2014	(r267897)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Thu Jun 26 07:06:43 2014	(r267898)
@@ -25,7 +25,7 @@
  */
 
 /*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
@@ -1301,6 +1301,231 @@ dtrace_aggregate_walk(dtrace_hdl_t *dtp,
 }
 
 static int
+dt_aggregate_total(dtrace_hdl_t *dtp, boolean_t clear)
+{
+	dt_ahashent_t *h;
+	dtrace_aggdata_t **total;
+	dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id;
+	dt_aggregate_t *agp = &dtp->dt_aggregate;
+	dt_ahash_t *hash = &agp->dtat_hash;
+	uint32_t tflags;
+
+	tflags = DTRACE_A_TOTAL | DTRACE_A_HASNEGATIVES | DTRACE_A_HASPOSITIVES;
+
+	/*
+	 * If we need to deliver per-aggregation totals, we're going to take
+	 * three passes over the aggregate:  one to clear everything out and
+	 * determine our maximum aggregation ID, one to actually total
+	 * everything up, and a final pass to assign the totals to the
+	 * individual elements.
+	 */
+	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+		dtrace_aggdata_t *aggdata = &h->dtahe_data;
+
+		if ((id = dt_aggregate_aggvarid(h)) > max)
+			max = id;
+
+		aggdata->dtada_total = 0;
+		aggdata->dtada_flags &= ~tflags;
+	}
+
+	if (clear || max == DTRACE_AGGVARIDNONE)
+		return (0);
+
+	total = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *));
+
+	if (total == NULL)
+		return (-1);
+
+	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+		dtrace_aggdata_t *aggdata = &h->dtahe_data;
+		dtrace_aggdesc_t *agg = aggdata->dtada_desc;
+		dtrace_recdesc_t *rec;
+		caddr_t data;
+		int64_t val, *addr;
+
+		rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1];
+		data = aggdata->dtada_data;
+		addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406260706.s5Q76hYW014217>