From cfea4862aa9adab7aafc28b0ee56bfe6ce823d40 Mon Sep 17 00:00:00 2001 From: mav Date: Sat, 10 May 2014 15:21:37 +0000 Subject: Comment out some pointless device open/close around reading device IDs. FreeBSD ZFS port unlike OpenSolaris does not use device IDs, and does not implement respective devid_*() fuctions. It is pointless to open devices just to close them back immediately. MFC after: 2 weeks Sponsored by: iXsystems, Inc. --- cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c | 2 ++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c | 4 ++++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c | 4 ++++ 3 files changed, 10 insertions(+) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c index 5ffd39a..374798b 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c @@ -512,6 +512,7 @@ make_leaf_vdev(const char *arg, uint64_t is_log) verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, (uint64_t)wholedisk) == 0); +#ifdef have_devid /* * For a whole disk, defer getting its devid until after labeling it. */ @@ -546,6 +547,7 @@ make_leaf_vdev(const char *arg, uint64_t is_log) (void) close(fd); } +#endif return (vdev); } diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c index e53a8cd..868961d 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c @@ -94,6 +94,7 @@ typedef struct pool_list { static char * get_devid(const char *path) { +#ifdef have_devid int fd; ddi_devid_t devid; char *minor, *ret; @@ -113,6 +114,9 @@ get_devid(const char *path) (void) close(fd); return (ret); +#else + return (NULL); +#endif } diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index 8dd24a7..02f0b96 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -3324,6 +3324,7 @@ devid_to_path(char *devid_str) static char * path_to_devid(const char *path) { +#ifdef have_devid int fd; ddi_devid_t devid; char *minor, *ret; @@ -3343,6 +3344,9 @@ path_to_devid(const char *path) (void) close(fd); return (ret); +#else + return (NULL); +#endif } /* -- cgit v1.1 From 79fc9c4be007da0eca3aa6c8e4d331b260bb21d7 Mon Sep 17 00:00:00 2001 From: markj Date: Wed, 14 May 2014 19:02:00 +0000 Subject: Bind ip/tcp/udp provider translators and symbols to the same versions as in illumos, rather than using "1.0" everywhere. Some of the translators use D functions that are not present in version 1.0 (e.g. inet_ntoa()) which can result in libdtrace crashing when running scripts that restrict themselves to version 1.0 (e.g. with "-x version=1.0"). MFC after: 1 week --- cddl/lib/libdtrace/ip.d | 60 ++++++++++++++++++++++++------------------------ cddl/lib/libdtrace/tcp.d | 50 ++++++++++++++++++++-------------------- cddl/lib/libdtrace/udp.d | 4 ++-- 3 files changed, 57 insertions(+), 57 deletions(-) (limited to 'cddl') diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d index b886a0a..a1a2996 100644 --- a/cddl/lib/libdtrace/ip.d +++ b/cddl/lib/libdtrace/ip.d @@ -125,53 +125,53 @@ typedef struct ipv6info { ip6_t *ipv6_hdr; /* pointer to raw header */ } ipv6info_t; -#pragma D binding "1.0" IPPROTO_IP +#pragma D binding "1.5" IPPROTO_IP inline short IPPROTO_IP = 0; -#pragma D binding "1.0" IPPROTO_ICMP +#pragma D binding "1.5" IPPROTO_ICMP inline short IPPROTO_ICMP = 1; -#pragma D binding "1.0" IPPROTO_IGMP +#pragma D binding "1.5" IPPROTO_IGMP inline short IPPROTO_IGMP = 2; -#pragma D binding "1.0" IPPROTO_IPV4 +#pragma D binding "1.5" IPPROTO_IPV4 inline short IPPROTO_IPV4 = 4; -#pragma D binding "1.0" IPPROTO_TCP +#pragma D binding "1.5" IPPROTO_TCP inline short IPPROTO_TCP = 6; -#pragma D binding "1.0" IPPROTO_UDP +#pragma D binding "1.5" IPPROTO_UDP inline short IPPROTO_UDP = 17; -#pragma D binding "1.0" IPPROTO_IPV6 +#pragma D binding "1.5" IPPROTO_IPV6 inline short IPPROTO_IPV6 = 41; -#pragma D binding "1.0" IPPROTO_ROUTING +#pragma D binding "1.5" IPPROTO_ROUTING inline short IPPROTO_ROUTING = 43; -#pragma D binding "1.0" IPPROTO_FRAGMENT +#pragma D binding "1.5" IPPROTO_FRAGMENT inline short IPPROTO_FRAGMENT = 44; -#pragma D binding "1.0" IPPROTO_RSVP +#pragma D binding "1.5" IPPROTO_RSVP inline short IPPROTO_RSVP = 46; -#pragma D binding "1.0" IPPROTO_GRE +#pragma D binding "1.5" IPPROTO_GRE inline short IPPROTO_GRE = 47; -#pragma D binding "1.0" IPPROTO_ESP +#pragma D binding "1.5" IPPROTO_ESP inline short IPPROTO_ESP = 50; -#pragma D binding "1.0" IPPROTO_AH +#pragma D binding "1.5" IPPROTO_AH inline short IPPROTO_AH = 51; -#pragma D binding "1.0" IPPROTO_MOBILE +#pragma D binding "1.5" IPPROTO_MOBILE inline short IPPROTO_MOBILE = 55; -#pragma D binding "1.0" IPPROTO_ICMPV6 +#pragma D binding "1.5" IPPROTO_ICMPV6 inline short IPPROTO_ICMPV6 = 58; -#pragma D binding "1.0" IPPROTO_DSTOPTS +#pragma D binding "1.5" IPPROTO_DSTOPTS inline short IPPROTO_DSTOPTS = 60; -#pragma D binding "1.0" IPPROTO_ETHERIP +#pragma D binding "1.5" IPPROTO_ETHERIP inline short IPPROTO_ETHERIP = 97; -#pragma D binding "1.0" IPPROTO_PIM +#pragma D binding "1.5" IPPROTO_PIM inline short IPPROTO_PIM = 103; -#pragma D binding "1.0" IPPROTO_IPCOMP +#pragma D binding "1.5" IPPROTO_IPCOMP inline short IPPROTO_IPCOMP = 108; -#pragma D binding "1.0" IPPROTO_SCTP +#pragma D binding "1.5" IPPROTO_SCTP inline short IPPROTO_SCTP = 132; -#pragma D binding "1.0" IPPROTO_RAW +#pragma D binding "1.5" IPPROTO_RAW inline short IPPROTO_RAW = 255; inline uint8_t INP_IPV4 = 0x01; inline uint8_t INP_IPV6 = 0x02; -#pragma D binding "1.0" protocols +#pragma D binding "1.5" protocols inline string protocols[int proto] = proto == IPPROTO_IP ? "IP" : proto == IPPROTO_ICMP ? "ICMP" : @@ -200,12 +200,12 @@ inline string protocols[int proto] = * This field is always NULL according to the current definition of the ip * probes. */ -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator pktinfo_t < void *p > { pkt_addr = NULL; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator csinfo_t < void *p > { cs_addr = NULL; cs_cid = (uint64_t)p; @@ -213,7 +213,7 @@ translator csinfo_t < void *p > { cs_zoneid = 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator csinfo_t < struct inpcb *p > { cs_addr = NULL; cs_cid = (uint64_t)p; @@ -221,7 +221,7 @@ translator csinfo_t < struct inpcb *p > { cs_zoneid = 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ipinfo_t < uint8_t *p > { ip_ver = p == NULL ? 0 : ((struct ip *)p)->ip_v; ip_plength = p == NULL ? 0 : @@ -238,17 +238,17 @@ translator ipinfo_t < uint8_t *p > { inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst); }; -#pragma D binding "1.0" IFF_LOOPBACK +#pragma D binding "1.5" IFF_LOOPBACK inline int IFF_LOOPBACK = 0x8; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ifinfo_t < struct ifnet *p > { if_name = p->if_xname; if_local = (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1; if_addr = (uintptr_t)p; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ipv4info_t < struct ip *p > { ipv4_ver = p == NULL ? 0 : p->ip_v; ipv4_ihl = p == NULL ? 0 : p->ip_hl; @@ -268,7 +268,7 @@ translator ipv4info_t < struct ip *p > { ipv4_hdr = (ipha_t *)p; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ipv6info_t < struct ip6_hdr *p > { ipv6_ver = p == NULL ? 0 : (ntohl(p->ip6_ctlun.ip6_un1.ip6_un1_flow) & 0xf0000000) >> 28; ipv6_tclass = p == NULL ? 0 : (ntohl(p->ip6_ctlun.ip6_un1.ip6_un1_flow) & 0x0ff00000) >> 20; diff --git a/cddl/lib/libdtrace/tcp.d b/cddl/lib/libdtrace/tcp.d index 4204507..7695e22 100644 --- a/cddl/lib/libdtrace/tcp.d +++ b/cddl/lib/libdtrace/tcp.d @@ -31,49 +31,49 @@ /* * Convert a TCP state value to a string. */ -#pragma D binding "1.0" TCPS_CLOSED +#pragma D binding "1.6.3" TCPS_CLOSED inline int TCPS_CLOSED = 0; -#pragma D binding "1.0" TCPS_LISTEN +#pragma D binding "1.6.3" TCPS_LISTEN inline int TCPS_LISTEN = 1; -#pragma D binding "1.0" TCPS_SYN_SENT +#pragma D binding "1.6.3" TCPS_SYN_SENT inline int TCPS_SYN_SENT = 2; -#pragma D binding "1.0" TCPS_SYN_RECEIVED +#pragma D binding "1.6.3" TCPS_SYN_RECEIVED inline int TCPS_SYN_RECEIVED = 3; -#pragma D binding "1.0" TCPS_ESTABLISHED +#pragma D binding "1.6.3" TCPS_ESTABLISHED inline int TCPS_ESTABLISHED = 4; -#pragma D binding "1.0" TCPS_CLOSE_WAIT +#pragma D binding "1.6.3" TCPS_CLOSE_WAIT inline int TCPS_CLOSE_WAIT = 5; -#pragma D binding "1.0" TCPS_FIN_WAIT_1 +#pragma D binding "1.6.3" TCPS_FIN_WAIT_1 inline int TCPS_FIN_WAIT_1 = 6; -#pragma D binding "1.0" TCPS_CLOSING +#pragma D binding "1.6.3" TCPS_CLOSING inline int TCPS_CLOSING = 7; -#pragma D binding "1.0" TCPS_LAST_ACK +#pragma D binding "1.6.3" TCPS_LAST_ACK inline int TCPS_LAST_ACK = 8; -#pragma D binding "1.0" TCPS_FIN_WAIT_2 +#pragma D binding "1.6.3" TCPS_FIN_WAIT_2 inline int TCPS_FIN_WAIT_2 = 9; -#pragma D binding "1.0" TCPS_TIME_WAIT +#pragma D binding "1.6.3" TCPS_TIME_WAIT inline int TCPS_TIME_WAIT = 10; /* TCP segment flags. */ -#pragma D binding "1.0" TH_FIN +#pragma D binding "1.6.3" TH_FIN inline uint8_t TH_FIN = 0x01; -#pragma D binding "1.0" TH_SYN +#pragma D binding "1.6.3" TH_SYN inline uint8_t TH_SYN = 0x02; -#pragma D binding "1.0" TH_RST +#pragma D binding "1.6.3" TH_RST inline uint8_t TH_RST = 0x04; -#pragma D binding "1.0" TH_PUSH +#pragma D binding "1.6.3" TH_PUSH inline uint8_t TH_PUSH = 0x08; -#pragma D binding "1.0" TH_ACK +#pragma D binding "1.6.3" TH_ACK inline uint8_t TH_ACK = 0x10; -#pragma D binding "1.0" TH_URG +#pragma D binding "1.6.3" TH_URG inline uint8_t TH_URG = 0x20; -#pragma D binding "1.0" TH_ECE +#pragma D binding "1.6.3" TH_ECE inline uint8_t TH_ECE = 0x40; -#pragma D binding "1.0" TH_CWR +#pragma D binding "1.6.3" TH_CWR inline uint8_t TH_CWR = 0x80; /* TCP connection state strings. */ -#pragma D binding "1.0" tcp_state_string +#pragma D binding "1.6.3" tcp_state_string inline string tcp_state_string[int32_t state] = state == TCPS_CLOSED ? "state-closed" : state == TCPS_LISTEN ? "state-listen" : @@ -160,7 +160,7 @@ typedef struct tcpinfoh { struct tcphdr *tcp_hdr; /* raw TCP header */ } tcpinfoh_t; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator csinfo_t < struct tcpcb *p > { cs_addr = NULL; cs_cid = (uint64_t)(p == NULL ? 0 : p->t_inpcb); @@ -168,7 +168,7 @@ translator csinfo_t < struct tcpcb *p > { cs_zoneid = 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcpsinfo_t < struct tcpcb *p > { tcps_addr = (uintptr_t)p; tcps_local = -1; /* XXX */ @@ -202,7 +202,7 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcpinfo_t < struct tcphdr *p > { tcp_sport = p == NULL ? 0 : ntohs(p->th_sport); tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); @@ -221,7 +221,7 @@ translator tcpinfo_t < struct tcphdr *p > { * number, acknowledgement number, window size and urgent pointer are already * in host order and thus don't need to be converted. */ -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcpinfoh_t < struct tcphdr *p > { tcp_sport = p == NULL ? 0 : ntohs(p->th_sport); tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); @@ -235,7 +235,7 @@ translator tcpinfoh_t < struct tcphdr *p > { tcp_hdr = (struct tcphdr *)p; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcplsinfo_t < int s > { tcps_state = s; }; diff --git a/cddl/lib/libdtrace/udp.d b/cddl/lib/libdtrace/udp.d index 5ad625d..21538eb 100644 --- a/cddl/lib/libdtrace/udp.d +++ b/cddl/lib/libdtrace/udp.d @@ -50,7 +50,7 @@ typedef struct udpinfo { struct udphdr *udp_hdr; /* raw UDP header */ } udpinfo_t; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator udpsinfo_t < struct inpcb *p > { udps_addr = (uintptr_t)p; udps_lport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_lport); @@ -65,7 +65,7 @@ translator udpsinfo_t < struct inpcb *p > { inet_ntoa6(&p->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator udpinfo_t < struct udphdr *p > { udp_sport = p == NULL ? 0 : ntohs(p->uh_sport); udp_dport = p == NULL ? 0 : ntohs(p->uh_dport); -- cgit v1.1 From 5433f26d40742b9e0f7dd3dc6c8d43cd4a5d38bf Mon Sep 17 00:00:00 2001 From: markj Date: Mon, 19 May 2014 20:11:55 +0000 Subject: Fix tst.ZeroModuleProbes.d.ksh, which was incorrectly modified in r178534. Since "BEGIN" is not the name of a module, the test would just hang. MFC after: 3 days --- .../cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh index c34a4aa..dbea8ef 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh @@ -46,7 +46,7 @@ fi dtrace=$1 $dtrace -qZm wassup'{printf("Iamkool");}' \ --qm BEGIN'{printf("I am done"); exit(0);}' +-qm kernel'{printf("I am done"); exit(0);}' status=$? -- cgit v1.1 From 9e29b5f65069140228be54ba30dab6ace4548361 Mon Sep 17 00:00:00 2001 From: delphij Date: Thu, 22 May 2014 00:01:31 +0000 Subject: Explicitly link libzfs against libavl as it is done in OpenSolaris (4543:12bb2876a62e). Without this, some third party applications may break because the lack of AVL related symbols. FreeBSD base system are not affected because the FreeBSD ZFS command line tools were all linked against libavl and thus hide the underlying issue. PR: java/183081 Tested by: jkim MFC after: 3 days --- cddl/lib/libzfs/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cddl') diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile index 16660ac..4010ac1 100644 --- a/cddl/lib/libzfs/Makefile +++ b/cddl/lib/libzfs/Makefile @@ -7,8 +7,8 @@ LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ - ${LIBZFS_CORE} -LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lzfs_core + ${LIBAVL} ${LIBZFS_CORE} +LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core SRCS= deviceid.c \ fsshare.c \ -- cgit v1.1 From 78ba1760897362f983b51d564ae721e7355af226 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 27 May 2014 19:46:11 +0000 Subject: MFV r266766: Add a new zfs property, "redundant_metadata" which can have values "all" or "most". The default will be "all", which is the current behavior. When set to all, ZFS stores an extra copy of all metadata. If a single on-disk block is corrupt, at worst a single block of user data (which is recordsize bytes long) can be lost. Setting to "most" will cause us to only store 1 copy of level-1 indirect blocks of user data files. This can improve performance of random writes, because less metadata has to be written. In practice, at worst about 100 blocks (of recordsize bytes each) of user data can be lost if a single on-disk block is corrupt. The exact behavior of which metadata blocks are stored redundantly may change in future releases. Illumos issue: 3835 zfs need not store 2 copies of all metadata MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zfs/zfs.8 | 51 ++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 b/cddl/contrib/opensolaris/cmd/zfs/zfs.8 index 9eb3082..a28abf0 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs.8 @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2013 by Delphix. All rights reserved. +.\" Copyright (c) 2014 by Delphix. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2012, Bryan Drewery @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2014 +.Dd May 27, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1193,6 +1193,53 @@ affects only files created afterward; existing files are unaffected. .Pp This property can also be referred to by its shortened column name, .Sy recsize . +.It Sy redundant_metadata Ns = Ns Cm all | most +Controls what types of metadata are stored redundantly. +ZFS stores an extra copy of metadata, so that if a single block is corrupted, +the amount of user data lost is limited. +This extra copy is in addition to any redundancy provided at the pool level +.Pq e.g. by mirroring or RAID-Z , +and is in addition to an extra copy specified by the +.Sy copies +property +.Pq up to a total of 3 copies . +For example if the pool is mirrored, +.Cm copies Ns = Ns Ar 2 , +and +.Cm redundant_metadata Ns = Ns Ar most , +then ZFS +stores 6 copies of most metadata, and 4 copies of data and some +metadata. +.Pp +When set to +.Cm all , +ZFS stores an extra copy of all metadata. +If a +single on-disk block is corrupt, at worst a single block of user data +.Po which is +.Cm recordsize +bytes long +can be lost. +.Pc +.Pp +When set to +.Cm most , +ZFS stores an extra copy of most types of +metadata. +This can improve performance of random writes, because less +metadata must be written. +In practice, at worst about 100 blocks +.Po of +.Cm recordsize +bytes each +.Pc +of user data can be lost if a single +on-disk block is corrupt. +The exact behavior of which metadata blocks +are stored redundantly may change in future releases. +.Pp +The default value is +.Cm all . .It Sy refquota Ns = Ns Ar size | Cm none Limits the amount of space a dataset can consume. This property enforces a hard limit on the amount of space used. This hard limit does not include space used -- cgit v1.1 From eb4f9057bf87c3d2dadbc85111c8ee74097cc6b3 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 17 Jun 2014 08:11:45 +0000 Subject: MFV r249332 (illumos-gate 14005:55fc53126003) Illumos ZFS issues: 3654 zdb should print number of ganged blocks MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zdb/zdb.c | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 61e8071..ac4ea04 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -2108,6 +2108,8 @@ typedef struct zdb_blkstats { uint64_t zb_lsize; uint64_t zb_psize; uint64_t zb_count; + uint64_t zb_gangs; + uint64_t zb_ditto_samevdev; uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE]; } zdb_blkstats_t; @@ -2155,6 +2157,7 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const blkptr_t *bp, for (int i = 0; i < 4; i++) { int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL; int t = (i & 1) ? type : ZDB_OT_TOTAL; + int equal; zdb_blkstats_t *zb = &zcb->zcb_type[l][t]; zb->zb_asize += BP_GET_ASIZE(bp); @@ -2162,6 +2165,27 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const blkptr_t *bp, zb->zb_psize += BP_GET_PSIZE(bp); zb->zb_count++; zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++; + + zb->zb_gangs += BP_COUNT_GANG(bp); + + switch (BP_GET_NDVAS(bp)) { + case 2: + if (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[1])) + zb->zb_ditto_samevdev++; + break; + case 3: + equal = (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[1])) + + (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[2])) + + (DVA_GET_VDEV(&bp->blk_dva[1]) == + DVA_GET_VDEV(&bp->blk_dva[2])); + if (equal != 0) + zb->zb_ditto_samevdev++; + break; + } + } if (dump_opt['L']) @@ -2552,6 +2576,8 @@ dump_block_stats(spa_t *spa) (void) printf("\n"); (void) printf("\tbp count: %10llu\n", (u_longlong_t)tzb->zb_count); + (void) printf("\tganged count: %10llu\n", + (longlong_t)tzb->zb_gangs); (void) printf("\tbp logical: %10llu avg: %6llu\n", (u_longlong_t)tzb->zb_lsize, (u_longlong_t)(tzb->zb_lsize / tzb->zb_count)); @@ -2573,6 +2599,11 @@ dump_block_stats(spa_t *spa) (void) printf("\tSPA allocated: %10llu used: %5.2f%%\n", (u_longlong_t)norm_alloc, 100.0 * norm_alloc / norm_space); + if (tzb->zb_ditto_samevdev != 0) { + (void) printf("\tDittoed blocks on same vdev: %llu\n", + (longlong_t)tzb->zb_ditto_samevdev); + } + if (dump_opt['b'] >= 2) { int l, t, level; (void) printf("\nBlocks\tLSIZE\tPSIZE\tASIZE" @@ -2580,7 +2611,7 @@ dump_block_stats(spa_t *spa) for (t = 0; t <= ZDB_OT_TOTAL; t++) { char csize[32], lsize[32], psize[32], asize[32]; - char avg[32]; + char avg[32], gang[32]; char *typename; if (t < DMU_OT_NUMTYPES) @@ -2621,6 +2652,7 @@ dump_block_stats(spa_t *spa) zdb_nicenum(zb->zb_psize, psize); zdb_nicenum(zb->zb_asize, asize); zdb_nicenum(zb->zb_asize / zb->zb_count, avg); + zdb_nicenum(zb->zb_gangs, gang); (void) printf("%6s\t%5s\t%5s\t%5s\t%5s" "\t%5.2f\t%6.2f\t", @@ -2634,6 +2666,11 @@ dump_block_stats(spa_t *spa) (void) printf(" L%d %s\n", level, typename); + if (dump_opt['b'] >= 3 && zb->zb_gangs > 0) { + (void) printf("\t number of ganged " + "blocks: %s\n", gang); + } + if (dump_opt['b'] >= 4) { (void) printf("psize " "(in 512-byte sectors): " -- cgit v1.1 From d94b51f5b9d2ec82746ffdf57ecb15252cca123e Mon Sep 17 00:00:00 2001 From: joel Date: Mon, 23 Jun 2014 18:40:21 +0000 Subject: mdoc: remove superfluous paragraph macros. --- cddl/contrib/opensolaris/cmd/zpool/zpool.8 | 1 - 1 file changed, 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 index 1061e45..26c37c8 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 @@ -1041,7 +1041,6 @@ the following fields: See the .Qq Sx Properties section for more information on the available pool properties. -.Pp .It Fl H Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. -- cgit v1.1 From cf8bf4883d7d8263f0695f158ee86a2c278f5e6e Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 25 Jun 2014 17:27:15 +0000 Subject: MFV r258381: 4251 libdtrace leaks open file handles Illumos commit: 93ed8d0d4b068b95d0bb50d57bb854df462a8485 (partial) Reference: https://www.illumos.org/issues/4251 Discussed with: Robert Mustacchi Obtained from: Illumos MFC after: 1 week --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c index 64b98c4..51bb715 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c @@ -2268,12 +2268,15 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, const char *path) dt_dprintf("skipping library %s, already processed " "library with the same name: %s", dp->d_name, dld->dtld_library); + (void) fclose(fp); continue; } dtp->dt_filetag = fname; - if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) + if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) { + (void) fclose(fp); return (-1); /* preserve dt_errno */ + } rv = dt_compile(dtp, DT_CTX_DPROG, DTRACE_PROBESPEC_NAME, NULL, @@ -2281,8 +2284,10 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, const char *path) if (rv != NULL && dtp->dt_errno && (dtp->dt_errno != EDT_COMPILER || - dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) + dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) { + (void) fclose(fp); return (-1); /* preserve dt_errno */ + } if (dtp->dt_errno) dt_dprintf("error parsing library %s: %s\n", -- cgit v1.1 From aedbcf436f4de9b9ce6c1f3c8c59c7f227272461 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Thu, 26 Jun 2014 07:06:43 +0000 Subject: Bring the following change from the illumos-joyent repository: commit 78e24ab6803bbe11ba37642624e1498ede5b239d Author: Bryan Cantrill 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 --- .../dtrace/test/tst/common/aggs/tst.aggencoding.d | 32 + .../test/tst/common/aggs/tst.aggencoding.d.out | 646 +++++++++++++++++++++ .../cmd/dtrace/test/tst/common/aggs/tst.agghist.d | 46 ++ .../dtrace/test/tst/common/aggs/tst.agghist.d.out | 38 ++ .../cmd/dtrace/test/tst/common/aggs/tst.aggpack.d | 53 ++ .../dtrace/test/tst/common/aggs/tst.aggpack.d.out | 124 ++++ .../test/tst/common/aggs/tst.aggpackbanner.ksh | 75 +++ .../test/tst/common/aggs/tst.aggpackbanner.ksh.out | 102 ++++ .../dtrace/test/tst/common/aggs/tst.aggpackzoom.d | 42 ++ .../test/tst/common/aggs/tst.aggpackzoom.d.out | 149 +++++ .../cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d | 34 ++ .../dtrace/test/tst/common/aggs/tst.aggzoom.d.out | 211 +++++++ .../lib/libdtrace/common/dt_aggregate.c | 264 ++++++++- .../opensolaris/lib/libdtrace/common/dt_consume.c | 451 +++++++++++++- .../opensolaris/lib/libdtrace/common/dt_impl.h | 12 + .../opensolaris/lib/libdtrace/common/dt_open.c | 17 +- .../opensolaris/lib/libdtrace/common/dt_options.c | 22 + .../opensolaris/lib/libdtrace/common/dtrace.h | 10 + 18 files changed, 2289 insertions(+), 39 deletions(-) create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d new file mode 100644 index 0000000..a594afc --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d @@ -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); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out new file mode 100644 index 0000000..68482ff --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out @@ -0,0 +1,646 @@ + + + value ------------- Distribution ------------- count + 0 | 0 + 1 | 1 + 2 |▏ 2 + 3 |▎ 3 + 4 |▍ 4 + 5 |▌ 5 + 6 |▋ 6 + 7 |▊ 7 + 8 |▉ 8 + 9 |█ 9 + 10 |█▏ 10 + 11 |█▎ 11 + 12 |█▍ 12 + 13 |█▌ 13 + 14 |█▋ 14 + 15 |█▊ 15 + 16 |█▉ 16 + 17 |██ 17 + 18 |██▏ 18 + 19 |██▎ 19 + 20 |██▍ 20 + 21 |██▍ 21 + 22 |██▌ 22 + 23 |██▋ 23 + 24 |██▊ 24 + 25 |██▉ 25 + 26 |███ 26 + 27 |███▏ 27 + 28 |███▎ 28 + 29 |███▍ 29 + 30 |███▌ 30 + 31 |███▋ 31 + 32 |███▊ 32 + 33 |███▉ 33 + 34 |████ 34 + 35 |████▏ 35 + 36 |████▎ 36 + 37 |████▍ 37 + 38 |████▌ 38 + 39 |████▋ 39 + 40 |████▊ 40 + 41 |████▊ 41 + 42 |████▉ 42 + 43 |█████ 43 + 44 |█████▏ 44 + 45 |█████▎ 45 + 46 |█████▍ 46 + 47 |█████▌ 47 + 48 |█████▋ 48 + 49 |█████▊ 49 + 50 |█████▉ 50 + 51 |██████ 51 + 52 |██████▏ 52 + 53 |██████▎ 53 + 54 |██████▍ 54 + 55 |██████▌ 55 + 56 |██████▋ 56 + 57 |██████▊ 57 + 58 |██████▉ 58 + 59 |███████ 59 + 60 |███████▏ 60 + 61 |███████▏ 61 + 62 |███████▎ 62 + 63 |███████▍ 63 + 64 |███████▌ 64 + 65 |███████▋ 65 + 66 |███████▊ 66 + 67 |███████▉ 67 + 68 |████████ 68 + 69 |████████▏ 69 + 70 |████████▎ 70 + 71 |████████▍ 71 + 72 |████████▌ 72 + 73 |████████▋ 73 + 74 |████████▊ 74 + 75 |████████▉ 75 + 76 |█████████ 76 + 77 |█████████▏ 77 + 78 |█████████▎ 78 + 79 |█████████▍ 79 + 80 |█████████▌ 80 + 81 |█████████▌ 81 + 82 |█████████▋ 82 + 83 |█████████▊ 83 + 84 |█████████▉ 84 + 85 |██████████ 85 + 86 |██████████▏ 86 + 87 |██████████▎ 87 + 88 |██████████▍ 88 + 89 |██████████▌ 89 + 90 |██████████▋ 90 + 91 |██████████▊ 91 + 92 |██████████▉ 92 + 93 |███████████ 93 + 94 |███████████▏ 94 + 95 |███████████▎ 95 + 96 |███████████▍ 96 + 97 |███████████▌ 97 + 98 |███████████▋ 98 + 99 |███████████▊ 99 + 100 |███████████▉ 100 + 101 |███████████▉ 101 + 102 |████████████ 102 + 103 |████████████▏ 103 + 104 |████████████▎ 104 + 105 |████████████▍ 105 + 106 |████████████▌ 106 + 107 |████████████▋ 107 + 108 |████████████▊ 108 + 109 |████████████▉ 109 + 110 |█████████████ 110 + 111 |█████████████▏ 111 + 112 |█████████████▎ 112 + 113 |█████████████▍ 113 + 114 |█████████████▌ 114 + 115 |█████████████▋ 115 + 116 |█████████████▊ 116 + 117 |█████████████▉ 117 + 118 |██████████████ 118 + 119 |██████████████▏ 119 + 120 |██████████████▎ 120 + 121 |██████████████▎ 121 + 122 |██████████████▍ 122 + 123 |██████████████▌ 123 + 124 |██████████████▋ 124 + 125 |██████████████▊ 125 + 126 |██████████████▉ 126 + 127 |███████████████ 127 + 128 |███████████████▏ 128 + 129 |███████████████▎ 129 + 130 |███████████████▍ 130 + 131 |███████████████▌ 131 + 132 |███████████████▋ 132 + 133 |███████████████▊ 133 + 134 |███████████████▉ 134 + 135 |████████████████ 135 + 136 |████████████████▏ 136 + 137 |████████████████▎ 137 + 138 |████████████████▍ 138 + 139 |████████████████▌ 139 + 140 |████████████████▋ 140 + 141 |████████████████▋ 141 + 142 |████████████████▊ 142 + 143 |████████████████▉ 143 + 144 |█████████████████ 144 + 145 |█████████████████▏ 145 + 146 |█████████████████▎ 146 + 147 |█████████████████▍ 147 + 148 |█████████████████▌ 148 + 149 |█████████████████▋ 149 + 150 |█████████████████▊ 150 + 151 |█████████████████▉ 151 + 152 |██████████████████ 152 + 153 |██████████████████▏ 153 + 154 |██████████████████▎ 154 + 155 |██████████████████▍ 155 + 156 |██████████████████▌ 156 + 157 |██████████████████▋ 157 + 158 |██████████████████▊ 158 + 159 |██████████████████▉ 159 + 160 |███████████████████ 160 + 161 |███████████████████ 161 + 162 |███████████████████▏ 162 + 163 |███████████████████▎ 163 + 164 |███████████████████▍ 164 + 165 |███████████████████▌ 165 + 166 |███████████████████▋ 166 + 167 |███████████████████▊ 167 + 168 |███████████████████▉ 168 + 169 |████████████████████ 169 + 170 |████████████████████▏ 170 + 171 |████████████████████▎ 171 + 172 |████████████████████▍ 172 + 173 |████████████████████▌ 173 + 174 |████████████████████▋ 174 + 175 |████████████████████▊ 175 + 176 |████████████████████▉ 176 + 177 |█████████████████████ 177 + 178 |█████████████████████▏ 178 + 179 |█████████████████████▎ 179 + 180 |█████████████████████▍ 180 + 181 |█████████████████████▍ 181 + 182 |█████████████████████▌ 182 + 183 |█████████████████████▋ 183 + 184 |█████████████████████▊ 184 + 185 |█████████████████████▉ 185 + 186 |██████████████████████ 186 + 187 |██████████████████████▏ 187 + 188 |██████████████████████▎ 188 + 189 |██████████████████████▍ 189 + 190 |██████████████████████▌ 190 + 191 |██████████████████████▋ 191 + 192 |██████████████████████▊ 192 + 193 |██████████████████████▉ 193 + 194 |███████████████████████ 194 + 195 |███████████████████████▏ 195 + 196 |███████████████████████▎ 196 + 197 |███████████████████████▍ 197 + 198 |███████████████████████▌ 198 + 199 |███████████████████████▋ 199 + 200 |███████████████████████▊ 200 + 201 |███████████████████████▊ 201 + 202 |███████████████████████▉ 202 + 203 |████████████████████████ 203 + 204 |████████████████████████▏ 204 + 205 |████████████████████████▎ 205 + 206 |████████████████████████▍ 206 + 207 |████████████████████████▌ 207 + 208 |████████████████████████▋ 208 + 209 |████████████████████████▊ 209 + 210 |████████████████████████▉ 210 + 211 |█████████████████████████ 211 + 212 |█████████████████████████▏ 212 + 213 |█████████████████████████▎ 213 + 214 |█████████████████████████▍ 214 + 215 |█████████████████████████▌ 215 + 216 |█████████████████████████▋ 216 + 217 |█████████████████████████▊ 217 + 218 |█████████████████████████▉ 218 + 219 |██████████████████████████ 219 + 220 |██████████████████████████▏ 220 + 221 |██████████████████████████▏ 221 + 222 |██████████████████████████▎ 222 + 223 |██████████████████████████▍ 223 + 224 |██████████████████████████▌ 224 + 225 |██████████████████████████▋ 225 + 226 |██████████████████████████▊ 226 + 227 |██████████████████████████▉ 227 + 228 |███████████████████████████ 228 + 229 |███████████████████████████▏ 229 + 230 |███████████████████████████▎ 230 + 231 |███████████████████████████▍ 231 + 232 |███████████████████████████▌ 232 + 233 |███████████████████████████▋ 233 + 234 |███████████████████████████▊ 234 + 235 |███████████████████████████▉ 235 + 236 |████████████████████████████ 236 + 237 |████████████████████████████▏ 237 + 238 |████████████████████████████▎ 238 + 239 |████████████████████████████▍ 239 + 240 |████████████████████████████▌ 240 + 241 |████████████████████████████▌ 241 + 242 |████████████████████████████▋ 242 + 243 |████████████████████████████▊ 243 + 244 |████████████████████████████▉ 244 + 245 |█████████████████████████████ 245 + 246 |█████████████████████████████▏ 246 + 247 |█████████████████████████████▎ 247 + 248 |█████████████████████████████▍ 248 + 249 |█████████████████████████████▌ 249 + 250 |█████████████████████████████▋ 250 + 251 |█████████████████████████████▊ 251 + 252 |█████████████████████████████▉ 252 + 253 |██████████████████████████████ 253 + 254 |██████████████████████████████▏ 254 + 255 |██████████████████████████████▎ 255 + 256 |██████████████████████████████▍ 256 + 257 |██████████████████████████████▌ 257 + 258 |██████████████████████████████▋ 258 + 259 |██████████████████████████████▊ 259 + 260 |██████████████████████████████▉ 260 + 261 |██████████████████████████████▉ 261 + 262 |███████████████████████████████ 262 + 263 |███████████████████████████████▏ 263 + 264 |███████████████████████████████▎ 264 + 265 |███████████████████████████████▍ 265 + 266 |███████████████████████████████▌ 266 + 267 |███████████████████████████████▋ 267 + 268 |███████████████████████████████▊ 268 + 269 |███████████████████████████████▉ 269 + 270 |████████████████████████████████ 270 + 271 |████████████████████████████████▏ 271 + 272 |████████████████████████████████▎ 272 + 273 |████████████████████████████████▍ 273 + 274 |████████████████████████████████▌ 274 + 275 |████████████████████████████████▋ 275 + 276 |████████████████████████████████▊ 276 + 277 |████████████████████████████████▉ 277 + 278 |█████████████████████████████████ 278 + 279 |█████████████████████████████████▏ 279 + 280 |█████████████████████████████████▎ 280 + 281 |█████████████████████████████████▎ 281 + 282 |█████████████████████████████████▍ 282 + 283 |█████████████████████████████████▌ 283 + 284 |█████████████████████████████████▋ 284 + 285 |█████████████████████████████████▊ 285 + 286 |█████████████████████████████████▉ 286 + 287 |██████████████████████████████████ 287 + 288 |██████████████████████████████████▏ 288 + 289 |██████████████████████████████████▎ 289 + 290 |██████████████████████████████████▍ 290 + 291 |██████████████████████████████████▌ 291 + 292 |██████████████████████████████████▋ 292 + 293 |██████████████████████████████████▊ 293 + 294 |██████████████████████████████████▉ 294 + 295 |███████████████████████████████████ 295 + 296 |███████████████████████████████████▏ 296 + 297 |███████████████████████████████████▎ 297 + 298 |███████████████████████████████████▍ 298 + 299 |███████████████████████████████████▌ 299 + 300 |███████████████████████████████████▋ 300 + 301 |███████████████████████████████████▋ 301 + 302 |███████████████████████████████████▊ 302 + 303 |███████████████████████████████████▉ 303 + 304 |████████████████████████████████████ 304 + 305 |████████████████████████████████████▏ 305 + 306 |████████████████████████████████████▎ 306 + 307 |████████████████████████████████████▍ 307 + 308 |████████████████████████████████████▌ 308 + 309 |████████████████████████████████████▋ 309 + 310 |████████████████████████████████████▊ 310 + 311 |████████████████████████████████████▉ 311 + 312 |█████████████████████████████████████ 312 + 313 |█████████████████████████████████████▏ 313 + 314 |█████████████████████████████████████▎ 314 + 315 |█████████████████████████████████████▍ 315 + 316 |█████████████████████████████████████▌ 316 + 317 |█████████████████████████████████████▋ 317 + 318 |█████████████████████████████████████▊ 318 + 319 |█████████████████████████████████████▉ 319 + 320 |██████████████████████████████████████ 320 + 321 |██████████████████████████████████████ 320 + 322 |█████████████████████████████████████▉ 319 + 323 |█████████████████████████████████████▊ 318 + 324 |█████████████████████████████████████▋ 317 + 325 |█████████████████████████████████████▌ 316 + 326 |█████████████████████████████████████▍ 315 + 327 |█████████████████████████████████████▎ 314 + 328 |█████████████████████████████████████▏ 313 + 329 |█████████████████████████████████████ 312 + 330 |████████████████████████████████████▉ 311 + 331 |████████████████████████████████████▊ 310 + 332 |████████████████████████████████████▋ 309 + 333 |████████████████████████████████████▌ 308 + 334 |████████████████████████████████████▍ 307 + 335 |████████████████████████████████████▎ 306 + 336 |████████████████████████████████████▏ 305 + 337 |████████████████████████████████████ 304 + 338 |███████████████████████████████████▉ 303 + 339 |███████████████████████████████████▊ 302 + 340 |███████████████████████████████████▋ 301 + 341 |███████████████████████████████████▋ 300 + 342 |███████████████████████████████████▌ 299 + 343 |███████████████████████████████████▍ 298 + 344 |███████████████████████████████████▎ 297 + 345 |███████████████████████████████████▏ 296 + 346 |███████████████████████████████████ 295 + 347 |██████████████████████████████████▉ 294 + 348 |██████████████████████████████████▊ 293 + 349 |██████████████████████████████████▋ 292 + 350 |██████████████████████████████████▌ 291 + 351 |██████████████████████████████████▍ 290 + 352 |██████████████████████████████████▎ 289 + 353 |██████████████████████████████████▏ 288 + 354 |██████████████████████████████████ 287 + 355 |█████████████████████████████████▉ 286 + 356 |█████████████████████████████████▊ 285 + 357 |█████████████████████████████████▋ 284 + 358 |█████████████████████████████████▌ 283 + 359 |█████████████████████████████████▍ 282 + 360 |█████████████████████████████████▎ 281 + 361 |█████████████████████████████████▎ 280 + 362 |█████████████████████████████████▏ 279 + 363 |█████████████████████████████████ 278 + 364 |████████████████████████████████▉ 277 + 365 |████████████████████████████████▊ 276 + 366 |████████████████████████████████▋ 275 + 367 |████████████████████████████████▌ 274 + 368 |████████████████████████████████▍ 273 + 369 |████████████████████████████████▎ 272 + 370 |████████████████████████████████▏ 271 + 371 |████████████████████████████████ 270 + 372 |███████████████████████████████▉ 269 + 373 |███████████████████████████████▊ 268 + 374 |███████████████████████████████▋ 267 + 375 |███████████████████████████████▌ 266 + 376 |███████████████████████████████▍ 265 + 377 |███████████████████████████████▎ 264 + 378 |███████████████████████████████▏ 263 + 379 |███████████████████████████████ 262 + 380 |██████████████████████████████▉ 261 + 381 |██████████████████████████████▉ 260 + 382 |██████████████████████████████▊ 259 + 383 |██████████████████████████████▋ 258 + 384 |██████████████████████████████▌ 257 + 385 |██████████████████████████████▍ 256 + 386 |██████████████████████████████▎ 255 + 387 |██████████████████████████████▏ 254 + 388 |██████████████████████████████ 253 + 389 |█████████████████████████████▉ 252 + 390 |█████████████████████████████▊ 251 + 391 |█████████████████████████████▋ 250 + 392 |█████████████████████████████▌ 249 + 393 |█████████████████████████████▍ 248 + 394 |█████████████████████████████▎ 247 + 395 |█████████████████████████████▏ 246 + 396 |█████████████████████████████ 245 + 397 |████████████████████████████▉ 244 + 398 |████████████████████████████▊ 243 + 399 |████████████████████████████▋ 242 + 400 |████████████████████████████▌ 241 + 401 |████████████████████████████▌ 240 + 402 |████████████████████████████▍ 239 + 403 |████████████████████████████▎ 238 + 404 |████████████████████████████▏ 237 + 405 |████████████████████████████ 236 + 406 |███████████████████████████▉ 235 + 407 |███████████████████████████▊ 234 + 408 |███████████████████████████▋ 233 + 409 |███████████████████████████▌ 232 + 410 |███████████████████████████▍ 231 + 411 |███████████████████████████▎ 230 + 412 |███████████████████████████▏ 229 + 413 |███████████████████████████ 228 + 414 |██████████████████████████▉ 227 + 415 |██████████████████████████▊ 226 + 416 |██████████████████████████▋ 225 + 417 |██████████████████████████▌ 224 + 418 |██████████████████████████▍ 223 + 419 |██████████████████████████▎ 222 + 420 |██████████████████████████▏ 221 + 421 |██████████████████████████▏ 220 + 422 |██████████████████████████ 219 + 423 |█████████████████████████▉ 218 + 424 |█████████████████████████▊ 217 + 425 |█████████████████████████▋ 216 + 426 |█████████████████████████▌ 215 + 427 |█████████████████████████▍ 214 + 428 |█████████████████████████▎ 213 + 429 |█████████████████████████▏ 212 + 430 |█████████████████████████ 211 + 431 |████████████████████████▉ 210 + 432 |████████████████████████▊ 209 + 433 |████████████████████████▋ 208 + 434 |████████████████████████▌ 207 + 435 |████████████████████████▍ 206 + 436 |████████████████████████▎ 205 + 437 |████████████████████████▏ 204 + 438 |████████████████████████ 203 + 439 |███████████████████████▉ 202 + 440 |███████████████████████▊ 201 + 441 |███████████████████████▊ 200 + 442 |███████████████████████▋ 199 + 443 |███████████████████████▌ 198 + 444 |███████████████████████▍ 197 + 445 |███████████████████████▎ 196 + 446 |███████████████████████▏ 195 + 447 |███████████████████████ 194 + 448 |██████████████████████▉ 193 + 449 |██████████████████████▊ 192 + 450 |██████████████████████▋ 191 + 451 |██████████████████████▌ 190 + 452 |██████████████████████▍ 189 + 453 |██████████████████████▎ 188 + 454 |██████████████████████▏ 187 + 455 |██████████████████████ 186 + 456 |█████████████████████▉ 185 + 457 |█████████████████████▊ 184 + 458 |█████████████████████▋ 183 + 459 |█████████████████████▌ 182 + 460 |█████████████████████▍ 181 + 461 |█████████████████████▍ 180 + 462 |█████████████████████▎ 179 + 463 |█████████████████████▏ 178 + 464 |█████████████████████ 177 + 465 |████████████████████▉ 176 + 466 |████████████████████▊ 175 + 467 |████████████████████▋ 174 + 468 |████████████████████▌ 173 + 469 |████████████████████▍ 172 + 470 |████████████████████▎ 171 + 471 |████████████████████▏ 170 + 472 |████████████████████ 169 + 473 |███████████████████▉ 168 + 474 |███████████████████▊ 167 + 475 |███████████████████▋ 166 + 476 |███████████████████▌ 165 + 477 |███████████████████▍ 164 + 478 |███████████████████▎ 163 + 479 |███████████████████▏ 162 + 480 |███████████████████ 161 + 481 |███████████████████ 160 + 482 |██████████████████▉ 159 + 483 |██████████████████▊ 158 + 484 |██████████████████▋ 157 + 485 |██████████████████▌ 156 + 486 |██████████████████▍ 155 + 487 |██████████████████▎ 154 + 488 |██████████████████▏ 153 + 489 |██████████████████ 152 + 490 |█████████████████▉ 151 + 491 |█████████████████▊ 150 + 492 |█████████████████▋ 149 + 493 |█████████████████▌ 148 + 494 |█████████████████▍ 147 + 495 |█████████████████▎ 146 + 496 |█████████████████▏ 145 + 497 |█████████████████ 144 + 498 |████████████████▉ 143 + 499 |████████████████▊ 142 + 500 |████████████████▋ 141 + 501 |████████████████▋ 140 + 502 |████████████████▌ 139 + 503 |████████████████▍ 138 + 504 |████████████████▎ 137 + 505 |████████████████▏ 136 + 506 |████████████████ 135 + 507 |███████████████▉ 134 + 508 |███████████████▊ 133 + 509 |███████████████▋ 132 + 510 |███████████████▌ 131 + 511 |███████████████▍ 130 + 512 |███████████████▎ 129 + 513 |███████████████▏ 128 + 514 |███████████████ 127 + 515 |██████████████▉ 126 + 516 |██████████████▊ 125 + 517 |██████████████▋ 124 + 518 |██████████████▌ 123 + 519 |██████████████▍ 122 + 520 |██████████████▎ 121 + 521 |██████████████▎ 120 + 522 |██████████████▏ 119 + 523 |██████████████ 118 + 524 |█████████████▉ 117 + 525 |█████████████▊ 116 + 526 |█████████████▋ 115 + 527 |█████████████▌ 114 + 528 |█████████████▍ 113 + 529 |█████████████▎ 112 + 530 |█████████████▏ 111 + 531 |█████████████ 110 + 532 |████████████▉ 109 + 533 |████████████▊ 108 + 534 |████████████▋ 107 + 535 |████████████▌ 106 + 536 |████████████▍ 105 + 537 |████████████▎ 104 + 538 |████████████▏ 103 + 539 |████████████ 102 + 540 |███████████▉ 101 + 541 |███████████▉ 100 + 542 |███████████▊ 99 + 543 |███████████▋ 98 + 544 |███████████▌ 97 + 545 |███████████▍ 96 + 546 |███████████▎ 95 + 547 |███████████▏ 94 + 548 |███████████ 93 + 549 |██████████▉ 92 + 550 |██████████▊ 91 + 551 |██████████▋ 90 + 552 |██████████▌ 89 + 553 |██████████▍ 88 + 554 |██████████▎ 87 + 555 |██████████▏ 86 + 556 |██████████ 85 + 557 |█████████▉ 84 + 558 |█████████▊ 83 + 559 |█████████▋ 82 + 560 |█████████▌ 81 + 561 |█████████▌ 80 + 562 |█████████▍ 79 + 563 |█████████▎ 78 + 564 |█████████▏ 77 + 565 |█████████ 76 + 566 |████████▉ 75 + 567 |████████▊ 74 + 568 |████████▋ 73 + 569 |████████▌ 72 + 570 |████████▍ 71 + 571 |████████▎ 70 + 572 |████████▏ 69 + 573 |████████ 68 + 574 |███████▉ 67 + 575 |███████▊ 66 + 576 |███████▋ 65 + 577 |███████▌ 64 + 578 |███████▍ 63 + 579 |███████▎ 62 + 580 |███████▏ 61 + 581 |███████▏ 60 + 582 |███████ 59 + 583 |██████▉ 58 + 584 |██████▊ 57 + 585 |██████▋ 56 + 586 |██████▌ 55 + 587 |██████▍ 54 + 588 |██████▎ 53 + 589 |██████▏ 52 + 590 |██████ 51 + 591 |█████▉ 50 + 592 |█████▊ 49 + 593 |█████▋ 48 + 594 |█████▌ 47 + 595 |█████▍ 46 + 596 |█████▎ 45 + 597 |█████▏ 44 + 598 |█████ 43 + 599 |████▉ 42 + 600 |████▊ 41 + 601 |████▊ 40 + 602 |████▋ 39 + 603 |████▌ 38 + 604 |████▍ 37 + 605 |████▎ 36 + 606 |████▏ 35 + 607 |████ 34 + 608 |███▉ 33 + 609 |███▊ 32 + 610 |███▋ 31 + 611 |███▌ 30 + 612 |███▍ 29 + 613 |███▎ 28 + 614 |███▏ 27 + 615 |███ 26 + 616 |██▉ 25 + 617 |██▊ 24 + 618 |██▋ 23 + 619 |██▌ 22 + 620 |██▍ 21 + 621 |██▍ 20 + 622 |██▎ 19 + 623 |██▏ 18 + 624 |██ 17 + 625 |█▉ 16 + 626 |█▊ 15 + 627 |█▋ 14 + 628 |█▌ 13 + 629 |█▍ 12 + 630 |█▎ 11 + 631 |█▏ 10 + 632 |█ 9 + 633 |▉ 8 + 634 |▊ 7 + 635 |▋ 6 + 636 |▌ 5 + 637 |▍ 4 + 638 |▎ 3 + 639 |▏ 2 + >= 640 | 1 + + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d new file mode 100644 index 0000000..317aece --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d @@ -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); +} + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out new file mode 100644 index 0000000..d76e4da --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out @@ -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 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d new file mode 100644 index 0000000..c9fdba7 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d @@ -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); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out new file mode 100644 index 0000000..5300ebd --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out @@ -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 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh new file mode 100644 index 0000000..e53a89b --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh @@ -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 <= 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 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d new file mode 100644 index 0000000..537d1de --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d @@ -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); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out new file mode 100644 index 0000000..bc7ec00 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out @@ -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 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d new file mode 100644 index 0000000..860a169 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d @@ -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); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out new file mode 100644 index 0000000..acddf7f --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out @@ -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 + + diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c index b0f2b4a..6b571fa 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c @@ -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, dtrace_aggregate_f *func, void *arg) } 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); + + switch (rec->dtrd_action) { + case DTRACEAGG_STDDEV: + val = dt_stddev((uint64_t *)addr, 1); + break; + + case DTRACEAGG_SUM: + case DTRACEAGG_COUNT: + val = *addr; + break; + + case DTRACEAGG_AVG: + val = addr[0] ? (addr[1] / addr[0]) : 0; + break; + + default: + continue; + } + + if (total[agg->dtagd_varid] == NULL) { + total[agg->dtagd_varid] = aggdata; + aggdata->dtada_flags |= DTRACE_A_TOTAL; + } else { + aggdata = total[agg->dtagd_varid]; + } + + if (val > 0) + aggdata->dtada_flags |= DTRACE_A_HASPOSITIVES; + + if (val < 0) { + aggdata->dtada_flags |= DTRACE_A_HASNEGATIVES; + val = -val; + } + + if (dtp->dt_options[DTRACEOPT_AGGZOOM] != DTRACEOPT_UNSET) { + val = (int64_t)((long double)val * + (1 / DTRACE_AGGZOOM_MAX)); + + if (val > aggdata->dtada_total) + aggdata->dtada_total = val; + } else { + aggdata->dtada_total += val; + } + } + + /* + * And now one final pass to set everyone's total. + */ + for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) { + dtrace_aggdata_t *aggdata = &h->dtahe_data, *t; + dtrace_aggdesc_t *agg = aggdata->dtada_desc; + + if ((t = total[agg->dtagd_varid]) == NULL || aggdata == t) + continue; + + aggdata->dtada_total = t->dtada_total; + aggdata->dtada_flags |= (t->dtada_flags & tflags); + } + + dt_free(dtp, total); + + return (0); +} + +static int +dt_aggregate_minmaxbin(dtrace_hdl_t *dtp, boolean_t clear) +{ + dt_ahashent_t *h; + dtrace_aggdata_t **minmax; + dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id; + dt_aggregate_t *agp = &dtp->dt_aggregate; + dt_ahash_t *hash = &agp->dtat_hash; + + 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_minbin = 0; + aggdata->dtada_maxbin = 0; + aggdata->dtada_flags &= ~DTRACE_A_MINMAXBIN; + } + + if (clear || max == DTRACE_AGGVARIDNONE) + return (0); + + minmax = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *)); + + if (minmax == 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 *addr; + int minbin = -1, maxbin = -1, i; + int start = 0, size; + + rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1]; + size = rec->dtrd_size / sizeof (int64_t); + data = aggdata->dtada_data; + addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset); + + switch (rec->dtrd_action) { + case DTRACEAGG_LQUANTIZE: + /* + * For lquantize(), we always display the entire range + * of the aggregation when aggpack is set. + */ + start = 1; + minbin = start; + maxbin = size - 1 - start; + break; + + case DTRACEAGG_QUANTIZE: + for (i = start; i < size; i++) { + if (!addr[i]) + continue; + + if (minbin == -1) + minbin = i - start; + + maxbin = i - start; + } + + if (minbin == -1) { + /* + * If we have no data (e.g., due to a clear() + * or negative increments), we'll use the + * zero bucket as both our min and max. + */ + minbin = maxbin = DTRACE_QUANTIZE_ZEROBUCKET; + } + + break; + + default: + continue; + } + + if (minmax[agg->dtagd_varid] == NULL) { + minmax[agg->dtagd_varid] = aggdata; + aggdata->dtada_flags |= DTRACE_A_MINMAXBIN; + aggdata->dtada_minbin = minbin; + aggdata->dtada_maxbin = maxbin; + continue; + } + + if (minbin < minmax[agg->dtagd_varid]->dtada_minbin) + minmax[agg->dtagd_varid]->dtada_minbin = minbin; + + if (maxbin > minmax[agg->dtagd_varid]->dtada_maxbin) + minmax[agg->dtagd_varid]->dtada_maxbin = maxbin; + } + + /* + * And now one final pass to set everyone's minbin and maxbin. + */ + for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) { + dtrace_aggdata_t *aggdata = &h->dtahe_data, *mm; + dtrace_aggdesc_t *agg = aggdata->dtada_desc; + + if ((mm = minmax[agg->dtagd_varid]) == NULL || aggdata == mm) + continue; + + aggdata->dtada_minbin = mm->dtada_minbin; + aggdata->dtada_maxbin = mm->dtada_maxbin; + aggdata->dtada_flags |= DTRACE_A_MINMAXBIN; + } + + dt_free(dtp, minmax); + + return (0); +} + +static int dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, dtrace_aggregate_f *func, void *arg, int (*sfunc)(const void *, const void *)) @@ -1309,6 +1534,23 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, dt_ahashent_t *h, **sorted; dt_ahash_t *hash = &agp->dtat_hash; size_t i, nentries = 0; + int rval = -1; + + agp->dtat_flags &= ~(DTRACE_A_TOTAL | DTRACE_A_MINMAXBIN); + + if (dtp->dt_options[DTRACEOPT_AGGHIST] != DTRACEOPT_UNSET) { + agp->dtat_flags |= DTRACE_A_TOTAL; + + if (dt_aggregate_total(dtp, B_FALSE) != 0) + return (-1); + } + + if (dtp->dt_options[DTRACEOPT_AGGPACK] != DTRACEOPT_UNSET) { + agp->dtat_flags |= DTRACE_A_MINMAXBIN; + + if (dt_aggregate_minmaxbin(dtp, B_FALSE) != 0) + return (-1); + } for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) nentries++; @@ -1316,7 +1558,7 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, sorted = dt_alloc(dtp, nentries * sizeof (dt_ahashent_t *)); if (sorted == NULL) - return (-1); + goto out; for (h = hash->dtah_all, i = 0; h != NULL; h = h->dtahe_nextall) sorted[i++] = h; @@ -1340,14 +1582,20 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, for (i = 0; i < nentries; i++) { h = sorted[i]; - if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1) { - dt_free(dtp, sorted); - return (-1); - } + if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1) + goto out; } + rval = 0; +out: + if (agp->dtat_flags & DTRACE_A_TOTAL) + (void) dt_aggregate_total(dtp, B_TRUE); + + if (agp->dtat_flags & DTRACE_A_MINMAXBIN) + (void) dt_aggregate_minmaxbin(dtp, B_TRUE); + dt_free(dtp, sorted); - return (0); + return (rval); } int @@ -1870,6 +2118,8 @@ dtrace_aggregate_print(dtrace_hdl_t *dtp, FILE *fp, { dt_print_aggdata_t pd; + bzero(&pd, sizeof (pd)); + pd.dtpa_dtp = dtp; pd.dtpa_fp = fp; pd.dtpa_allunprint = 1; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c index 8d9e494..d255db8 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c @@ -24,7 +24,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. */ @@ -59,6 +59,25 @@ dt_fabsl(long double x) return (x); } +static int +dt_ndigits(long long val) +{ + int rval = 1; + long long cmp = 10; + + if (val < 0) { + val = val == INT64_MIN ? INT64_MAX : -val; + rval++; + } + + while (val > cmp && cmp > 0) { + rval++; + cmp *= 10; + } + + return (rval < 4 ? 4 : rval); +} + /* * 128-bit arithmetic functions needed to support the stddev() aggregating * action. @@ -487,7 +506,125 @@ dt_nullrec() return (DTRACE_CONSUME_NEXT); } -int +static void +dt_quantize_total(dtrace_hdl_t *dtp, int64_t datum, long double *total) +{ + long double val = dt_fabsl((long double)datum); + + if (dtp->dt_options[DTRACEOPT_AGGZOOM] == DTRACEOPT_UNSET) { + *total += val; + return; + } + + /* + * If we're zooming in on an aggregation, we want the height of the + * highest value to be approximately 95% of total bar height -- so we + * adjust up by the reciprocal of DTRACE_AGGZOOM_MAX when comparing to + * our highest value. + */ + val *= 1 / DTRACE_AGGZOOM_MAX; + + if (*total < val) + *total = val; +} + +static int +dt_print_quanthdr(dtrace_hdl_t *dtp, FILE *fp, int width) +{ + return (dt_printf(dtp, fp, "\n%*s %41s %-9s\n", + width ? width : 16, width ? "key" : "value", + "------------- Distribution -------------", "count")); +} + +static int +dt_print_quanthdr_packed(dtrace_hdl_t *dtp, FILE *fp, int width, + const dtrace_aggdata_t *aggdata, dtrace_actkind_t action) +{ + int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin; + int minwidth, maxwidth, i; + + assert(action == DTRACEAGG_QUANTIZE || action == DTRACEAGG_LQUANTIZE); + + if (action == DTRACEAGG_QUANTIZE) { + if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET) + min--; + + if (max < DTRACE_QUANTIZE_NBUCKETS - 1) + max++; + + minwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(min)); + maxwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(max)); + } else { + maxwidth = 8; + minwidth = maxwidth - 1; + max++; + } + + if (dt_printf(dtp, fp, "\n%*s %*s .", + width, width > 0 ? "key" : "", minwidth, "min") < 0) + return (-1); + + for (i = min; i <= max; i++) { + if (dt_printf(dtp, fp, "-") < 0) + return (-1); + } + + return (dt_printf(dtp, fp, ". %*s | count\n", -maxwidth, "max")); +} + +/* + * We use a subset of the Unicode Block Elements (U+2588 through U+258F, + * inclusive) to represent aggregations via UTF-8 -- which are expressed via + * 3-byte UTF-8 sequences. + */ +#define DTRACE_AGGUTF8_FULL 0x2588 +#define DTRACE_AGGUTF8_BASE 0x258f +#define DTRACE_AGGUTF8_LEVELS 8 + +#define DTRACE_AGGUTF8_BYTE0(val) (0xe0 | ((val) >> 12)) +#define DTRACE_AGGUTF8_BYTE1(val) (0x80 | (((val) >> 6) & 0x3f)) +#define DTRACE_AGGUTF8_BYTE2(val) (0x80 | ((val) & 0x3f)) + +static int +dt_print_quantline_utf8(dtrace_hdl_t *dtp, FILE *fp, int64_t val, + uint64_t normal, long double total) +{ + uint_t len = 40, i, whole, partial; + long double f = (dt_fabsl((long double)val) * len) / total; + const char *spaces = " "; + + whole = (uint_t)f; + partial = (uint_t)((f - (long double)(uint_t)f) * + (long double)DTRACE_AGGUTF8_LEVELS); + + if (dt_printf(dtp, fp, "|") < 0) + return (-1); + + for (i = 0; i < whole; i++) { + if (dt_printf(dtp, fp, "%c%c%c", + DTRACE_AGGUTF8_BYTE0(DTRACE_AGGUTF8_FULL), + DTRACE_AGGUTF8_BYTE1(DTRACE_AGGUTF8_FULL), + DTRACE_AGGUTF8_BYTE2(DTRACE_AGGUTF8_FULL)) < 0) + return (-1); + } + + if (partial != 0) { + partial = DTRACE_AGGUTF8_BASE - (partial - 1); + + if (dt_printf(dtp, fp, "%c%c%c", + DTRACE_AGGUTF8_BYTE0(partial), + DTRACE_AGGUTF8_BYTE1(partial), + DTRACE_AGGUTF8_BYTE2(partial)) < 0) + return (-1); + + i++; + } + + return (dt_printf(dtp, fp, "%s %-9lld\n", spaces + i, + (long long)val / normal)); +} + +static int dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val, uint64_t normal, long double total, char positives, char negatives) { @@ -505,6 +642,11 @@ dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val, if (!negatives) { if (positives) { + if (dtp->dt_encoding == DT_ENCODING_UTF8) { + return (dt_print_quantline_utf8(dtp, fp, val, + normal, total)); + } + f = (dt_fabsl((long double)val) * len) / total; depth = (uint_t)(f + 0.5); } else { @@ -547,6 +689,77 @@ dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val, } } +/* + * As with UTF-8 printing of aggregations, we use a subset of the Unicode + * Block Elements (U+2581 through U+2588, inclusive) to represent our packed + * aggregation. + */ +#define DTRACE_AGGPACK_BASE 0x2581 +#define DTRACE_AGGPACK_LEVELS 8 + +static int +dt_print_packed(dtrace_hdl_t *dtp, FILE *fp, + long double datum, long double total) +{ + static boolean_t utf8_checked = 0; + static boolean_t utf8; + char *ascii = "__xxxxXX"; + char *neg = "vvvvVV"; + unsigned int len; + long double val; + + while (!utf8_checked) { + char *term; + + /* + * We want to determine if we can reasonably emit UTF-8 for our + * packed aggregation. To do this, we will check for terminals + * that are known to be primitive to emit UTF-8 on these. + */ + utf8_checked = B_TRUE; + + if (dtp->dt_encoding == DT_ENCODING_ASCII) + break; + + if (dtp->dt_encoding == DT_ENCODING_UTF8) { + utf8 = B_TRUE; + break; + } + + if ((term = getenv("TERM")) != NULL && + (strcmp(term, "sun") == 0 || + strcmp(term, "sun-color") == 0) || + strcmp(term, "dumb") == 0) { + break; + } + + utf8 = B_TRUE; + } + + if (datum == 0) + return (dt_printf(dtp, fp, " ")); + + if (datum < 0) { + len = strlen(neg); + val = dt_fabsl(datum * (len - 1)) / total; + return (dt_printf(dtp, fp, "%c", neg[(uint_t)(val + 0.5)])); + } + + if (utf8) { + int block = DTRACE_AGGPACK_BASE + (unsigned int)(((datum * + (DTRACE_AGGPACK_LEVELS - 1)) / total) + 0.5); + + return (dt_printf(dtp, fp, "%c%c%c", + DTRACE_AGGUTF8_BYTE0(block), + DTRACE_AGGUTF8_BYTE1(block), + DTRACE_AGGUTF8_BYTE2(block))); + } + + len = strlen(ascii); + val = (datum * (len - 1)) / total; + return (dt_printf(dtp, fp, "%c", ascii[(uint_t)(val + 0.5)])); +} + int dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, size_t size, uint64_t normal) @@ -564,9 +777,9 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, if (first_bin == DTRACE_QUANTIZE_NBUCKETS - 1) { /* - * There isn't any data. This is possible if (and only if) - * negative increment values have been used. In this case, - * we'll print the buckets around 0. + * There isn't any data. This is possible if the aggregation + * has been clear()'d or if negative increment values have been + * used. Regardless, we'll print the buckets around 0. */ first_bin = DTRACE_QUANTIZE_ZEROBUCKET - 1; last_bin = DTRACE_QUANTIZE_ZEROBUCKET + 1; @@ -584,11 +797,10 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); - total += dt_fabsl((long double)data[i]); + dt_quantize_total(dtp, data[i], &total); } - if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value", - "------------- Distribution -------------", "count") < 0) + if (dt_print_quanthdr(dtp, fp, 0) < 0) return (-1); for (i = first_bin; i <= last_bin; i++) { @@ -605,6 +817,48 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, } int +dt_print_quantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr, + size_t size, const dtrace_aggdata_t *aggdata) +{ + const int64_t *data = addr; + long double total = 0, count = 0; + int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin, i; + int64_t minval, maxval; + + if (size != DTRACE_QUANTIZE_NBUCKETS * sizeof (uint64_t)) + return (dt_set_errno(dtp, EDT_DMISMATCH)); + + if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET) + min--; + + if (max < DTRACE_QUANTIZE_NBUCKETS - 1) + max++; + + minval = DTRACE_QUANTIZE_BUCKETVAL(min); + maxval = DTRACE_QUANTIZE_BUCKETVAL(max); + + if (dt_printf(dtp, fp, " %*lld :", dt_ndigits(minval), + (long long)minval) < 0) + return (-1); + + for (i = min; i <= max; i++) { + dt_quantize_total(dtp, data[i], &total); + count += data[i]; + } + + for (i = min; i <= max; i++) { + if (dt_print_packed(dtp, fp, data[i], total) < 0) + return (-1); + } + + if (dt_printf(dtp, fp, ": %*lld | %lld\n", + -dt_ndigits(maxval), (long long)maxval, (long long)count) < 0) + return (-1); + + return (0); +} + +int dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, size_t size, uint64_t normal) { @@ -651,7 +905,7 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); - total += dt_fabsl((long double)data[i]); + dt_quantize_total(dtp, data[i], &total); } if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value", @@ -663,8 +917,7 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, int err; if (i == 0) { - (void) snprintf(c, sizeof (c), "< %d", - base / (uint32_t)normal); + (void) snprintf(c, sizeof (c), "< %d", base); err = dt_printf(dtp, fp, "%16s ", c); } else if (i == levels + 1) { (void) snprintf(c, sizeof (c), ">= %d", @@ -683,6 +936,59 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, return (0); } +/*ARGSUSED*/ +int +dt_print_lquantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr, + size_t size, const dtrace_aggdata_t *aggdata) +{ + const int64_t *data = addr; + long double total = 0, count = 0; + int min, max, base, err; + uint64_t arg; + uint16_t step, levels; + char c[32]; + unsigned int i; + + if (size < sizeof (uint64_t)) + return (dt_set_errno(dtp, EDT_DMISMATCH)); + + arg = *data++; + size -= sizeof (uint64_t); + + base = DTRACE_LQUANTIZE_BASE(arg); + step = DTRACE_LQUANTIZE_STEP(arg); + levels = DTRACE_LQUANTIZE_LEVELS(arg); + + if (size != sizeof (uint64_t) * (levels + 2)) + return (dt_set_errno(dtp, EDT_DMISMATCH)); + + min = 0; + max = levels + 1; + + if (min == 0) { + (void) snprintf(c, sizeof (c), "< %d", base); + err = dt_printf(dtp, fp, "%8s :", c); + } else { + err = dt_printf(dtp, fp, "%8d :", base + (min - 1) * step); + } + + if (err < 0) + return (-1); + + for (i = min; i <= max; i++) { + dt_quantize_total(dtp, data[i], &total); + count += data[i]; + } + + for (i = min; i <= max; i++) { + if (dt_print_packed(dtp, fp, data[i], total) < 0) + return (-1); + } + + (void) snprintf(c, sizeof (c), ">= %d", base + (levels * step)); + return (dt_printf(dtp, fp, ": %-8s | %lld\n", c, (long long)count)); +} + int dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, size_t size, uint64_t normal) @@ -740,7 +1046,7 @@ dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); - total += dt_fabsl((long double)data[i]); + dt_quantize_total(dtp, data[i], &total); } if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value", @@ -823,7 +1129,7 @@ dt_print_stddev(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, } /*ARGSUSED*/ -int +static int dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, size_t nbytes, int width, int quiet, int forceraw) { @@ -876,10 +1182,12 @@ dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, if (j != nbytes) break; - if (quiet) + if (quiet) { return (dt_printf(dtp, fp, "%s", c)); - else - return (dt_printf(dtp, fp, " %-*s", width, c)); + } else { + return (dt_printf(dtp, fp, " %s%*s", + width < 0 ? " " : "", width, c)); + } } break; @@ -1793,10 +2101,83 @@ dt_trunc(dtrace_hdl_t *dtp, caddr_t base, dtrace_recdesc_t *rec) static int dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec, - caddr_t addr, size_t size, uint64_t normal) + caddr_t addr, size_t size, const dtrace_aggdata_t *aggdata, + uint64_t normal, dt_print_aggdata_t *pd) { - int err; + int err, width; dtrace_actkind_t act = rec->dtrd_action; + boolean_t packed = pd->dtpa_agghist || pd->dtpa_aggpack; + dtrace_aggdesc_t *agg = aggdata->dtada_desc; + + static struct { + size_t size; + int width; + int packedwidth; + } *fmt, fmttab[] = { + { sizeof (uint8_t), 3, 3 }, + { sizeof (uint16_t), 5, 5 }, + { sizeof (uint32_t), 8, 8 }, + { sizeof (uint64_t), 16, 16 }, + { 0, -50, 16 } + }; + + if (packed && pd->dtpa_agghisthdr != agg->dtagd_varid) { + dtrace_recdesc_t *r; + + width = 0; + + /* + * To print our quantization header for either an agghist or + * aggpack aggregation, we need to iterate through all of our + * of our records to determine their width. + */ + for (r = rec; !DTRACEACT_ISAGG(r->dtrd_action); r++) { + for (fmt = fmttab; fmt->size && + fmt->size != r->dtrd_size; fmt++) + continue; + + width += fmt->packedwidth + 1; + } + + if (pd->dtpa_agghist) { + if (dt_print_quanthdr(dtp, fp, width) < 0) + return (-1); + } else { + if (dt_print_quanthdr_packed(dtp, fp, + width, aggdata, r->dtrd_action) < 0) + return (-1); + } + + pd->dtpa_agghisthdr = agg->dtagd_varid; + } + + if (pd->dtpa_agghist && DTRACEACT_ISAGG(act)) { + char positives = aggdata->dtada_flags & DTRACE_A_HASPOSITIVES; + char negatives = aggdata->dtada_flags & DTRACE_A_HASNEGATIVES; + int64_t val; + + assert(act == DTRACEAGG_SUM || act == DTRACEAGG_COUNT); + val = (long long)*((uint64_t *)addr); + + if (dt_printf(dtp, fp, " ") < 0) + return (-1); + + return (dt_print_quantline(dtp, fp, val, normal, + aggdata->dtada_total, positives, negatives)); + } + + if (pd->dtpa_aggpack && DTRACEACT_ISAGG(act)) { + switch (act) { + case DTRACEAGG_QUANTIZE: + return (dt_print_quantize_packed(dtp, + fp, addr, size, aggdata)); + case DTRACEAGG_LQUANTIZE: + return (dt_print_lquantize_packed(dtp, + fp, addr, size, aggdata)); + default: + break; + } + } switch (act) { case DTRACEACT_STACK: @@ -1839,28 +2220,33 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec, break; } + for (fmt = fmttab; fmt->size && fmt->size != size; fmt++) + continue; + + width = packed ? fmt->packedwidth : fmt->width; + switch (size) { case sizeof (uint64_t): - err = dt_printf(dtp, fp, " %16lld", + err = dt_printf(dtp, fp, " %*lld", width, /* LINTED - alignment */ (long long)*((uint64_t *)addr) / normal); break; case sizeof (uint32_t): /* LINTED - alignment */ - err = dt_printf(dtp, fp, " %8d", *((uint32_t *)addr) / + err = dt_printf(dtp, fp, " %*d", width, *((uint32_t *)addr) / (uint32_t)normal); break; case sizeof (uint16_t): /* LINTED - alignment */ - err = dt_printf(dtp, fp, " %5d", *((uint16_t *)addr) / + err = dt_printf(dtp, fp, " %*d", width, *((uint16_t *)addr) / (uint32_t)normal); break; case sizeof (uint8_t): - err = dt_printf(dtp, fp, " %3d", *((uint8_t *)addr) / + err = dt_printf(dtp, fp, " %*d", width, *((uint8_t *)addr) / (uint32_t)normal); break; default: - err = dt_print_bytes(dtp, fp, addr, size, 50, 0, 0); + err = dt_print_bytes(dtp, fp, addr, size, width, 0, 0); break; } @@ -1881,6 +2267,9 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) caddr_t addr; size_t size; + pd->dtpa_agghist = (aggdata->dtada_flags & DTRACE_A_TOTAL); + pd->dtpa_aggpack = (aggdata->dtada_flags & DTRACE_A_MINMAXBIN); + /* * Iterate over each record description in the key, printing the traced * data, skipping the first datum (the tuple member created by the @@ -1897,7 +2286,8 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) break; } - if (dt_print_datum(dtp, fp, rec, addr, size, 1) < 0) + if (dt_print_datum(dtp, fp, rec, addr, + size, aggdata, 1, pd) < 0) return (-1); if (dt_buffered_flush(dtp, NULL, rec, aggdata, @@ -1920,7 +2310,8 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) assert(DTRACEACT_ISAGG(act)); normal = aggdata->dtada_normal; - if (dt_print_datum(dtp, fp, rec, addr, size, normal) < 0) + if (dt_print_datum(dtp, fp, rec, addr, + size, aggdata, normal, pd) < 0) return (-1); if (dt_buffered_flush(dtp, NULL, rec, aggdata, @@ -1931,8 +2322,10 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) agg->dtagd_flags |= DTRACE_AGD_PRINTED; } - if (dt_printf(dtp, fp, "\n") < 0) - return (-1); + if (!pd->dtpa_agghist && !pd->dtpa_aggpack) { + if (dt_printf(dtp, fp, "\n") < 0) + return (-1); + } if (dt_buffered_flush(dtp, NULL, NULL, aggdata, DTRACE_BUFDATA_AGGFORMAT | DTRACE_BUFDATA_AGGLAST) < 0) @@ -2401,7 +2794,7 @@ nofmt: } n = dt_print_bytes(dtp, fp, addr, - tracememsize, 33, quiet, 1); + tracememsize, -33, quiet, 1); tracememsize = 0; @@ -2434,7 +2827,7 @@ nofmt: break; default: n = dt_print_bytes(dtp, fp, addr, - rec->dtrd_size, 33, quiet, 0); + rec->dtrd_size, -33, quiet, 0); break; } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h index 2bae220..feea9f7 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h @@ -189,6 +189,9 @@ typedef struct dt_print_aggdata { dtrace_aggvarid_t dtpa_id; /* aggregation variable of interest */ FILE *dtpa_fp; /* file pointer */ int dtpa_allunprint; /* print only unprinted aggregations */ + int dtpa_agghist; /* print aggregation as histogram */ + int dtpa_agghisthdr; /* aggregation histogram hdr printed */ + int dtpa_aggpack; /* pack quantized aggregations */ } dt_print_aggdata_t; typedef struct dt_dirpath { @@ -283,6 +286,7 @@ struct dtrace_hdl { uint_t dt_linktype; /* dtrace link output file type (see below) */ uint_t dt_xlatemode; /* dtrace translator linking mode (see below) */ uint_t dt_stdcmode; /* dtrace stdc compatibility mode (see below) */ + uint_t dt_encoding; /* dtrace output encoding (see below) */ uint_t dt_treedump; /* dtrace tree debug bitmap (see below) */ uint64_t dt_options[DTRACEOPT_MAX]; /* dtrace run-time options */ int dt_version; /* library version requested by client */ @@ -374,6 +378,14 @@ struct dtrace_hdl { #define DT_STDC_XT 3 /* ISO C + K&R C compat with ISO: __STDC__=0 */ /* + * Values for the dt_encoding property, which is used to force a particular + * character encoding (overriding default behavior and/or automatic detection). + */ +#define DT_ENCODING_UNSET 0 +#define DT_ENCODING_ASCII 1 +#define DT_ENCODING_UTF8 2 + +/* * Macro to test whether a given pass bit is set in the dt_treedump bit-vector. * If the bit for pass 'p' is set, the D compiler displays the parse tree for * the program by printing it to stderr at the end of compiler pass 'p'. diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index 92251d5..192ef0c 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -122,9 +122,14 @@ #define DT_VERS_1_8_1 DT_VERSION_NUMBER(1, 8, 1) #define DT_VERS_1_9 DT_VERSION_NUMBER(1, 9, 0) #define DT_VERS_1_9_1 DT_VERSION_NUMBER(1, 9, 1) -#define DT_VERS_LATEST DT_VERS_1_9_1 -#define DT_VERS_STRING "Sun D 1.9.1" - +#define DT_VERS_1_9_2 DT_VERSION_NUMBER(1, 9, 2) /* FreeBSD specific */ +#define DT_VERS_1_10 DT_VERSION_NUMBER(1, 10, 0) +#define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0) +#define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0) +#define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1) +#define DT_VERS_LATEST DT_VERS_1_9_2 +#define DT_VERS_STRING "Sun D 1.9.2" + const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ DT_VERS_1_1, /* D API 1.1.0 Solaris Express 6/05 */ @@ -145,6 +150,11 @@ const dt_version_t _dtrace_versions[] = { DT_VERS_1_8_1, /* D API 1.8.1 */ DT_VERS_1_9, /* D API 1.9 */ DT_VERS_1_9_1, /* D API 1.9.1 */ + DT_VERS_1_9_2, /* D API 1.9.1 */ + DT_VERS_1_10, /* D API 1.10 */ + DT_VERS_1_11, /* D API 1.11 */ + DT_VERS_1_12, /* D API 1.12 */ + DT_VERS_1_12_1, /* D API 1.12.1 */ 0 }; @@ -1144,6 +1154,7 @@ alloc: dtp->dt_linktype = DT_LTYP_ELF; dtp->dt_xlatemode = DT_XL_STATIC; dtp->dt_stdcmode = DT_STDC_XA; + dtp->dt_encoding = DT_ENCODING_UNSET; dtp->dt_version = version; dtp->dt_fd = dtfd; dtp->dt_ftfd = ftfd; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c index c20d250..832af88 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c @@ -25,6 +25,7 @@ */ /* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -338,6 +339,23 @@ dt_opt_linktype(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) /*ARGSUSED*/ static int +dt_opt_encoding(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) +{ + if (arg == NULL) + return (dt_set_errno(dtp, EDT_BADOPTVAL)); + + if (strcmp(arg, "ascii") == 0) + dtp->dt_encoding = DT_ENCODING_ASCII; + else if (strcmp(arg, "utf8") == 0) + dtp->dt_encoding = DT_ENCODING_UTF8; + else + return (dt_set_errno(dtp, EDT_BADOPTVAL)); + + return (0); +} + +/*ARGSUSED*/ +static int dt_opt_evaltime(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) { if (arg == NULL) @@ -928,6 +946,7 @@ static const dt_option_t _dtrace_ctoptions[] = { { "define", dt_opt_cpp_opts, (uintptr_t)"-D" }, { "droptags", dt_opt_droptags }, { "empty", dt_opt_cflags, DTRACE_C_EMPTY }, + { "encoding", dt_opt_encoding }, { "errtags", dt_opt_cflags, DTRACE_C_ETAGS }, { "evaltime", dt_opt_evaltime }, { "incdir", dt_opt_cpp_opts, (uintptr_t)"-I" }, @@ -988,11 +1007,14 @@ static const dt_option_t _dtrace_rtoptions[] = { * Dynamic run-time options. */ static const dt_option_t _dtrace_drtoptions[] = { + { "agghist", dt_opt_runtime, DTRACEOPT_AGGHIST }, + { "aggpack", dt_opt_runtime, DTRACEOPT_AGGPACK }, { "aggrate", dt_opt_rate, DTRACEOPT_AGGRATE }, { "aggsortkey", dt_opt_runtime, DTRACEOPT_AGGSORTKEY }, { "aggsortkeypos", dt_opt_runtime, DTRACEOPT_AGGSORTKEYPOS }, { "aggsortpos", dt_opt_runtime, DTRACEOPT_AGGSORTPOS }, { "aggsortrev", dt_opt_runtime, DTRACEOPT_AGGSORTREV }, + { "aggzoom", dt_opt_runtime, DTRACEOPT_AGGZOOM }, { "flowindent", dt_opt_runtime, DTRACEOPT_FLOWINDENT }, { "quiet", dt_opt_runtime, DTRACEOPT_QUIET }, { "rawbytes", dt_opt_runtime, DTRACEOPT_RAWBYTES }, diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index b2e3108..cbaa03f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -356,6 +356,12 @@ extern int dtrace_handle_setopt(dtrace_hdl_t *, #define DTRACE_A_PERCPU 0x0001 #define DTRACE_A_KEEPDELTA 0x0002 #define DTRACE_A_ANONYMOUS 0x0004 +#define DTRACE_A_TOTAL 0x0008 +#define DTRACE_A_MINMAXBIN 0x0010 +#define DTRACE_A_HASNEGATIVES 0x0020 +#define DTRACE_A_HASPOSITIVES 0x0040 + +#define DTRACE_AGGZOOM_MAX 0.95 /* height of max bar */ #define DTRACE_AGGWALK_ERROR -1 /* error while processing */ #define DTRACE_AGGWALK_NEXT 0 /* proceed to next element */ @@ -376,6 +382,10 @@ struct dtrace_aggdata { caddr_t dtada_delta; /* delta data, if available */ caddr_t *dtada_percpu; /* per CPU data, if avail */ caddr_t *dtada_percpu_delta; /* per CPU delta, if avail */ + int64_t dtada_total; /* per agg total, if avail */ + uint16_t dtada_minbin; /* minimum bin, if avail */ + uint16_t dtada_maxbin; /* maximum bin, if avail */ + uint32_t dtada_flags; /* flags */ }; typedef int dtrace_aggregate_f(const dtrace_aggdata_t *, void *); -- cgit v1.1 From 37b311bee5d13e596aac0304bd2813b6de2fd12a Mon Sep 17 00:00:00 2001 From: rpaulo Date: Thu, 26 Jun 2014 17:34:42 +0000 Subject: Revert r267898. --- .../dtrace/test/tst/common/aggs/tst.aggencoding.d | 32 - .../test/tst/common/aggs/tst.aggencoding.d.out | 646 --------------------- .../cmd/dtrace/test/tst/common/aggs/tst.agghist.d | 46 -- .../dtrace/test/tst/common/aggs/tst.agghist.d.out | 38 -- .../cmd/dtrace/test/tst/common/aggs/tst.aggpack.d | 53 -- .../dtrace/test/tst/common/aggs/tst.aggpack.d.out | 124 ---- .../test/tst/common/aggs/tst.aggpackbanner.ksh | 75 --- .../test/tst/common/aggs/tst.aggpackbanner.ksh.out | 102 ---- .../dtrace/test/tst/common/aggs/tst.aggpackzoom.d | 42 -- .../test/tst/common/aggs/tst.aggpackzoom.d.out | 149 ----- .../cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d | 34 -- .../dtrace/test/tst/common/aggs/tst.aggzoom.d.out | 211 ------- .../lib/libdtrace/common/dt_aggregate.c | 264 +-------- .../opensolaris/lib/libdtrace/common/dt_consume.c | 451 +------------- .../opensolaris/lib/libdtrace/common/dt_impl.h | 12 - .../opensolaris/lib/libdtrace/common/dt_open.c | 17 +- .../opensolaris/lib/libdtrace/common/dt_options.c | 22 - .../opensolaris/lib/libdtrace/common/dtrace.h | 10 - 18 files changed, 39 insertions(+), 2289 deletions(-) delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d delete mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d deleted file mode 100644 index a594afc..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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); -} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out deleted file mode 100644 index 68482ff..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out +++ /dev/null @@ -1,646 +0,0 @@ - - - value ------------- Distribution ------------- count - 0 | 0 - 1 | 1 - 2 |▏ 2 - 3 |▎ 3 - 4 |▍ 4 - 5 |▌ 5 - 6 |▋ 6 - 7 |▊ 7 - 8 |▉ 8 - 9 |█ 9 - 10 |█▏ 10 - 11 |█▎ 11 - 12 |█▍ 12 - 13 |█▌ 13 - 14 |█▋ 14 - 15 |█▊ 15 - 16 |█▉ 16 - 17 |██ 17 - 18 |██▏ 18 - 19 |██▎ 19 - 20 |██▍ 20 - 21 |██▍ 21 - 22 |██▌ 22 - 23 |██▋ 23 - 24 |██▊ 24 - 25 |██▉ 25 - 26 |███ 26 - 27 |███▏ 27 - 28 |███▎ 28 - 29 |███▍ 29 - 30 |███▌ 30 - 31 |███▋ 31 - 32 |███▊ 32 - 33 |███▉ 33 - 34 |████ 34 - 35 |████▏ 35 - 36 |████▎ 36 - 37 |████▍ 37 - 38 |████▌ 38 - 39 |████▋ 39 - 40 |████▊ 40 - 41 |████▊ 41 - 42 |████▉ 42 - 43 |█████ 43 - 44 |█████▏ 44 - 45 |█████▎ 45 - 46 |█████▍ 46 - 47 |█████▌ 47 - 48 |█████▋ 48 - 49 |█████▊ 49 - 50 |█████▉ 50 - 51 |██████ 51 - 52 |██████▏ 52 - 53 |██████▎ 53 - 54 |██████▍ 54 - 55 |██████▌ 55 - 56 |██████▋ 56 - 57 |██████▊ 57 - 58 |██████▉ 58 - 59 |███████ 59 - 60 |███████▏ 60 - 61 |███████▏ 61 - 62 |███████▎ 62 - 63 |███████▍ 63 - 64 |███████▌ 64 - 65 |███████▋ 65 - 66 |███████▊ 66 - 67 |███████▉ 67 - 68 |████████ 68 - 69 |████████▏ 69 - 70 |████████▎ 70 - 71 |████████▍ 71 - 72 |████████▌ 72 - 73 |████████▋ 73 - 74 |████████▊ 74 - 75 |████████▉ 75 - 76 |█████████ 76 - 77 |█████████▏ 77 - 78 |█████████▎ 78 - 79 |█████████▍ 79 - 80 |█████████▌ 80 - 81 |█████████▌ 81 - 82 |█████████▋ 82 - 83 |█████████▊ 83 - 84 |█████████▉ 84 - 85 |██████████ 85 - 86 |██████████▏ 86 - 87 |██████████▎ 87 - 88 |██████████▍ 88 - 89 |██████████▌ 89 - 90 |██████████▋ 90 - 91 |██████████▊ 91 - 92 |██████████▉ 92 - 93 |███████████ 93 - 94 |███████████▏ 94 - 95 |███████████▎ 95 - 96 |███████████▍ 96 - 97 |███████████▌ 97 - 98 |███████████▋ 98 - 99 |███████████▊ 99 - 100 |███████████▉ 100 - 101 |███████████▉ 101 - 102 |████████████ 102 - 103 |████████████▏ 103 - 104 |████████████▎ 104 - 105 |████████████▍ 105 - 106 |████████████▌ 106 - 107 |████████████▋ 107 - 108 |████████████▊ 108 - 109 |████████████▉ 109 - 110 |█████████████ 110 - 111 |█████████████▏ 111 - 112 |█████████████▎ 112 - 113 |█████████████▍ 113 - 114 |█████████████▌ 114 - 115 |█████████████▋ 115 - 116 |█████████████▊ 116 - 117 |█████████████▉ 117 - 118 |██████████████ 118 - 119 |██████████████▏ 119 - 120 |██████████████▎ 120 - 121 |██████████████▎ 121 - 122 |██████████████▍ 122 - 123 |██████████████▌ 123 - 124 |██████████████▋ 124 - 125 |██████████████▊ 125 - 126 |██████████████▉ 126 - 127 |███████████████ 127 - 128 |███████████████▏ 128 - 129 |███████████████▎ 129 - 130 |███████████████▍ 130 - 131 |███████████████▌ 131 - 132 |███████████████▋ 132 - 133 |███████████████▊ 133 - 134 |███████████████▉ 134 - 135 |████████████████ 135 - 136 |████████████████▏ 136 - 137 |████████████████▎ 137 - 138 |████████████████▍ 138 - 139 |████████████████▌ 139 - 140 |████████████████▋ 140 - 141 |████████████████▋ 141 - 142 |████████████████▊ 142 - 143 |████████████████▉ 143 - 144 |█████████████████ 144 - 145 |█████████████████▏ 145 - 146 |█████████████████▎ 146 - 147 |█████████████████▍ 147 - 148 |█████████████████▌ 148 - 149 |█████████████████▋ 149 - 150 |█████████████████▊ 150 - 151 |█████████████████▉ 151 - 152 |██████████████████ 152 - 153 |██████████████████▏ 153 - 154 |██████████████████▎ 154 - 155 |██████████████████▍ 155 - 156 |██████████████████▌ 156 - 157 |██████████████████▋ 157 - 158 |██████████████████▊ 158 - 159 |██████████████████▉ 159 - 160 |███████████████████ 160 - 161 |███████████████████ 161 - 162 |███████████████████▏ 162 - 163 |███████████████████▎ 163 - 164 |███████████████████▍ 164 - 165 |███████████████████▌ 165 - 166 |███████████████████▋ 166 - 167 |███████████████████▊ 167 - 168 |███████████████████▉ 168 - 169 |████████████████████ 169 - 170 |████████████████████▏ 170 - 171 |████████████████████▎ 171 - 172 |████████████████████▍ 172 - 173 |████████████████████▌ 173 - 174 |████████████████████▋ 174 - 175 |████████████████████▊ 175 - 176 |████████████████████▉ 176 - 177 |█████████████████████ 177 - 178 |█████████████████████▏ 178 - 179 |█████████████████████▎ 179 - 180 |█████████████████████▍ 180 - 181 |█████████████████████▍ 181 - 182 |█████████████████████▌ 182 - 183 |█████████████████████▋ 183 - 184 |█████████████████████▊ 184 - 185 |█████████████████████▉ 185 - 186 |██████████████████████ 186 - 187 |██████████████████████▏ 187 - 188 |██████████████████████▎ 188 - 189 |██████████████████████▍ 189 - 190 |██████████████████████▌ 190 - 191 |██████████████████████▋ 191 - 192 |██████████████████████▊ 192 - 193 |██████████████████████▉ 193 - 194 |███████████████████████ 194 - 195 |███████████████████████▏ 195 - 196 |███████████████████████▎ 196 - 197 |███████████████████████▍ 197 - 198 |███████████████████████▌ 198 - 199 |███████████████████████▋ 199 - 200 |███████████████████████▊ 200 - 201 |███████████████████████▊ 201 - 202 |███████████████████████▉ 202 - 203 |████████████████████████ 203 - 204 |████████████████████████▏ 204 - 205 |████████████████████████▎ 205 - 206 |████████████████████████▍ 206 - 207 |████████████████████████▌ 207 - 208 |████████████████████████▋ 208 - 209 |████████████████████████▊ 209 - 210 |████████████████████████▉ 210 - 211 |█████████████████████████ 211 - 212 |█████████████████████████▏ 212 - 213 |█████████████████████████▎ 213 - 214 |█████████████████████████▍ 214 - 215 |█████████████████████████▌ 215 - 216 |█████████████████████████▋ 216 - 217 |█████████████████████████▊ 217 - 218 |█████████████████████████▉ 218 - 219 |██████████████████████████ 219 - 220 |██████████████████████████▏ 220 - 221 |██████████████████████████▏ 221 - 222 |██████████████████████████▎ 222 - 223 |██████████████████████████▍ 223 - 224 |██████████████████████████▌ 224 - 225 |██████████████████████████▋ 225 - 226 |██████████████████████████▊ 226 - 227 |██████████████████████████▉ 227 - 228 |███████████████████████████ 228 - 229 |███████████████████████████▏ 229 - 230 |███████████████████████████▎ 230 - 231 |███████████████████████████▍ 231 - 232 |███████████████████████████▌ 232 - 233 |███████████████████████████▋ 233 - 234 |███████████████████████████▊ 234 - 235 |███████████████████████████▉ 235 - 236 |████████████████████████████ 236 - 237 |████████████████████████████▏ 237 - 238 |████████████████████████████▎ 238 - 239 |████████████████████████████▍ 239 - 240 |████████████████████████████▌ 240 - 241 |████████████████████████████▌ 241 - 242 |████████████████████████████▋ 242 - 243 |████████████████████████████▊ 243 - 244 |████████████████████████████▉ 244 - 245 |█████████████████████████████ 245 - 246 |█████████████████████████████▏ 246 - 247 |█████████████████████████████▎ 247 - 248 |█████████████████████████████▍ 248 - 249 |█████████████████████████████▌ 249 - 250 |█████████████████████████████▋ 250 - 251 |█████████████████████████████▊ 251 - 252 |█████████████████████████████▉ 252 - 253 |██████████████████████████████ 253 - 254 |██████████████████████████████▏ 254 - 255 |██████████████████████████████▎ 255 - 256 |██████████████████████████████▍ 256 - 257 |██████████████████████████████▌ 257 - 258 |██████████████████████████████▋ 258 - 259 |██████████████████████████████▊ 259 - 260 |██████████████████████████████▉ 260 - 261 |██████████████████████████████▉ 261 - 262 |███████████████████████████████ 262 - 263 |███████████████████████████████▏ 263 - 264 |███████████████████████████████▎ 264 - 265 |███████████████████████████████▍ 265 - 266 |███████████████████████████████▌ 266 - 267 |███████████████████████████████▋ 267 - 268 |███████████████████████████████▊ 268 - 269 |███████████████████████████████▉ 269 - 270 |████████████████████████████████ 270 - 271 |████████████████████████████████▏ 271 - 272 |████████████████████████████████▎ 272 - 273 |████████████████████████████████▍ 273 - 274 |████████████████████████████████▌ 274 - 275 |████████████████████████████████▋ 275 - 276 |████████████████████████████████▊ 276 - 277 |████████████████████████████████▉ 277 - 278 |█████████████████████████████████ 278 - 279 |█████████████████████████████████▏ 279 - 280 |█████████████████████████████████▎ 280 - 281 |█████████████████████████████████▎ 281 - 282 |█████████████████████████████████▍ 282 - 283 |█████████████████████████████████▌ 283 - 284 |█████████████████████████████████▋ 284 - 285 |█████████████████████████████████▊ 285 - 286 |█████████████████████████████████▉ 286 - 287 |██████████████████████████████████ 287 - 288 |██████████████████████████████████▏ 288 - 289 |██████████████████████████████████▎ 289 - 290 |██████████████████████████████████▍ 290 - 291 |██████████████████████████████████▌ 291 - 292 |██████████████████████████████████▋ 292 - 293 |██████████████████████████████████▊ 293 - 294 |██████████████████████████████████▉ 294 - 295 |███████████████████████████████████ 295 - 296 |███████████████████████████████████▏ 296 - 297 |███████████████████████████████████▎ 297 - 298 |███████████████████████████████████▍ 298 - 299 |███████████████████████████████████▌ 299 - 300 |███████████████████████████████████▋ 300 - 301 |███████████████████████████████████▋ 301 - 302 |███████████████████████████████████▊ 302 - 303 |███████████████████████████████████▉ 303 - 304 |████████████████████████████████████ 304 - 305 |████████████████████████████████████▏ 305 - 306 |████████████████████████████████████▎ 306 - 307 |████████████████████████████████████▍ 307 - 308 |████████████████████████████████████▌ 308 - 309 |████████████████████████████████████▋ 309 - 310 |████████████████████████████████████▊ 310 - 311 |████████████████████████████████████▉ 311 - 312 |█████████████████████████████████████ 312 - 313 |█████████████████████████████████████▏ 313 - 314 |█████████████████████████████████████▎ 314 - 315 |█████████████████████████████████████▍ 315 - 316 |█████████████████████████████████████▌ 316 - 317 |█████████████████████████████████████▋ 317 - 318 |█████████████████████████████████████▊ 318 - 319 |█████████████████████████████████████▉ 319 - 320 |██████████████████████████████████████ 320 - 321 |██████████████████████████████████████ 320 - 322 |█████████████████████████████████████▉ 319 - 323 |█████████████████████████████████████▊ 318 - 324 |█████████████████████████████████████▋ 317 - 325 |█████████████████████████████████████▌ 316 - 326 |█████████████████████████████████████▍ 315 - 327 |█████████████████████████████████████▎ 314 - 328 |█████████████████████████████████████▏ 313 - 329 |█████████████████████████████████████ 312 - 330 |████████████████████████████████████▉ 311 - 331 |████████████████████████████████████▊ 310 - 332 |████████████████████████████████████▋ 309 - 333 |████████████████████████████████████▌ 308 - 334 |████████████████████████████████████▍ 307 - 335 |████████████████████████████████████▎ 306 - 336 |████████████████████████████████████▏ 305 - 337 |████████████████████████████████████ 304 - 338 |███████████████████████████████████▉ 303 - 339 |███████████████████████████████████▊ 302 - 340 |███████████████████████████████████▋ 301 - 341 |███████████████████████████████████▋ 300 - 342 |███████████████████████████████████▌ 299 - 343 |███████████████████████████████████▍ 298 - 344 |███████████████████████████████████▎ 297 - 345 |███████████████████████████████████▏ 296 - 346 |███████████████████████████████████ 295 - 347 |██████████████████████████████████▉ 294 - 348 |██████████████████████████████████▊ 293 - 349 |██████████████████████████████████▋ 292 - 350 |██████████████████████████████████▌ 291 - 351 |██████████████████████████████████▍ 290 - 352 |██████████████████████████████████▎ 289 - 353 |██████████████████████████████████▏ 288 - 354 |██████████████████████████████████ 287 - 355 |█████████████████████████████████▉ 286 - 356 |█████████████████████████████████▊ 285 - 357 |█████████████████████████████████▋ 284 - 358 |█████████████████████████████████▌ 283 - 359 |█████████████████████████████████▍ 282 - 360 |█████████████████████████████████▎ 281 - 361 |█████████████████████████████████▎ 280 - 362 |█████████████████████████████████▏ 279 - 363 |█████████████████████████████████ 278 - 364 |████████████████████████████████▉ 277 - 365 |████████████████████████████████▊ 276 - 366 |████████████████████████████████▋ 275 - 367 |████████████████████████████████▌ 274 - 368 |████████████████████████████████▍ 273 - 369 |████████████████████████████████▎ 272 - 370 |████████████████████████████████▏ 271 - 371 |████████████████████████████████ 270 - 372 |███████████████████████████████▉ 269 - 373 |███████████████████████████████▊ 268 - 374 |███████████████████████████████▋ 267 - 375 |███████████████████████████████▌ 266 - 376 |███████████████████████████████▍ 265 - 377 |███████████████████████████████▎ 264 - 378 |███████████████████████████████▏ 263 - 379 |███████████████████████████████ 262 - 380 |██████████████████████████████▉ 261 - 381 |██████████████████████████████▉ 260 - 382 |██████████████████████████████▊ 259 - 383 |██████████████████████████████▋ 258 - 384 |██████████████████████████████▌ 257 - 385 |██████████████████████████████▍ 256 - 386 |██████████████████████████████▎ 255 - 387 |██████████████████████████████▏ 254 - 388 |██████████████████████████████ 253 - 389 |█████████████████████████████▉ 252 - 390 |█████████████████████████████▊ 251 - 391 |█████████████████████████████▋ 250 - 392 |█████████████████████████████▌ 249 - 393 |█████████████████████████████▍ 248 - 394 |█████████████████████████████▎ 247 - 395 |█████████████████████████████▏ 246 - 396 |█████████████████████████████ 245 - 397 |████████████████████████████▉ 244 - 398 |████████████████████████████▊ 243 - 399 |████████████████████████████▋ 242 - 400 |████████████████████████████▌ 241 - 401 |████████████████████████████▌ 240 - 402 |████████████████████████████▍ 239 - 403 |████████████████████████████▎ 238 - 404 |████████████████████████████▏ 237 - 405 |████████████████████████████ 236 - 406 |███████████████████████████▉ 235 - 407 |███████████████████████████▊ 234 - 408 |███████████████████████████▋ 233 - 409 |███████████████████████████▌ 232 - 410 |███████████████████████████▍ 231 - 411 |███████████████████████████▎ 230 - 412 |███████████████████████████▏ 229 - 413 |███████████████████████████ 228 - 414 |██████████████████████████▉ 227 - 415 |██████████████████████████▊ 226 - 416 |██████████████████████████▋ 225 - 417 |██████████████████████████▌ 224 - 418 |██████████████████████████▍ 223 - 419 |██████████████████████████▎ 222 - 420 |██████████████████████████▏ 221 - 421 |██████████████████████████▏ 220 - 422 |██████████████████████████ 219 - 423 |█████████████████████████▉ 218 - 424 |█████████████████████████▊ 217 - 425 |█████████████████████████▋ 216 - 426 |█████████████████████████▌ 215 - 427 |█████████████████████████▍ 214 - 428 |█████████████████████████▎ 213 - 429 |█████████████████████████▏ 212 - 430 |█████████████████████████ 211 - 431 |████████████████████████▉ 210 - 432 |████████████████████████▊ 209 - 433 |████████████████████████▋ 208 - 434 |████████████████████████▌ 207 - 435 |████████████████████████▍ 206 - 436 |████████████████████████▎ 205 - 437 |████████████████████████▏ 204 - 438 |████████████████████████ 203 - 439 |███████████████████████▉ 202 - 440 |███████████████████████▊ 201 - 441 |███████████████████████▊ 200 - 442 |███████████████████████▋ 199 - 443 |███████████████████████▌ 198 - 444 |███████████████████████▍ 197 - 445 |███████████████████████▎ 196 - 446 |███████████████████████▏ 195 - 447 |███████████████████████ 194 - 448 |██████████████████████▉ 193 - 449 |██████████████████████▊ 192 - 450 |██████████████████████▋ 191 - 451 |██████████████████████▌ 190 - 452 |██████████████████████▍ 189 - 453 |██████████████████████▎ 188 - 454 |██████████████████████▏ 187 - 455 |██████████████████████ 186 - 456 |█████████████████████▉ 185 - 457 |█████████████████████▊ 184 - 458 |█████████████████████▋ 183 - 459 |█████████████████████▌ 182 - 460 |█████████████████████▍ 181 - 461 |█████████████████████▍ 180 - 462 |█████████████████████▎ 179 - 463 |█████████████████████▏ 178 - 464 |█████████████████████ 177 - 465 |████████████████████▉ 176 - 466 |████████████████████▊ 175 - 467 |████████████████████▋ 174 - 468 |████████████████████▌ 173 - 469 |████████████████████▍ 172 - 470 |████████████████████▎ 171 - 471 |████████████████████▏ 170 - 472 |████████████████████ 169 - 473 |███████████████████▉ 168 - 474 |███████████████████▊ 167 - 475 |███████████████████▋ 166 - 476 |███████████████████▌ 165 - 477 |███████████████████▍ 164 - 478 |███████████████████▎ 163 - 479 |███████████████████▏ 162 - 480 |███████████████████ 161 - 481 |███████████████████ 160 - 482 |██████████████████▉ 159 - 483 |██████████████████▊ 158 - 484 |██████████████████▋ 157 - 485 |██████████████████▌ 156 - 486 |██████████████████▍ 155 - 487 |██████████████████▎ 154 - 488 |██████████████████▏ 153 - 489 |██████████████████ 152 - 490 |█████████████████▉ 151 - 491 |█████████████████▊ 150 - 492 |█████████████████▋ 149 - 493 |█████████████████▌ 148 - 494 |█████████████████▍ 147 - 495 |█████████████████▎ 146 - 496 |█████████████████▏ 145 - 497 |█████████████████ 144 - 498 |████████████████▉ 143 - 499 |████████████████▊ 142 - 500 |████████████████▋ 141 - 501 |████████████████▋ 140 - 502 |████████████████▌ 139 - 503 |████████████████▍ 138 - 504 |████████████████▎ 137 - 505 |████████████████▏ 136 - 506 |████████████████ 135 - 507 |███████████████▉ 134 - 508 |███████████████▊ 133 - 509 |███████████████▋ 132 - 510 |███████████████▌ 131 - 511 |███████████████▍ 130 - 512 |███████████████▎ 129 - 513 |███████████████▏ 128 - 514 |███████████████ 127 - 515 |██████████████▉ 126 - 516 |██████████████▊ 125 - 517 |██████████████▋ 124 - 518 |██████████████▌ 123 - 519 |██████████████▍ 122 - 520 |██████████████▎ 121 - 521 |██████████████▎ 120 - 522 |██████████████▏ 119 - 523 |██████████████ 118 - 524 |█████████████▉ 117 - 525 |█████████████▊ 116 - 526 |█████████████▋ 115 - 527 |█████████████▌ 114 - 528 |█████████████▍ 113 - 529 |█████████████▎ 112 - 530 |█████████████▏ 111 - 531 |█████████████ 110 - 532 |████████████▉ 109 - 533 |████████████▊ 108 - 534 |████████████▋ 107 - 535 |████████████▌ 106 - 536 |████████████▍ 105 - 537 |████████████▎ 104 - 538 |████████████▏ 103 - 539 |████████████ 102 - 540 |███████████▉ 101 - 541 |███████████▉ 100 - 542 |███████████▊ 99 - 543 |███████████▋ 98 - 544 |███████████▌ 97 - 545 |███████████▍ 96 - 546 |███████████▎ 95 - 547 |███████████▏ 94 - 548 |███████████ 93 - 549 |██████████▉ 92 - 550 |██████████▊ 91 - 551 |██████████▋ 90 - 552 |██████████▌ 89 - 553 |██████████▍ 88 - 554 |██████████▎ 87 - 555 |██████████▏ 86 - 556 |██████████ 85 - 557 |█████████▉ 84 - 558 |█████████▊ 83 - 559 |█████████▋ 82 - 560 |█████████▌ 81 - 561 |█████████▌ 80 - 562 |█████████▍ 79 - 563 |█████████▎ 78 - 564 |█████████▏ 77 - 565 |█████████ 76 - 566 |████████▉ 75 - 567 |████████▊ 74 - 568 |████████▋ 73 - 569 |████████▌ 72 - 570 |████████▍ 71 - 571 |████████▎ 70 - 572 |████████▏ 69 - 573 |████████ 68 - 574 |███████▉ 67 - 575 |███████▊ 66 - 576 |███████▋ 65 - 577 |███████▌ 64 - 578 |███████▍ 63 - 579 |███████▎ 62 - 580 |███████▏ 61 - 581 |███████▏ 60 - 582 |███████ 59 - 583 |██████▉ 58 - 584 |██████▊ 57 - 585 |██████▋ 56 - 586 |██████▌ 55 - 587 |██████▍ 54 - 588 |██████▎ 53 - 589 |██████▏ 52 - 590 |██████ 51 - 591 |█████▉ 50 - 592 |█████▊ 49 - 593 |█████▋ 48 - 594 |█████▌ 47 - 595 |█████▍ 46 - 596 |█████▎ 45 - 597 |█████▏ 44 - 598 |█████ 43 - 599 |████▉ 42 - 600 |████▊ 41 - 601 |████▊ 40 - 602 |████▋ 39 - 603 |████▌ 38 - 604 |████▍ 37 - 605 |████▎ 36 - 606 |████▏ 35 - 607 |████ 34 - 608 |███▉ 33 - 609 |███▊ 32 - 610 |███▋ 31 - 611 |███▌ 30 - 612 |███▍ 29 - 613 |███▎ 28 - 614 |███▏ 27 - 615 |███ 26 - 616 |██▉ 25 - 617 |██▊ 24 - 618 |██▋ 23 - 619 |██▌ 22 - 620 |██▍ 21 - 621 |██▍ 20 - 622 |██▎ 19 - 623 |██▏ 18 - 624 |██ 17 - 625 |█▉ 16 - 626 |█▊ 15 - 627 |█▋ 14 - 628 |█▌ 13 - 629 |█▍ 12 - 630 |█▎ 11 - 631 |█▏ 10 - 632 |█ 9 - 633 |▉ 8 - 634 |▊ 7 - 635 |▋ 6 - 636 |▌ 5 - 637 |▍ 4 - 638 |▎ 3 - 639 |▏ 2 - >= 640 | 1 - - diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d deleted file mode 100644 index 317aece..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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); -} - diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out deleted file mode 100644 index d76e4da..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out +++ /dev/null @@ -1,38 +0,0 @@ - - - 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 - diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d deleted file mode 100644 index c9fdba7..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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); -} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out deleted file mode 100644 index 5300ebd..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out +++ /dev/null @@ -1,124 +0,0 @@ - - - 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 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh deleted file mode 100644 index e53a89b..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh +++ /dev/null @@ -1,75 +0,0 @@ -# -# 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 <= 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 - diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d deleted file mode 100644 index 537d1de..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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); -} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out deleted file mode 100644 index bc7ec00..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out +++ /dev/null @@ -1,149 +0,0 @@ - - 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 - diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d deleted file mode 100644 index 860a169..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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); -} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out deleted file mode 100644 index acddf7f..0000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out +++ /dev/null @@ -1,211 +0,0 @@ - - - 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 - - diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c index 6b571fa..b0f2b4a 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2011, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -1301,231 +1301,6 @@ dtrace_aggregate_walk(dtrace_hdl_t *dtp, dtrace_aggregate_f *func, void *arg) } 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); - - switch (rec->dtrd_action) { - case DTRACEAGG_STDDEV: - val = dt_stddev((uint64_t *)addr, 1); - break; - - case DTRACEAGG_SUM: - case DTRACEAGG_COUNT: - val = *addr; - break; - - case DTRACEAGG_AVG: - val = addr[0] ? (addr[1] / addr[0]) : 0; - break; - - default: - continue; - } - - if (total[agg->dtagd_varid] == NULL) { - total[agg->dtagd_varid] = aggdata; - aggdata->dtada_flags |= DTRACE_A_TOTAL; - } else { - aggdata = total[agg->dtagd_varid]; - } - - if (val > 0) - aggdata->dtada_flags |= DTRACE_A_HASPOSITIVES; - - if (val < 0) { - aggdata->dtada_flags |= DTRACE_A_HASNEGATIVES; - val = -val; - } - - if (dtp->dt_options[DTRACEOPT_AGGZOOM] != DTRACEOPT_UNSET) { - val = (int64_t)((long double)val * - (1 / DTRACE_AGGZOOM_MAX)); - - if (val > aggdata->dtada_total) - aggdata->dtada_total = val; - } else { - aggdata->dtada_total += val; - } - } - - /* - * And now one final pass to set everyone's total. - */ - for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) { - dtrace_aggdata_t *aggdata = &h->dtahe_data, *t; - dtrace_aggdesc_t *agg = aggdata->dtada_desc; - - if ((t = total[agg->dtagd_varid]) == NULL || aggdata == t) - continue; - - aggdata->dtada_total = t->dtada_total; - aggdata->dtada_flags |= (t->dtada_flags & tflags); - } - - dt_free(dtp, total); - - return (0); -} - -static int -dt_aggregate_minmaxbin(dtrace_hdl_t *dtp, boolean_t clear) -{ - dt_ahashent_t *h; - dtrace_aggdata_t **minmax; - dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id; - dt_aggregate_t *agp = &dtp->dt_aggregate; - dt_ahash_t *hash = &agp->dtat_hash; - - 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_minbin = 0; - aggdata->dtada_maxbin = 0; - aggdata->dtada_flags &= ~DTRACE_A_MINMAXBIN; - } - - if (clear || max == DTRACE_AGGVARIDNONE) - return (0); - - minmax = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *)); - - if (minmax == 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 *addr; - int minbin = -1, maxbin = -1, i; - int start = 0, size; - - rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1]; - size = rec->dtrd_size / sizeof (int64_t); - data = aggdata->dtada_data; - addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset); - - switch (rec->dtrd_action) { - case DTRACEAGG_LQUANTIZE: - /* - * For lquantize(), we always display the entire range - * of the aggregation when aggpack is set. - */ - start = 1; - minbin = start; - maxbin = size - 1 - start; - break; - - case DTRACEAGG_QUANTIZE: - for (i = start; i < size; i++) { - if (!addr[i]) - continue; - - if (minbin == -1) - minbin = i - start; - - maxbin = i - start; - } - - if (minbin == -1) { - /* - * If we have no data (e.g., due to a clear() - * or negative increments), we'll use the - * zero bucket as both our min and max. - */ - minbin = maxbin = DTRACE_QUANTIZE_ZEROBUCKET; - } - - break; - - default: - continue; - } - - if (minmax[agg->dtagd_varid] == NULL) { - minmax[agg->dtagd_varid] = aggdata; - aggdata->dtada_flags |= DTRACE_A_MINMAXBIN; - aggdata->dtada_minbin = minbin; - aggdata->dtada_maxbin = maxbin; - continue; - } - - if (minbin < minmax[agg->dtagd_varid]->dtada_minbin) - minmax[agg->dtagd_varid]->dtada_minbin = minbin; - - if (maxbin > minmax[agg->dtagd_varid]->dtada_maxbin) - minmax[agg->dtagd_varid]->dtada_maxbin = maxbin; - } - - /* - * And now one final pass to set everyone's minbin and maxbin. - */ - for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) { - dtrace_aggdata_t *aggdata = &h->dtahe_data, *mm; - dtrace_aggdesc_t *agg = aggdata->dtada_desc; - - if ((mm = minmax[agg->dtagd_varid]) == NULL || aggdata == mm) - continue; - - aggdata->dtada_minbin = mm->dtada_minbin; - aggdata->dtada_maxbin = mm->dtada_maxbin; - aggdata->dtada_flags |= DTRACE_A_MINMAXBIN; - } - - dt_free(dtp, minmax); - - return (0); -} - -static int dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, dtrace_aggregate_f *func, void *arg, int (*sfunc)(const void *, const void *)) @@ -1534,23 +1309,6 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, dt_ahashent_t *h, **sorted; dt_ahash_t *hash = &agp->dtat_hash; size_t i, nentries = 0; - int rval = -1; - - agp->dtat_flags &= ~(DTRACE_A_TOTAL | DTRACE_A_MINMAXBIN); - - if (dtp->dt_options[DTRACEOPT_AGGHIST] != DTRACEOPT_UNSET) { - agp->dtat_flags |= DTRACE_A_TOTAL; - - if (dt_aggregate_total(dtp, B_FALSE) != 0) - return (-1); - } - - if (dtp->dt_options[DTRACEOPT_AGGPACK] != DTRACEOPT_UNSET) { - agp->dtat_flags |= DTRACE_A_MINMAXBIN; - - if (dt_aggregate_minmaxbin(dtp, B_FALSE) != 0) - return (-1); - } for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) nentries++; @@ -1558,7 +1316,7 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, sorted = dt_alloc(dtp, nentries * sizeof (dt_ahashent_t *)); if (sorted == NULL) - goto out; + return (-1); for (h = hash->dtah_all, i = 0; h != NULL; h = h->dtahe_nextall) sorted[i++] = h; @@ -1582,20 +1340,14 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp, for (i = 0; i < nentries; i++) { h = sorted[i]; - if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1) - goto out; + if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1) { + dt_free(dtp, sorted); + return (-1); + } } - rval = 0; -out: - if (agp->dtat_flags & DTRACE_A_TOTAL) - (void) dt_aggregate_total(dtp, B_TRUE); - - if (agp->dtat_flags & DTRACE_A_MINMAXBIN) - (void) dt_aggregate_minmaxbin(dtp, B_TRUE); - dt_free(dtp, sorted); - return (rval); + return (0); } int @@ -2118,8 +1870,6 @@ dtrace_aggregate_print(dtrace_hdl_t *dtp, FILE *fp, { dt_print_aggdata_t pd; - bzero(&pd, sizeof (pd)); - pd.dtpa_dtp = dtp; pd.dtpa_fp = fp; pd.dtpa_allunprint = 1; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c index d255db8..8d9e494 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2011, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -59,25 +59,6 @@ dt_fabsl(long double x) return (x); } -static int -dt_ndigits(long long val) -{ - int rval = 1; - long long cmp = 10; - - if (val < 0) { - val = val == INT64_MIN ? INT64_MAX : -val; - rval++; - } - - while (val > cmp && cmp > 0) { - rval++; - cmp *= 10; - } - - return (rval < 4 ? 4 : rval); -} - /* * 128-bit arithmetic functions needed to support the stddev() aggregating * action. @@ -506,125 +487,7 @@ dt_nullrec() return (DTRACE_CONSUME_NEXT); } -static void -dt_quantize_total(dtrace_hdl_t *dtp, int64_t datum, long double *total) -{ - long double val = dt_fabsl((long double)datum); - - if (dtp->dt_options[DTRACEOPT_AGGZOOM] == DTRACEOPT_UNSET) { - *total += val; - return; - } - - /* - * If we're zooming in on an aggregation, we want the height of the - * highest value to be approximately 95% of total bar height -- so we - * adjust up by the reciprocal of DTRACE_AGGZOOM_MAX when comparing to - * our highest value. - */ - val *= 1 / DTRACE_AGGZOOM_MAX; - - if (*total < val) - *total = val; -} - -static int -dt_print_quanthdr(dtrace_hdl_t *dtp, FILE *fp, int width) -{ - return (dt_printf(dtp, fp, "\n%*s %41s %-9s\n", - width ? width : 16, width ? "key" : "value", - "------------- Distribution -------------", "count")); -} - -static int -dt_print_quanthdr_packed(dtrace_hdl_t *dtp, FILE *fp, int width, - const dtrace_aggdata_t *aggdata, dtrace_actkind_t action) -{ - int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin; - int minwidth, maxwidth, i; - - assert(action == DTRACEAGG_QUANTIZE || action == DTRACEAGG_LQUANTIZE); - - if (action == DTRACEAGG_QUANTIZE) { - if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET) - min--; - - if (max < DTRACE_QUANTIZE_NBUCKETS - 1) - max++; - - minwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(min)); - maxwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(max)); - } else { - maxwidth = 8; - minwidth = maxwidth - 1; - max++; - } - - if (dt_printf(dtp, fp, "\n%*s %*s .", - width, width > 0 ? "key" : "", minwidth, "min") < 0) - return (-1); - - for (i = min; i <= max; i++) { - if (dt_printf(dtp, fp, "-") < 0) - return (-1); - } - - return (dt_printf(dtp, fp, ". %*s | count\n", -maxwidth, "max")); -} - -/* - * We use a subset of the Unicode Block Elements (U+2588 through U+258F, - * inclusive) to represent aggregations via UTF-8 -- which are expressed via - * 3-byte UTF-8 sequences. - */ -#define DTRACE_AGGUTF8_FULL 0x2588 -#define DTRACE_AGGUTF8_BASE 0x258f -#define DTRACE_AGGUTF8_LEVELS 8 - -#define DTRACE_AGGUTF8_BYTE0(val) (0xe0 | ((val) >> 12)) -#define DTRACE_AGGUTF8_BYTE1(val) (0x80 | (((val) >> 6) & 0x3f)) -#define DTRACE_AGGUTF8_BYTE2(val) (0x80 | ((val) & 0x3f)) - -static int -dt_print_quantline_utf8(dtrace_hdl_t *dtp, FILE *fp, int64_t val, - uint64_t normal, long double total) -{ - uint_t len = 40, i, whole, partial; - long double f = (dt_fabsl((long double)val) * len) / total; - const char *spaces = " "; - - whole = (uint_t)f; - partial = (uint_t)((f - (long double)(uint_t)f) * - (long double)DTRACE_AGGUTF8_LEVELS); - - if (dt_printf(dtp, fp, "|") < 0) - return (-1); - - for (i = 0; i < whole; i++) { - if (dt_printf(dtp, fp, "%c%c%c", - DTRACE_AGGUTF8_BYTE0(DTRACE_AGGUTF8_FULL), - DTRACE_AGGUTF8_BYTE1(DTRACE_AGGUTF8_FULL), - DTRACE_AGGUTF8_BYTE2(DTRACE_AGGUTF8_FULL)) < 0) - return (-1); - } - - if (partial != 0) { - partial = DTRACE_AGGUTF8_BASE - (partial - 1); - - if (dt_printf(dtp, fp, "%c%c%c", - DTRACE_AGGUTF8_BYTE0(partial), - DTRACE_AGGUTF8_BYTE1(partial), - DTRACE_AGGUTF8_BYTE2(partial)) < 0) - return (-1); - - i++; - } - - return (dt_printf(dtp, fp, "%s %-9lld\n", spaces + i, - (long long)val / normal)); -} - -static int +int dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val, uint64_t normal, long double total, char positives, char negatives) { @@ -642,11 +505,6 @@ dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val, if (!negatives) { if (positives) { - if (dtp->dt_encoding == DT_ENCODING_UTF8) { - return (dt_print_quantline_utf8(dtp, fp, val, - normal, total)); - } - f = (dt_fabsl((long double)val) * len) / total; depth = (uint_t)(f + 0.5); } else { @@ -689,77 +547,6 @@ dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val, } } -/* - * As with UTF-8 printing of aggregations, we use a subset of the Unicode - * Block Elements (U+2581 through U+2588, inclusive) to represent our packed - * aggregation. - */ -#define DTRACE_AGGPACK_BASE 0x2581 -#define DTRACE_AGGPACK_LEVELS 8 - -static int -dt_print_packed(dtrace_hdl_t *dtp, FILE *fp, - long double datum, long double total) -{ - static boolean_t utf8_checked = 0; - static boolean_t utf8; - char *ascii = "__xxxxXX"; - char *neg = "vvvvVV"; - unsigned int len; - long double val; - - while (!utf8_checked) { - char *term; - - /* - * We want to determine if we can reasonably emit UTF-8 for our - * packed aggregation. To do this, we will check for terminals - * that are known to be primitive to emit UTF-8 on these. - */ - utf8_checked = B_TRUE; - - if (dtp->dt_encoding == DT_ENCODING_ASCII) - break; - - if (dtp->dt_encoding == DT_ENCODING_UTF8) { - utf8 = B_TRUE; - break; - } - - if ((term = getenv("TERM")) != NULL && - (strcmp(term, "sun") == 0 || - strcmp(term, "sun-color") == 0) || - strcmp(term, "dumb") == 0) { - break; - } - - utf8 = B_TRUE; - } - - if (datum == 0) - return (dt_printf(dtp, fp, " ")); - - if (datum < 0) { - len = strlen(neg); - val = dt_fabsl(datum * (len - 1)) / total; - return (dt_printf(dtp, fp, "%c", neg[(uint_t)(val + 0.5)])); - } - - if (utf8) { - int block = DTRACE_AGGPACK_BASE + (unsigned int)(((datum * - (DTRACE_AGGPACK_LEVELS - 1)) / total) + 0.5); - - return (dt_printf(dtp, fp, "%c%c%c", - DTRACE_AGGUTF8_BYTE0(block), - DTRACE_AGGUTF8_BYTE1(block), - DTRACE_AGGUTF8_BYTE2(block))); - } - - len = strlen(ascii); - val = (datum * (len - 1)) / total; - return (dt_printf(dtp, fp, "%c", ascii[(uint_t)(val + 0.5)])); -} - int dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, size_t size, uint64_t normal) @@ -777,9 +564,9 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, if (first_bin == DTRACE_QUANTIZE_NBUCKETS - 1) { /* - * There isn't any data. This is possible if the aggregation - * has been clear()'d or if negative increment values have been - * used. Regardless, we'll print the buckets around 0. + * There isn't any data. This is possible if (and only if) + * negative increment values have been used. In this case, + * we'll print the buckets around 0. */ first_bin = DTRACE_QUANTIZE_ZEROBUCKET - 1; last_bin = DTRACE_QUANTIZE_ZEROBUCKET + 1; @@ -797,10 +584,11 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); - dt_quantize_total(dtp, data[i], &total); + total += dt_fabsl((long double)data[i]); } - if (dt_print_quanthdr(dtp, fp, 0) < 0) + if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value", + "------------- Distribution -------------", "count") < 0) return (-1); for (i = first_bin; i <= last_bin; i++) { @@ -817,48 +605,6 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, } int -dt_print_quantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr, - size_t size, const dtrace_aggdata_t *aggdata) -{ - const int64_t *data = addr; - long double total = 0, count = 0; - int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin, i; - int64_t minval, maxval; - - if (size != DTRACE_QUANTIZE_NBUCKETS * sizeof (uint64_t)) - return (dt_set_errno(dtp, EDT_DMISMATCH)); - - if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET) - min--; - - if (max < DTRACE_QUANTIZE_NBUCKETS - 1) - max++; - - minval = DTRACE_QUANTIZE_BUCKETVAL(min); - maxval = DTRACE_QUANTIZE_BUCKETVAL(max); - - if (dt_printf(dtp, fp, " %*lld :", dt_ndigits(minval), - (long long)minval) < 0) - return (-1); - - for (i = min; i <= max; i++) { - dt_quantize_total(dtp, data[i], &total); - count += data[i]; - } - - for (i = min; i <= max; i++) { - if (dt_print_packed(dtp, fp, data[i], total) < 0) - return (-1); - } - - if (dt_printf(dtp, fp, ": %*lld | %lld\n", - -dt_ndigits(maxval), (long long)maxval, (long long)count) < 0) - return (-1); - - return (0); -} - -int dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, size_t size, uint64_t normal) { @@ -905,7 +651,7 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); - dt_quantize_total(dtp, data[i], &total); + total += dt_fabsl((long double)data[i]); } if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value", @@ -917,7 +663,8 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, int err; if (i == 0) { - (void) snprintf(c, sizeof (c), "< %d", base); + (void) snprintf(c, sizeof (c), "< %d", + base / (uint32_t)normal); err = dt_printf(dtp, fp, "%16s ", c); } else if (i == levels + 1) { (void) snprintf(c, sizeof (c), ">= %d", @@ -936,59 +683,6 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, return (0); } -/*ARGSUSED*/ -int -dt_print_lquantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr, - size_t size, const dtrace_aggdata_t *aggdata) -{ - const int64_t *data = addr; - long double total = 0, count = 0; - int min, max, base, err; - uint64_t arg; - uint16_t step, levels; - char c[32]; - unsigned int i; - - if (size < sizeof (uint64_t)) - return (dt_set_errno(dtp, EDT_DMISMATCH)); - - arg = *data++; - size -= sizeof (uint64_t); - - base = DTRACE_LQUANTIZE_BASE(arg); - step = DTRACE_LQUANTIZE_STEP(arg); - levels = DTRACE_LQUANTIZE_LEVELS(arg); - - if (size != sizeof (uint64_t) * (levels + 2)) - return (dt_set_errno(dtp, EDT_DMISMATCH)); - - min = 0; - max = levels + 1; - - if (min == 0) { - (void) snprintf(c, sizeof (c), "< %d", base); - err = dt_printf(dtp, fp, "%8s :", c); - } else { - err = dt_printf(dtp, fp, "%8d :", base + (min - 1) * step); - } - - if (err < 0) - return (-1); - - for (i = min; i <= max; i++) { - dt_quantize_total(dtp, data[i], &total); - count += data[i]; - } - - for (i = min; i <= max; i++) { - if (dt_print_packed(dtp, fp, data[i], total) < 0) - return (-1); - } - - (void) snprintf(c, sizeof (c), ">= %d", base + (levels * step)); - return (dt_printf(dtp, fp, ": %-8s | %lld\n", c, (long long)count)); -} - int dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, size_t size, uint64_t normal) @@ -1046,7 +740,7 @@ dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); - dt_quantize_total(dtp, data[i], &total); + total += dt_fabsl((long double)data[i]); } if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value", @@ -1129,7 +823,7 @@ dt_print_stddev(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, } /*ARGSUSED*/ -static int +int dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, size_t nbytes, int width, int quiet, int forceraw) { @@ -1182,12 +876,10 @@ dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, if (j != nbytes) break; - if (quiet) { + if (quiet) return (dt_printf(dtp, fp, "%s", c)); - } else { - return (dt_printf(dtp, fp, " %s%*s", - width < 0 ? " " : "", width, c)); - } + else + return (dt_printf(dtp, fp, " %-*s", width, c)); } break; @@ -2101,83 +1793,10 @@ dt_trunc(dtrace_hdl_t *dtp, caddr_t base, dtrace_recdesc_t *rec) static int dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec, - caddr_t addr, size_t size, const dtrace_aggdata_t *aggdata, - uint64_t normal, dt_print_aggdata_t *pd) + caddr_t addr, size_t size, uint64_t normal) { - int err, width; + int err; dtrace_actkind_t act = rec->dtrd_action; - boolean_t packed = pd->dtpa_agghist || pd->dtpa_aggpack; - dtrace_aggdesc_t *agg = aggdata->dtada_desc; - - static struct { - size_t size; - int width; - int packedwidth; - } *fmt, fmttab[] = { - { sizeof (uint8_t), 3, 3 }, - { sizeof (uint16_t), 5, 5 }, - { sizeof (uint32_t), 8, 8 }, - { sizeof (uint64_t), 16, 16 }, - { 0, -50, 16 } - }; - - if (packed && pd->dtpa_agghisthdr != agg->dtagd_varid) { - dtrace_recdesc_t *r; - - width = 0; - - /* - * To print our quantization header for either an agghist or - * aggpack aggregation, we need to iterate through all of our - * of our records to determine their width. - */ - for (r = rec; !DTRACEACT_ISAGG(r->dtrd_action); r++) { - for (fmt = fmttab; fmt->size && - fmt->size != r->dtrd_size; fmt++) - continue; - - width += fmt->packedwidth + 1; - } - - if (pd->dtpa_agghist) { - if (dt_print_quanthdr(dtp, fp, width) < 0) - return (-1); - } else { - if (dt_print_quanthdr_packed(dtp, fp, - width, aggdata, r->dtrd_action) < 0) - return (-1); - } - - pd->dtpa_agghisthdr = agg->dtagd_varid; - } - - if (pd->dtpa_agghist && DTRACEACT_ISAGG(act)) { - char positives = aggdata->dtada_flags & DTRACE_A_HASPOSITIVES; - char negatives = aggdata->dtada_flags & DTRACE_A_HASNEGATIVES; - int64_t val; - - assert(act == DTRACEAGG_SUM || act == DTRACEAGG_COUNT); - val = (long long)*((uint64_t *)addr); - - if (dt_printf(dtp, fp, " ") < 0) - return (-1); - - return (dt_print_quantline(dtp, fp, val, normal, - aggdata->dtada_total, positives, negatives)); - } - - if (pd->dtpa_aggpack && DTRACEACT_ISAGG(act)) { - switch (act) { - case DTRACEAGG_QUANTIZE: - return (dt_print_quantize_packed(dtp, - fp, addr, size, aggdata)); - case DTRACEAGG_LQUANTIZE: - return (dt_print_lquantize_packed(dtp, - fp, addr, size, aggdata)); - default: - break; - } - } switch (act) { case DTRACEACT_STACK: @@ -2220,33 +1839,28 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec, break; } - for (fmt = fmttab; fmt->size && fmt->size != size; fmt++) - continue; - - width = packed ? fmt->packedwidth : fmt->width; - switch (size) { case sizeof (uint64_t): - err = dt_printf(dtp, fp, " %*lld", width, + err = dt_printf(dtp, fp, " %16lld", /* LINTED - alignment */ (long long)*((uint64_t *)addr) / normal); break; case sizeof (uint32_t): /* LINTED - alignment */ - err = dt_printf(dtp, fp, " %*d", width, *((uint32_t *)addr) / + err = dt_printf(dtp, fp, " %8d", *((uint32_t *)addr) / (uint32_t)normal); break; case sizeof (uint16_t): /* LINTED - alignment */ - err = dt_printf(dtp, fp, " %*d", width, *((uint16_t *)addr) / + err = dt_printf(dtp, fp, " %5d", *((uint16_t *)addr) / (uint32_t)normal); break; case sizeof (uint8_t): - err = dt_printf(dtp, fp, " %*d", width, *((uint8_t *)addr) / + err = dt_printf(dtp, fp, " %3d", *((uint8_t *)addr) / (uint32_t)normal); break; default: - err = dt_print_bytes(dtp, fp, addr, size, width, 0, 0); + err = dt_print_bytes(dtp, fp, addr, size, 50, 0, 0); break; } @@ -2267,9 +1881,6 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) caddr_t addr; size_t size; - pd->dtpa_agghist = (aggdata->dtada_flags & DTRACE_A_TOTAL); - pd->dtpa_aggpack = (aggdata->dtada_flags & DTRACE_A_MINMAXBIN); - /* * Iterate over each record description in the key, printing the traced * data, skipping the first datum (the tuple member created by the @@ -2286,8 +1897,7 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) break; } - if (dt_print_datum(dtp, fp, rec, addr, - size, aggdata, 1, pd) < 0) + if (dt_print_datum(dtp, fp, rec, addr, size, 1) < 0) return (-1); if (dt_buffered_flush(dtp, NULL, rec, aggdata, @@ -2310,8 +1920,7 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) assert(DTRACEACT_ISAGG(act)); normal = aggdata->dtada_normal; - if (dt_print_datum(dtp, fp, rec, addr, - size, aggdata, normal, pd) < 0) + if (dt_print_datum(dtp, fp, rec, addr, size, normal) < 0) return (-1); if (dt_buffered_flush(dtp, NULL, rec, aggdata, @@ -2322,10 +1931,8 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) agg->dtagd_flags |= DTRACE_AGD_PRINTED; } - if (!pd->dtpa_agghist && !pd->dtpa_aggpack) { - if (dt_printf(dtp, fp, "\n") < 0) - return (-1); - } + if (dt_printf(dtp, fp, "\n") < 0) + return (-1); if (dt_buffered_flush(dtp, NULL, NULL, aggdata, DTRACE_BUFDATA_AGGFORMAT | DTRACE_BUFDATA_AGGLAST) < 0) @@ -2794,7 +2401,7 @@ nofmt: } n = dt_print_bytes(dtp, fp, addr, - tracememsize, -33, quiet, 1); + tracememsize, 33, quiet, 1); tracememsize = 0; @@ -2827,7 +2434,7 @@ nofmt: break; default: n = dt_print_bytes(dtp, fp, addr, - rec->dtrd_size, -33, quiet, 0); + rec->dtrd_size, 33, quiet, 0); break; } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h index feea9f7..2bae220 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h @@ -189,9 +189,6 @@ typedef struct dt_print_aggdata { dtrace_aggvarid_t dtpa_id; /* aggregation variable of interest */ FILE *dtpa_fp; /* file pointer */ int dtpa_allunprint; /* print only unprinted aggregations */ - int dtpa_agghist; /* print aggregation as histogram */ - int dtpa_agghisthdr; /* aggregation histogram hdr printed */ - int dtpa_aggpack; /* pack quantized aggregations */ } dt_print_aggdata_t; typedef struct dt_dirpath { @@ -286,7 +283,6 @@ struct dtrace_hdl { uint_t dt_linktype; /* dtrace link output file type (see below) */ uint_t dt_xlatemode; /* dtrace translator linking mode (see below) */ uint_t dt_stdcmode; /* dtrace stdc compatibility mode (see below) */ - uint_t dt_encoding; /* dtrace output encoding (see below) */ uint_t dt_treedump; /* dtrace tree debug bitmap (see below) */ uint64_t dt_options[DTRACEOPT_MAX]; /* dtrace run-time options */ int dt_version; /* library version requested by client */ @@ -378,14 +374,6 @@ struct dtrace_hdl { #define DT_STDC_XT 3 /* ISO C + K&R C compat with ISO: __STDC__=0 */ /* - * Values for the dt_encoding property, which is used to force a particular - * character encoding (overriding default behavior and/or automatic detection). - */ -#define DT_ENCODING_UNSET 0 -#define DT_ENCODING_ASCII 1 -#define DT_ENCODING_UTF8 2 - -/* * Macro to test whether a given pass bit is set in the dt_treedump bit-vector. * If the bit for pass 'p' is set, the D compiler displays the parse tree for * the program by printing it to stderr at the end of compiler pass 'p'. diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index 192ef0c..92251d5 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -122,14 +122,9 @@ #define DT_VERS_1_8_1 DT_VERSION_NUMBER(1, 8, 1) #define DT_VERS_1_9 DT_VERSION_NUMBER(1, 9, 0) #define DT_VERS_1_9_1 DT_VERSION_NUMBER(1, 9, 1) -#define DT_VERS_1_9_2 DT_VERSION_NUMBER(1, 9, 2) /* FreeBSD specific */ -#define DT_VERS_1_10 DT_VERSION_NUMBER(1, 10, 0) -#define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0) -#define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0) -#define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1) -#define DT_VERS_LATEST DT_VERS_1_9_2 -#define DT_VERS_STRING "Sun D 1.9.2" - +#define DT_VERS_LATEST DT_VERS_1_9_1 +#define DT_VERS_STRING "Sun D 1.9.1" + const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ DT_VERS_1_1, /* D API 1.1.0 Solaris Express 6/05 */ @@ -150,11 +145,6 @@ const dt_version_t _dtrace_versions[] = { DT_VERS_1_8_1, /* D API 1.8.1 */ DT_VERS_1_9, /* D API 1.9 */ DT_VERS_1_9_1, /* D API 1.9.1 */ - DT_VERS_1_9_2, /* D API 1.9.1 */ - DT_VERS_1_10, /* D API 1.10 */ - DT_VERS_1_11, /* D API 1.11 */ - DT_VERS_1_12, /* D API 1.12 */ - DT_VERS_1_12_1, /* D API 1.12.1 */ 0 }; @@ -1154,7 +1144,6 @@ alloc: dtp->dt_linktype = DT_LTYP_ELF; dtp->dt_xlatemode = DT_XL_STATIC; dtp->dt_stdcmode = DT_STDC_XA; - dtp->dt_encoding = DT_ENCODING_UNSET; dtp->dt_version = version; dtp->dt_fd = dtfd; dtp->dt_ftfd = ftfd; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c index 832af88..c20d250 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c @@ -25,7 +25,6 @@ */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -339,23 +338,6 @@ dt_opt_linktype(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) /*ARGSUSED*/ static int -dt_opt_encoding(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) -{ - if (arg == NULL) - return (dt_set_errno(dtp, EDT_BADOPTVAL)); - - if (strcmp(arg, "ascii") == 0) - dtp->dt_encoding = DT_ENCODING_ASCII; - else if (strcmp(arg, "utf8") == 0) - dtp->dt_encoding = DT_ENCODING_UTF8; - else - return (dt_set_errno(dtp, EDT_BADOPTVAL)); - - return (0); -} - -/*ARGSUSED*/ -static int dt_opt_evaltime(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) { if (arg == NULL) @@ -946,7 +928,6 @@ static const dt_option_t _dtrace_ctoptions[] = { { "define", dt_opt_cpp_opts, (uintptr_t)"-D" }, { "droptags", dt_opt_droptags }, { "empty", dt_opt_cflags, DTRACE_C_EMPTY }, - { "encoding", dt_opt_encoding }, { "errtags", dt_opt_cflags, DTRACE_C_ETAGS }, { "evaltime", dt_opt_evaltime }, { "incdir", dt_opt_cpp_opts, (uintptr_t)"-I" }, @@ -1007,14 +988,11 @@ static const dt_option_t _dtrace_rtoptions[] = { * Dynamic run-time options. */ static const dt_option_t _dtrace_drtoptions[] = { - { "agghist", dt_opt_runtime, DTRACEOPT_AGGHIST }, - { "aggpack", dt_opt_runtime, DTRACEOPT_AGGPACK }, { "aggrate", dt_opt_rate, DTRACEOPT_AGGRATE }, { "aggsortkey", dt_opt_runtime, DTRACEOPT_AGGSORTKEY }, { "aggsortkeypos", dt_opt_runtime, DTRACEOPT_AGGSORTKEYPOS }, { "aggsortpos", dt_opt_runtime, DTRACEOPT_AGGSORTPOS }, { "aggsortrev", dt_opt_runtime, DTRACEOPT_AGGSORTREV }, - { "aggzoom", dt_opt_runtime, DTRACEOPT_AGGZOOM }, { "flowindent", dt_opt_runtime, DTRACEOPT_FLOWINDENT }, { "quiet", dt_opt_runtime, DTRACEOPT_QUIET }, { "rawbytes", dt_opt_runtime, DTRACEOPT_RAWBYTES }, diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index cbaa03f..b2e3108 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -356,12 +356,6 @@ extern int dtrace_handle_setopt(dtrace_hdl_t *, #define DTRACE_A_PERCPU 0x0001 #define DTRACE_A_KEEPDELTA 0x0002 #define DTRACE_A_ANONYMOUS 0x0004 -#define DTRACE_A_TOTAL 0x0008 -#define DTRACE_A_MINMAXBIN 0x0010 -#define DTRACE_A_HASNEGATIVES 0x0020 -#define DTRACE_A_HASPOSITIVES 0x0040 - -#define DTRACE_AGGZOOM_MAX 0.95 /* height of max bar */ #define DTRACE_AGGWALK_ERROR -1 /* error while processing */ #define DTRACE_AGGWALK_NEXT 0 /* proceed to next element */ @@ -382,10 +376,6 @@ struct dtrace_aggdata { caddr_t dtada_delta; /* delta data, if available */ caddr_t *dtada_percpu; /* per CPU data, if avail */ caddr_t *dtada_percpu_delta; /* per CPU delta, if avail */ - int64_t dtada_total; /* per agg total, if avail */ - uint16_t dtada_minbin; /* minimum bin, if avail */ - uint16_t dtada_maxbin; /* maximum bin, if avail */ - uint32_t dtada_flags; /* flags */ }; typedef int dtrace_aggregate_f(const dtrace_aggdata_t *, void *); -- cgit v1.1 From b14d31acfe746e87bae81feaeeb78f15dc35ed86 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Thu, 26 Jun 2014 22:38:06 +0000 Subject: Add stubs for CTF functions which are not yet implemented. MFC after: 2 weeks --- cddl/lib/libdtrace/libproc_compat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cddl') diff --git a/cddl/lib/libdtrace/libproc_compat.h b/cddl/lib/libdtrace/libproc_compat.h index d796f34..7e54ada 100644 --- a/cddl/lib/libdtrace/libproc_compat.h +++ b/cddl/lib/libdtrace/libproc_compat.h @@ -45,8 +45,10 @@ #define Pgrab_error strerror #define Plmid_to_map(p, l, o) proc_obj2map((p), (o)) #define Plookup_by_addr proc_addr2sym +#define Pname_to_ctf(p, obj) NULL #define Pname_to_map proc_name2map #define Pobject_iter proc_iter_objs +#define Pobject_iter_resolved(p, f, arg) 1 #define Pobjname proc_objname #define Pread proc_read #define Prd_agent proc_rdagent -- cgit v1.1 From 0d7d731791d57691c640cdbdae4769591b0f68eb Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 1 Jul 2014 07:29:42 +0000 Subject: MFV r267566: 4390 i/o errors when deleting filesystem/zvol can lead to space map corruption MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zdb/zdb.c | 4 ++-- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 6346635..5974878 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -75,9 +75,9 @@ DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES)) #ifndef lint -extern int zfs_recover; +extern boolean_t zfs_recover; #else -int zfs_recover; +boolean_t zfs_recover; #endif const char cmdname[] = "zdb"; diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index 02f0b96..c344c94 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -303,6 +303,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, case ZPOOL_PROP_ALLOCATED: case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: + case ZPOOL_PROP_LEAKED: case ZPOOL_PROP_EXPANDSZ: if (literal) { (void) snprintf(buf, len, "%llu", -- cgit v1.1 From 5f023415af5aa5803be6fbd6e2760782f4a6ad53 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 1 Jul 2014 08:20:34 +0000 Subject: MFV r267568: 4891 want zdb option to dump all metadata illumos/illumos-gate@df15e419cb7359ba56ddddab9045e438d89e7cbc MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zdb/zdb.8 | 13 ++++++++++-- cddl/contrib/opensolaris/cmd/zdb/zdb.c | 17 ++++++++++----- .../opensolaris/lib/libzpool/common/kernel.c | 24 ++++++++++++++++++++++ .../lib/libzpool/common/sys/zfs_context.h | 2 ++ 4 files changed, 49 insertions(+), 7 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.8 b/cddl/contrib/opensolaris/cmd/zdb/zdb.8 index e59f370..41b99ac 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.8 +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.8 @@ -14,12 +14,12 @@ .\" .\" Copyright 2012, Richard Lowe. .\" Copyright (c) 2012, Marcelo Araujo . -.\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" Copyright (c) 2012, 2014 by Delphix. All rights reserved. .\" All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd July 1, 2014 .Dt ZDB 8 .Os .Sh NAME @@ -32,6 +32,7 @@ .Op Fl t Ar txg .Op Fl U Ar cache .Op Fl M Ar inflight I/Os +.Op Fl x Ar dumpdir .Ar poolname .Op Ar object ... .Nm @@ -217,6 +218,14 @@ Operate on an exported pool, not present in The .Fl p flag specifies the path under which devices are to be searched. +.It Fl x Ar dumpdir +All blocks accessed will be copied to files in the specified directory. +The blocks will be placed in sparse files whose name is the same as +that of the file or device read. zdb can be then run on the generated files. +Note that the +.Fl bbc +flags are sufficient to access (and thus copy) +all metadata on the pool. .It Fl F Attempt to make an unreadable pool readable by trying progressively older transactions. diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 5974878..038cc28 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -112,7 +112,7 @@ usage(void) { (void) fprintf(stderr, "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " - "[-U config] [-M inflight I/Os] poolname [object...]\n" + "[-U config] [-M inflight I/Os] [-x dumpdir] poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " @@ -150,7 +150,7 @@ usage(void) (void) fprintf(stderr, " -R read and display block from a " "device\n\n"); (void) fprintf(stderr, " Below options are intended for use " - "with other options (except -l):\n"); + "with other options:\n"); (void) fprintf(stderr, " -A ignore assertions (-A), enable " "panic recovery (-AA) or both (-AAA)\n"); (void) fprintf(stderr, " -F attempt automatic rewind within " @@ -163,11 +163,14 @@ usage(void) "has altroot/not in a cachefile\n"); (void) fprintf(stderr, " -p -- use one or more with " "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -P print numbers in parseable form\n"); + (void) fprintf(stderr, " -x -- " + "dump all read blocks into specified directory\n"); + (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); (void) fprintf(stderr, " -M -- " - "specify the maximum number of checksumming I/Os [default is 200]"); + "specify the maximum number of " + "checksumming I/Os [default is 200]\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -3355,7 +3358,8 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); - while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) { + while ((c = getopt(argc, argv, + "bcdhilmM:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3408,6 +3412,9 @@ main(int argc, char **argv) } searchdirs[nsearch++] = optarg; break; + case 'x': + vn_dumpdir = optarg; + break; case 't': max_txg = strtoull(optarg, NULL, 0); if (max_txg < TXG_INITIAL) { diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c index 2b174f9..c61c5c2 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c +++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,9 @@ char hw_serial[HW_HOSTID_LEN]; kmutex_t cpu_lock; #endif +/* If set, all blocks read will be copied to the specified directory. */ +char *vn_dumpdir = NULL; + struct utsname utsname = { "userland", "libzpool", "1", "1", "na" }; @@ -415,6 +419,7 @@ int vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3) { int fd; + int dump_fd; vnode_t *vp; int old_umask; char realpath[MAXPATHLEN]; @@ -463,6 +468,17 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3) if (flags & FCREAT) (void) umask(old_umask); + if (vn_dumpdir != NULL) { + char dumppath[MAXPATHLEN]; + (void) snprintf(dumppath, sizeof (dumppath), + "%s/%s", vn_dumpdir, basename(realpath)); + dump_fd = open64(dumppath, O_CREAT | O_WRONLY, 0666); + if (dump_fd == -1) + return (errno); + } else { + dump_fd = -1; + } + if (fd == -1) return (errno); @@ -478,6 +494,7 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3) vp->v_fd = fd; vp->v_size = st.st_size; vp->v_path = spa_strdup(path); + vp->v_dump_fd = dump_fd; return (0); } @@ -510,6 +527,11 @@ vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset, if (uio == UIO_READ) { iolen = pread64(vp->v_fd, addr, len, offset); + if (vp->v_dump_fd != -1) { + int status = + pwrite64(vp->v_dump_fd, addr, iolen, offset); + ASSERT(status != -1); + } } else { /* * To simulate partial disk writes, we split writes into two @@ -536,6 +558,8 @@ void vn_close(vnode_t *vp, int openflag, cred_t *cr, kthread_t *td) { close(vp->v_fd); + if (vp->v_dump_fd != -1) + close(vp->v_dump_fd); spa_strfree(vp->v_path); umem_free(vp, sizeof (vnode_t)); } diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h index cc8285d..03027c3 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h +++ b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h @@ -424,8 +424,10 @@ typedef struct vnode { uint64_t v_size; int v_fd; char *v_path; + int v_dump_fd; } vnode_t; +extern char *vn_dumpdir; #define AV_SCANSTAMP_SZ 32 /* length of anti-virus scanstamp */ typedef struct xoptattr { -- cgit v1.1 From 0b2372b19519751cb4401277788ddabf61585521 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 1 Jul 2014 08:36:56 +0000 Subject: MFV r267570: 4756 metaslab_group_preload() could deadlock illumos/illumos-gate@30beaff42d8240ebf5386e8b7a14e3d137a1631f MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/ztest/ztest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/ztest/ztest.c b/cddl/contrib/opensolaris/cmd/ztest/ztest.c index c0ece98..8f5d7ce 100644 --- a/cddl/contrib/opensolaris/cmd/ztest/ztest.c +++ b/cddl/contrib/opensolaris/cmd/ztest/ztest.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -187,6 +187,7 @@ static const ztest_shared_opts_t ztest_opts_defaults = { extern uint64_t metaslab_gang_bang; extern uint64_t metaslab_df_alloc_threshold; extern uint64_t zfs_deadman_synctime_ms; +extern int metaslab_preload_limit; static ztest_shared_opts_t *ztest_shared_opts; static ztest_shared_opts_t ztest_opts; @@ -5596,6 +5597,7 @@ ztest_run(ztest_shared_t *zs) kernel_init(FREAD | FWRITE); VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG)); spa->spa_debug = B_TRUE; + metaslab_preload_limit = ztest_random(20) + 1; ztest_spa = spa; VERIFY0(dmu_objset_own(ztest_opts.zo_pool, -- cgit v1.1 From be1d315a0495d0ceec39374f3f49a5674595bf93 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 1 Jul 2014 20:57:39 +0000 Subject: - Fix handling of "new" style of ioctl in compatiblity mode [1]; - Reorganize code and reduce diff from upstream; - Improve forward compatibility shims for previous kernel; Reported by: sbruno [1] X-MFC-With: r268075 --- .../opensolaris/lib/libzfs/common/libzfs_compat.c | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c index 3c8119d..a3f6129 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c @@ -72,16 +72,23 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) if (zfs_ioctl_version == ZFS_IOCVER_UNDEF) zfs_ioctl_version = get_zfs_ioctl_version(); - if (zfs_ioctl_version == ZFS_IOCVER_LZC) - cflag = ZFS_CMD_COMPAT_LZC; - else if (zfs_ioctl_version == ZFS_IOCVER_DEADMAN) - cflag = ZFS_CMD_COMPAT_DEADMAN; - - /* - * If vfs.zfs.version.ioctl is not defined, assume we have v28 - * compatible binaries and use vfs.zfs.version.spa to test for v15 - */ - if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) { + if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { + switch (zfs_ioctl_version) { + case ZFS_IOCVER_ZCMD: + cflag = ZFS_CMD_COMPAT_ZCMD; + break; + case ZFS_IOCVER_LZC: + cflag = ZFS_CMD_COMPAT_LZC; + break; + case ZFS_IOCVER_DEADMAN: + cflag = ZFS_CMD_COMPAT_DEADMAN; + break; + } + } else { + /* + * If vfs.zfs.version.ioctl is not defined, assume we have v28 + * compatible binaries and use vfs.zfs.version.spa to test for v15 + */ cflag = ZFS_CMD_COMPAT_V28; if (zfs_spa_version < 0) -- cgit v1.1 From 6012f0ab3a6d68d680ff3f02df97deb938177c2c Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 1 Jul 2014 21:51:30 +0000 Subject: MFV r268119: 4914 zfs on-disk bookmark structure should be named *_phys_t illumos/illumos-gate@7802d7bf98dec568dadf72286893b1fe5abd8602 MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zdb/zdb.c | 19 ++++++++++--------- cddl/contrib/opensolaris/cmd/zdb/zdb_il.c | 4 ++-- .../opensolaris/lib/libzfs/common/libzfs_pool.c | 21 ++++++++++++--------- 3 files changed, 24 insertions(+), 20 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 038cc28..37c5aee 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -1035,7 +1035,8 @@ dump_dnode(objset_t *os, uint64_t object, void *data, size_t size) } static uint64_t -blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, const zbookmark_t *zb) +blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, + const zbookmark_phys_t *zb) { if (dnp == NULL) { ASSERT(zb->zb_level < 0); @@ -1097,7 +1098,7 @@ snprintf_blkptr_compact(char *blkbuf, size_t buflen, const blkptr_t *bp) } static void -print_indirect(blkptr_t *bp, const zbookmark_t *zb, +print_indirect(blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp) { char blkbuf[BP_SPRINTF_LEN]; @@ -1126,7 +1127,7 @@ print_indirect(blkptr_t *bp, const zbookmark_t *zb, static int visit_indirect(spa_t *spa, const dnode_phys_t *dnp, - blkptr_t *bp, const zbookmark_t *zb) + blkptr_t *bp, const zbookmark_phys_t *zb) { int err = 0; @@ -1152,7 +1153,7 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp, /* recursively visit blocks below this */ cbp = buf->b_data; for (i = 0; i < epb; i++, cbp++) { - zbookmark_t czb; + zbookmark_phys_t czb; SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, @@ -1176,7 +1177,7 @@ dump_indirect(dnode_t *dn) { dnode_phys_t *dnp = dn->dn_phys; int j; - zbookmark_t czb; + zbookmark_phys_t czb; (void) printf("Indirect blocks:\n"); @@ -2248,7 +2249,7 @@ zdb_blkptr_done(zio_t *zio) blkptr_t *bp = zio->io_bp; int ioerr = zio->io_error; zdb_cb_t *zcb = zio->io_private; - zbookmark_t *zb = &zio->io_bookmark; + zbookmark_phys_t *zb = &zio->io_bookmark; zio_data_buf_free(zio->io_data, zio->io_size); @@ -2283,7 +2284,7 @@ zdb_blkptr_done(zio_t *zio) /* ARGSUSED */ static int zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { zdb_cb_t *zcb = arg; dmu_object_type_t type; @@ -2747,7 +2748,7 @@ typedef struct zdb_ddt_entry { /* ARGSUSED */ static int zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { avl_tree_t *t = arg; avl_index_t where; diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c b/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c index 17f7ad3..583e422 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ /* @@ -122,7 +122,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr) { char *data, *dlimit; blkptr_t *bp = &lr->lr_blkptr; - zbookmark_t zb; + zbookmark_phys_t zb; char buf[SPA_MAXBLOCKSIZE]; int verbose = MAX(dump_opt['d'], dump_opt['i']); int error; diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index c344c94..f6e84f8 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -3513,7 +3513,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv, static int zbookmark_compare(const void *a, const void *b) { - return (memcmp(a, b, sizeof (zbookmark_t))); + return (memcmp(a, b, sizeof (zbookmark_phys_t))); } /* @@ -3525,7 +3525,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp) { zfs_cmd_t zc = { 0 }; uint64_t count; - zbookmark_t *zb = NULL; + zbookmark_phys_t *zb = NULL; int i; /* @@ -3538,7 +3538,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp) if (count == 0) return (0); if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl, - count * sizeof (zbookmark_t))) == (uintptr_t)NULL) + count * sizeof (zbookmark_phys_t))) == (uintptr_t)NULL) return (-1); zc.zc_nvlist_dst_size = count; (void) strcpy(zc.zc_name, zhp->zpool_name); @@ -3547,11 +3547,14 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp) &zc) != 0) { free((void *)(uintptr_t)zc.zc_nvlist_dst); if (errno == ENOMEM) { + void *dst; + count = zc.zc_nvlist_dst_size; - if ((zc.zc_nvlist_dst = (uintptr_t) - zfs_alloc(zhp->zpool_hdl, count * - sizeof (zbookmark_t))) == (uintptr_t)NULL) + dst = zfs_alloc(zhp->zpool_hdl, count * + sizeof (zbookmark_phys_t)); + if (dst == NULL) return (-1); + zc.zc_nvlist_dst = (uintptr_t)dst; } else { return (-1); } @@ -3567,11 +3570,11 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp) * _not_ copied as part of the process. So we point the start of our * array appropriate and decrement the total number of elements. */ - zb = ((zbookmark_t *)(uintptr_t)zc.zc_nvlist_dst) + + zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) + zc.zc_nvlist_dst_size; count -= zc.zc_nvlist_dst_size; - qsort(zb, count, sizeof (zbookmark_t), zbookmark_compare); + qsort(zb, count, sizeof (zbookmark_phys_t), zbookmark_compare); verify(nvlist_alloc(nverrlistp, 0, KM_SLEEP) == 0); -- cgit v1.1 From 3218d43e56858300ce0f3750a0863debe8192c28 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 1 Jul 2014 22:31:09 +0000 Subject: MFV r268121: 4924 LZ4 Compression for metadata illumos/illumos-gate@b8289d24d866c1af02d7007348f7f057693c15d3 MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 b/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 index d0f3ab2..437b374 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2014 +.Dd July 1, 2014 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -235,14 +235,11 @@ administrator can turn on compression on any dataset on the pool using the .Xr zfs 8 -command. Please note that doing so will -immediately activate the -.Sy lz4_compress -feature on the underlying -pool -.Pq even before any data is written , -and the feature will not be -deactivated. +command. +Also, all newly written metadata +will be compressed with +.Sy lz4 +algorithm. Since this feature is not read-only compatible, this operation will render the pool unimportable on systems without support for the @@ -251,6 +248,12 @@ feature. Booting off of .Sy lz4 -compressed root pools is supported. +.Pp +This feature becomes +.Sy active +as soon as it is enabled and will +never return to being +.Sy enabled . .It Sy multi_vdev_crash_dump .Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump" .It GUID Ta com.joyent:multi_vdev_crash_dump -- cgit v1.1 From 9f28abd980752efcf77578cd494f1015083c2a2b Mon Sep 17 00:00:00 2001 From: marcel Date: Mon, 7 Jul 2014 00:27:09 +0000 Subject: Remove ia64. This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan --- .../opensolaris/lib/libdtrace/common/dt_link.c | 24 ++-------------------- cddl/lib/libzpool/Makefile | 2 +- 2 files changed, 3 insertions(+), 23 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c index f31c600..2a43211 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c @@ -230,9 +230,6 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf32_t *dep) #if defined(__arm__) /* XXX */ printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); -#elif defined(__ia64__) -/* XXX */ -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); #elif defined(__i386) || defined(__amd64) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; @@ -424,8 +421,6 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf64_t *dep) #ifdef DOODAD #if defined(__arm__) /* XXX */ -#elif defined(__ia64__) -/* XXX */ #elif defined(__mips__) /* XXX */ #elif defined(__powerpc__) @@ -535,8 +530,6 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd) elf_file.ehdr.e_type = ET_REL; #if defined(__arm__) elf_file.ehdr.e_machine = EM_ARM; -#elif defined(__ia64__) - elf_file.ehdr.e_machine = EM_IA_64; #elif defined(__mips__) elf_file.ehdr.e_machine = EM_MIPS; #elif defined(__powerpc__) @@ -683,8 +676,6 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd) elf_file.ehdr.e_type = ET_REL; #if defined(__arm__) elf_file.ehdr.e_machine = EM_ARM; -#elif defined(__ia64__) - elf_file.ehdr.e_machine = EM_IA_64; #elif defined(__mips__) elf_file.ehdr.e_machine = EM_MIPS; #elif defined(__powerpc__) @@ -814,15 +805,6 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); return (0); } -#elif defined(__ia64__) -/* XXX */ -static int -dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, - uint32_t *off) -{ -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); - return (0); -} #elif defined(__mips__) /* XXX */ static int @@ -1235,9 +1217,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) if (dtp->dt_oflags & DTRACE_O_LP64) { eclass = ELFCLASS64; -#if defined(__ia64__) - emachine1 = emachine2 = EM_IA_64; -#elif defined(__mips__) +#if defined(__mips__) emachine1 = emachine2 = EM_MIPS; #elif defined(__powerpc__) emachine1 = emachine2 = EM_PPC64; @@ -1258,7 +1238,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) #elif defined(__sparc) emachine1 = EM_SPARC; emachine2 = EM_SPARC32PLUS; -#elif defined(__i386) || defined(__amd64) || defined(__ia64__) +#elif defined(__i386) || defined(__amd64) emachine1 = emachine2 = EM_386; #endif symsize = sizeof (Elf32_Sym); diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index 7d4528f..8f60a20 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -14,7 +14,7 @@ .if exists(${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S -.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64" +.if ${MACHINE_ARCH} != "sparc64" ACFLAGS+= -Wa,--noexecstack .endif .else -- cgit v1.1 From cb7e625917dd35e628dc02b563096d239afaba52 Mon Sep 17 00:00:00 2001 From: delphij Date: Wed, 9 Jul 2014 20:57:42 +0000 Subject: MFV r268453: Diff reduction against Illumos. MFC after: 2 weeks --- .../opensolaris/lib/libzfs/common/libzfs_dataset.c | 16 +++++++--------- .../opensolaris/lib/libzfs/common/libzfs_mount.c | 22 ++++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index 11378a2..d7126bf 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. @@ -3873,7 +3873,6 @@ zfs_rename(zfs_handle_t *zhp, const char *source, const char *target, strcmp(property, "none") == 0)) { flags.nounmount = B_TRUE; } - if (flags.recurse) { parentname = zfs_strdup(zhp->zfs_hdl, zhp->zfs_name); @@ -3888,8 +3887,7 @@ zfs_rename(zfs_handle_t *zhp, const char *source, const char *target, ret = -1; goto error; } - - } else { + } else if (zhp->zfs_type != ZFS_TYPE_SNAPSHOT) { if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, flags.forceunmount ? MS_FORCE : 0)) == NULL) { @@ -3941,23 +3939,23 @@ zfs_rename(zfs_handle_t *zhp, const char *source, const char *target, * On failure, we still want to remount any filesystems that * were previously mounted, so we don't alter the system state. */ - if (!flags.recurse) + if (cl != NULL) (void) changelist_postfix(cl); } else { - if (!flags.recurse) { + if (cl != NULL) { changelist_rename(cl, zfs_get_name(zhp), target); ret = changelist_postfix(cl); } } error: - if (parentname) { + if (parentname != NULL) { free(parentname); } - if (zhrp) { + if (zhrp != NULL) { zfs_close(zhrp); } - if (cl) { + if (cl != NULL) { changelist_free(cl); } return (ret); diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c index b2959dd..f8596ed 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014 by Delphix. All rights reserved. */ /* @@ -736,16 +737,6 @@ zfs_share_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto) if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) return (0); -#ifdef sun - if ((ret = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { - (void) zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, - dgettext(TEXT_DOMAIN, "cannot share '%s': %s"), - zfs_get_name(zhp), _sa_errorstr != NULL ? - _sa_errorstr(ret) : ""); - return (-1); - } -#endif - for (curr_proto = proto; *curr_proto != PROTO_END; curr_proto++) { /* * Return success if there are no share options. @@ -756,6 +747,17 @@ zfs_share_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto) strcmp(shareopts, "off") == 0) continue; +#ifdef illumos + ret = zfs_init_libshare(hdl, SA_INIT_SHARE_API); + if (ret != SA_OK) { + (void) zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, + dgettext(TEXT_DOMAIN, "cannot share '%s': %s"), + zfs_get_name(zhp), _sa_errorstr != NULL ? + _sa_errorstr(ret) : ""); + return (-1); + } +#endif + /* * If the 'zoned' property is set, then zfs_is_mountable() * will have already bailed out if we are in the global zone. -- cgit v1.1 From 9b45140041c09da644d27b76a72bd4d08340b70c Mon Sep 17 00:00:00 2001 From: delphij Date: Wed, 9 Jul 2014 21:07:20 +0000 Subject: MFV r268454: Refresh zpool list for each interval in order to produce fresh output. Illumos issue: 4966 zpool list iterator does not update output MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index bec5e70..7f27bb0 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -3076,17 +3076,10 @@ zpool_do_list(int argc, char **argv) if (zprop_get_list(g_zfs, props, &cb.cb_proplist, ZFS_TYPE_POOL) != 0) usage(B_FALSE); - if ((list = pool_list_get(argc, argv, &cb.cb_proplist, &ret)) == NULL) - return (1); - - if (argc == 0 && !cb.cb_scripted && pool_list_count(list) == 0) { - (void) printf(gettext("no pools available\n")); - zprop_free_list(cb.cb_proplist); - return (0); - } - for (;;) { - pool_list_update(list); + if ((list = pool_list_get(argc, argv, &cb.cb_proplist, + &ret)) == NULL) + return (1); if (pool_list_count(list) == 0) break; @@ -3109,9 +3102,16 @@ zpool_do_list(int argc, char **argv) if (count != 0 && --count == 0) break; + pool_list_free(list); (void) sleep(interval); } + if (argc == 0 && !cb.cb_scripted && pool_list_count(list) == 0) { + (void) printf(gettext("no pools available\n")); + ret = 0; + } + + pool_list_free(list); zprop_free_list(cb.cb_proplist); return (ret); } -- cgit v1.1 From 7c6811e6756423b54c7c0411ede07f860bfebce2 Mon Sep 17 00:00:00 2001 From: delphij Date: Wed, 9 Jul 2014 23:14:59 +0000 Subject: MFV r268455: Use reserved space for ZFS administrative commands. We reserve 1/2^spa_slop_shift = 1/32 or 3.125% of pool space (or 32MB at least) for system use. Most ZPL operations, e.g. write(2), creat(2), will fail with ENOSPC if we fall below this. Certain operations, e.g. file removal and most administrative actions, still permitted until half of the slop space is used. This would allow users to use these operations to free up space in the pool when pool is close to full but half of slop space is still free. A very restricted set of operations that frees up space or change quota are always permitted, regardless of the amount of free space. MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zfs/zfs_main.c | 7 +++++-- cddl/contrib/opensolaris/cmd/zhack/zhack.c | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c index a6dba38..a3b461e 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . @@ -6856,6 +6856,9 @@ zfs_do_bookmark(int argc, char **argv) case ENOTSUP: err_msg = "bookmark feature not enabled"; break; + case ENOSPC: + err_msg = "out of space"; + break; default: err_msg = "unknown error"; break; @@ -6864,7 +6867,7 @@ zfs_do_bookmark(int argc, char **argv) dgettext(TEXT_DOMAIN, err_msg)); } - return (ret); + return (ret != 0); usage: usage(B_FALSE); diff --git a/cddl/contrib/opensolaris/cmd/zhack/zhack.c b/cddl/contrib/opensolaris/cmd/zhack/zhack.c index ace8c32..6e3f029 100644 --- a/cddl/contrib/opensolaris/cmd/zhack/zhack.c +++ b/cddl/contrib/opensolaris/cmd/zhack/zhack.c @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -362,7 +362,7 @@ zhack_do_feature_enable(int argc, char **argv) feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, - zhack_feature_enable_sync, &feature, 5)); + zhack_feature_enable_sync, &feature, 5, ZFS_SPACE_CHECK_NORMAL)); spa_close(spa, FTAG); @@ -473,7 +473,8 @@ zhack_do_feature_ref(int argc, char **argv) } VERIFY0(dsl_sync_task(spa_name(spa), NULL, - decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); + decr ? feature_decr_sync : feature_incr_sync, &feature, + 5, ZFS_SPACE_CHECK_NORMAL)); spa_close(spa, FTAG); } -- cgit v1.1 From 5563475471e7bc782d1966087e7aa4dfa6473d9e Mon Sep 17 00:00:00 2001 From: smh Date: Mon, 14 Jul 2014 14:33:03 +0000 Subject: Don't report non-native block-size pools under zpool status -x zpool status -x is used to identify pools that are exhibiting errors or are otherwise unavailable, therefore non-native block-size pools shouldn't be reported. Also update man page to clarify other additional conditions which won't cause a pool to be displayed under zpool status -x. Sponsored by: Multiplay --- cddl/contrib/opensolaris/cmd/zpool/zpool.8 | 3 ++- cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 index 26c37c8..ca0ae88 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 @@ -1664,7 +1664,8 @@ can change. .It Fl x Only display status for pools that are exhibiting errors or are otherwise unavailable. -Warnings about pools not using the latest on-disk format will not be included. +Warnings about pools not using the latest on-disk format, having non-native +block size or disabled features will not be included. .It Fl v Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub. diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 7f27bb0..28fdd80 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -4101,6 +4101,7 @@ status_callback(zpool_handle_t *zhp, void *data) if (cbp->cb_explain && (reason == ZPOOL_STATUS_OK || reason == ZPOOL_STATUS_VERSION_OLDER || + reason == ZPOOL_STATUS_NON_NATIVE_ASHIFT || reason == ZPOOL_STATUS_FEAT_DISABLED)) { if (!cbp->cb_allpools) { (void) printf(gettext("pool '%s' is healthy\n"), -- cgit v1.1 From ba32c2f8ac94143a06c0fec9e944eec7ede4798c Mon Sep 17 00:00:00 2001 From: delphij Date: Mon, 14 Jul 2014 17:54:36 +0000 Subject: Bump mdoc date after r268621. X-MFC-With: r268621 --- cddl/contrib/opensolaris/cmd/zpool/zpool.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 index ca0ae88..c0bcd4d 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2014 +.Dd July 14, 2014 .Dt ZPOOL 8 .Os .Sh NAME -- cgit v1.1 From cd85118a8b75bc9e408f964d99f2ffce809dcf9e Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 15 Jul 2014 22:44:04 +0000 Subject: MFV r268714: Improve extreme rewind import. When doing an "extreme rewind" import ("zpool import -XF"), we attempt to verify all data in the pool, essentially scrubbing the entire pool. The problem is that spa_load_verify_cb() issues an unbounded number of concurrent scrub i/os. This can lead to all of memory being used for these zio's, wedging the system. Like normal scrub, we need to put a cap on the number of outstanding i/os, and have the traverse thread block when we reach this cap. For this purpose the cap can be very large (10,000) to optimize the elevator algorithm. Three kernel tunables have been added: vfs.zfs.spa_load_verify_maxinflight vfs.zfs.spa_load_verify_metadata vfs.zfs.spa_load_verify_data The latter two tunables controls whether metadata and/or user data when doing extreme rewind. Make 'zpool import -T' imply scrub. Make zpool import -T accept hexadecimal values for the txg when prefixed with 0x. Skip txg's for which there is no uberblock when doing extreme rewind. Skip reading all user data twice by skipping prefetches when doing extreme rewinds as we do not access via the ARC. Illumos issues: 4970 need controls on i/o issued by zpool import -XF 4971 zpool import -T should accept hex values 4972 zpool import -T implies extreme rewind, and thus a scrub 4973 spa_load_retry retries the same txg 4974 spa_load_verify() reads all data twice MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 28fdd80..3228994 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. @@ -2033,7 +2033,7 @@ zpool_do_import(int argc, char **argv) break; case 'T': errno = 0; - txg = strtoull(optarg, &endptr, 10); + txg = strtoull(optarg, &endptr, 0); if (errno != 0 || *endptr != '\0') { (void) fprintf(stderr, gettext("invalid txg value\n")); -- cgit v1.1 From 9db99dff71d01cbbaa246dc65ca4ebd4202b6ba7 Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 18 Jul 2014 20:41:40 +0000 Subject: MFV r268848: Instead of asserting all zio's be properly aligned, only assert on the logical ones. Cap uberblocks at 8k, otherwise with ashift=17, there would be only one uberblock. This fixes a problem that zdb would trip assert on pools with ashift >= 0xe (8k). While there, also change the code so it only attempt to condense space map unless the uncondensed size consumes greater than zfs_metaslab_condense_block_threshold blocks. Illumos issue: 4958 zdb trips assert on pools with ashift >= 0xe MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/ztest/ztest.c | 43 +++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/ztest/ztest.c b/cddl/contrib/opensolaris/cmd/ztest/ztest.c index 8f5d7ce..3327161 100644 --- a/cddl/contrib/opensolaris/cmd/ztest/ztest.c +++ b/cddl/contrib/opensolaris/cmd/ztest/ztest.c @@ -810,7 +810,7 @@ static uint64_t ztest_get_ashift(void) { if (ztest_opts.zo_ashift == 0) - return (SPA_MINBLOCKSHIFT + ztest_random(3)); + return (SPA_MINBLOCKSHIFT + ztest_random(5)); return (ztest_opts.zo_ashift); } @@ -969,11 +969,28 @@ ztest_random_spa_version(uint64_t initial_version) return (version); } +/* + * Find the largest ashift used + */ +static uint64_t +ztest_spa_get_ashift() { + uint64_t i; + uint64_t ashift = SPA_MINBLOCKSHIFT; + vdev_t *rvd = ztest_spa->spa_root_vdev; + + for (i = 0; i < rvd->vdev_children; i++) { + ashift = MAX(ashift, rvd->vdev_child[i]->vdev_ashift); + } + return (ashift); +} + static int ztest_random_blocksize(void) { - return (1 << (SPA_MINBLOCKSHIFT + - ztest_random(SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1))); + // Choose a block size >= the ashift. + uint64_t block_shift = + ztest_random(SPA_MAXBLOCKSHIFT - ztest_spa_get_ashift() + 1); + return (1 << (SPA_MINBLOCKSHIFT + block_shift)); } static int @@ -5768,16 +5785,30 @@ ztest_freeze(void) spa_freeze(spa); /* + * Because it is hard to predict how much space a write will actually + * require beforehand, we leave ourselves some fudge space to write over + * capacity. + */ + uint64_t capacity = metaslab_class_get_space(spa_normal_class(spa)) / 2; + + /* * Run tests that generate log records but don't alter the pool config * or depend on DSL sync tasks (snapshots, objset create/destroy, etc). * We do a txg_wait_synced() after each iteration to force the txg * to increase well beyond the last synced value in the uberblock. * The ZIL should be OK with that. + * + * Run a random number of times less than zo_maxloops and ensure we do + * not run out of space on the pool. */ while (ztest_random(10) != 0 && - numloops++ < ztest_opts.zo_maxloops) { - ztest_dmu_write_parallel(zd, 0); - ztest_dmu_object_alloc_free(zd, 0); + numloops++ < ztest_opts.zo_maxloops && + metaslab_class_get_alloc(spa_normal_class(spa)) < capacity) { + ztest_od_t od; + ztest_od_init(&od, 0, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0); + VERIFY0(ztest_object_init(zd, &od, sizeof (od), B_FALSE)); + ztest_io(zd, od.od_object, + ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT); txg_wait_synced(spa_get_dsl(spa), 0); } -- cgit v1.1 From 319211bb802d37ccb7a939ffbb40f08f23c00f0b Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 25 Jul 2014 22:58:55 +0000 Subject: Diff reduction against Illumos. MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zpool/zpool.8 | 21 +++++++++++++++------ cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 index c0bcd4d..a76e75c 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2014 +.Dd July 25, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -556,7 +556,12 @@ will decrease while .Sy free increases. .It Sy expandsize -This property has currently no value on FreeBSD. +Amount of uninitialized space within the pool or device that can be used to +increase the total capacity of the pool. +Uninitialized space consists of +any space on an EFI labeled vdev which has not been brought online +.Pq i.e. zpool online -e . +This space occurs when a LUN is dynamically expanded. .It Sy guid A unique identifier for the pool. .It Sy health @@ -1391,7 +1396,10 @@ instead of arbitrary space. .It Fl p Display numbers in parsable (exact) values. .It Fl v -Show more detailed information. +Verbose statistics. Reports usage statistics for individual +.Em vdevs +within +the pool, in addition to the pool-wide statistics. .It Fl o Ar property Ns Op , Ns Ar ... Comma-separated list of properties to display. See the .Qq Sx Properties @@ -1400,6 +1408,7 @@ section for a list of valid properties. The default list is .Sy size , .Sy used , .Sy available , +.Sy expandsize , .Sy capacity , .Sy health , .Sy altroot . @@ -1785,9 +1794,9 @@ is immediately available to any datasets within the pool. The following command lists all available pools on the system. .Bd -literal -offset 2n .Li # Ic zpool list -NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT -pool 2.70T 473G 2.24T 17% 1.00x ONLINE - -test 1.98G 89.5K 1.98G 0% 1.00x ONLINE - +NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT +pool 2.70T 473G 2.24T - 17% 1.00x ONLINE - +test 1.98G 89.5K 1.98G - 0% 1.00x ONLINE - .Ed .It Sy Example 7 No Listing All Properties for a Pool .Pp diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 3228994..74e07f1 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -3031,7 +3031,7 @@ zpool_do_list(int argc, char **argv) int ret; list_cbdata_t cb = { 0 }; static char default_props[] = - "name,size,allocated,free,capacity,dedupratio," + "name,size,allocated,free,expandsize,capacity,dedupratio," "health,altroot"; char *props = default_props; unsigned long interval = 0, count = 0; -- cgit v1.1 From 0f4faf42cbb855fd26557197bdcea66a237af96c Mon Sep 17 00:00:00 2001 From: delphij Date: Sat, 26 Jul 2014 10:20:48 +0000 Subject: MFV r269010: Import Illumos changes to address the following Illumos issues: 4976 zfs should only avoid writing to a failing non-redundant top-level vdev 4978 ztest fails in get_metaslab_refcount() 4979 extend free space histogram to device and pool 4980 metaslabs should have a fragmentation metric 4981 remove fragmented ops vector from block allocator 4982 space_map object should proactively upgrade when feature is enabled 4984 device selection should use fragmentation metric MFC after: 2 weeks --- cddl/contrib/opensolaris/cmd/zdb/zdb.8 | 17 +++-- cddl/contrib/opensolaris/cmd/zdb/zdb.c | 79 +++++++++++++++++----- cddl/contrib/opensolaris/cmd/zpool/zpool.8 | 64 ++++++++++++++---- cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 17 +++-- .../opensolaris/lib/libzfs/common/libzfs_pool.c | 8 +++ 5 files changed, 144 insertions(+), 41 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.8 b/cddl/contrib/opensolaris/cmd/zdb/zdb.8 index 41b99ac..4ef437e 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.8 +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.8 @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2014 +.Dd July 26, 2014 .Dt ZDB 8 .Os .Sh NAME @@ -27,11 +27,11 @@ .Nd Display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Op Fl CumdibcsDvhLXFPA +.Op Fl CumdibcsDvhLMXFPA .Op Fl e Op Fl p Ar path... .Op Fl t Ar txg .Op Fl U Ar cache -.Op Fl M Ar inflight I/Os +.Op Fl I Ar inflight I/Os .Op Fl x Ar dumpdir .Ar poolname .Op Ar object ... @@ -42,7 +42,7 @@ .Ar dataset .Op Ar object ... .Nm -.Fl m Op Fl LXFPA +.Fl m Op Fl MLXFPA .Op Fl t Ar txg .Op Fl e Op Fl p Ar path... .Op Fl U Ar cache @@ -155,6 +155,13 @@ By default, verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. +When specified twice, also display information about the on-disk free +space histogram associated with each metaslab. When specified three time, +display the maximum contiguous free space, the in-core free space histogram, +and the percentage of free space in each space map. When specified +four times display every spacemap record. +.It Fl M +Display the offset, spacemap, and free space of each metaslab. When specified twice, also display information about the maximum contiguous free space and the percentage of free space in each space map. When specified three times display every spacemap record. @@ -229,7 +236,7 @@ all metadata on the pool. .It Fl F Attempt to make an unreadable pool readable by trying progressively older transactions. -.It Fl M Ar inflight I/Os +.It Fl I Ar inflight I/Os Limit the number of outstanding checksum I/Os to the specified value. The default value is 200. This option affects the performance of the .Fl c diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 37c5aee..04970fc 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -111,11 +111,11 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " - "[-U config] [-M inflight I/Os] [-x dumpdir] poolname [object...]\n" + "Usage: %s [-CumMdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " + "[-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" - " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " + " %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " "poolname [vdev [metaslab...]]\n" " %s -R [-A] [-e [-p path...]] poolname " "vdev:offset:size[:flags]\n" @@ -138,6 +138,7 @@ usage(void) (void) fprintf(stderr, " -h pool history\n"); (void) fprintf(stderr, " -b block statistics\n"); (void) fprintf(stderr, " -m metaslabs\n"); + (void) fprintf(stderr, " -M metaslab groups\n"); (void) fprintf(stderr, " -c checksum all metadata (twice for " "all data) blocks\n"); (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); @@ -168,7 +169,7 @@ usage(void) (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); - (void) fprintf(stderr, " -M -- " + (void) fprintf(stderr, " -I -- " "specify the maximum number of " "checksumming I/Os [default is 200]\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " @@ -548,7 +549,7 @@ get_metaslab_refcount(vdev_t *vd) { int refcount = 0; - if (vd->vdev_top == vd) { + if (vd->vdev_top == vd && !vd->vdev_removing) { for (int m = 0; m < vd->vdev_ms_count; m++) { space_map_t *sm = vd->vdev_ms[m]->ms_sm; @@ -686,9 +687,10 @@ dump_metaslab(metaslab_t *msp) * The space map histogram represents free space in chunks * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). */ - (void) printf("\tOn-disk histogram:\n"); + (void) printf("\tOn-disk histogram:\t\tfragmentation %llu\n", + (u_longlong_t)msp->ms_fragmentation); dump_histogram(sm->sm_phys->smp_histogram, - SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift); } if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { @@ -713,6 +715,47 @@ print_vdev_metaslab_header(vdev_t *vd) } static void +dump_metaslab_groups(spa_t *spa) +{ + vdev_t *rvd = spa->spa_root_vdev; + metaslab_class_t *mc = spa_normal_class(spa); + uint64_t fragmentation; + + metaslab_class_histogram_verify(mc); + + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + if (mg->mg_class != mc) + continue; + + metaslab_group_histogram_verify(mg); + mg->mg_fragmentation = metaslab_group_fragmentation(mg); + + (void) printf("\tvdev %10llu\t\tmetaslabs%5llu\t\t" + "fragmentation", + (u_longlong_t)tvd->vdev_id, + (u_longlong_t)tvd->vdev_ms_count); + if (mg->mg_fragmentation == ZFS_FRAG_INVALID) { + (void) printf("%3s\n", "-"); + } else { + (void) printf("%3llu%%\n", + (u_longlong_t)mg->mg_fragmentation); + } + dump_histogram(mg->mg_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); + } + + (void) printf("\tpool %s\tfragmentation", spa_name(spa)); + fragmentation = metaslab_class_fragmentation(mc); + if (fragmentation == ZFS_FRAG_INVALID) + (void) printf("\t%3s\n", "-"); + else + (void) printf("\t%3llu%%\n", (u_longlong_t)fragmentation); + dump_histogram(mc->mc_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); +} + +static void dump_metaslabs(spa_t *spa) { vdev_t *vd, *rvd = spa->spa_root_vdev; @@ -2369,8 +2412,7 @@ zdb_leak(void *arg, uint64_t start, uint64_t size) } static metaslab_ops_t zdb_metaslab_ops = { - NULL, /* alloc */ - NULL /* fragmented */ + NULL /* alloc */ }; static void @@ -2865,6 +2907,8 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] > 2 || dump_opt['m']) dump_metaslabs(spa); + if (dump_opt['M']) + dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); @@ -3360,7 +3404,7 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); while ((c = getopt(argc, argv, - "bcdhilmM:suCDRSAFLXx:evp:t:U:P")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3373,6 +3417,7 @@ main(int argc, char **argv) case 'u': case 'C': case 'D': + case 'M': case 'R': case 'S': dump_opt[c]++; @@ -3386,10 +3431,7 @@ main(int argc, char **argv) case 'P': dump_opt[c]++; break; - case 'v': - verbose++; - break; - case 'M': + case 'I': max_inflight = strtoull(optarg, NULL, 0); if (max_inflight == 0) { (void) fprintf(stderr, "maximum number " @@ -3413,9 +3455,6 @@ main(int argc, char **argv) } searchdirs[nsearch++] = optarg; break; - case 'x': - vn_dumpdir = optarg; - break; case 't': max_txg = strtoull(optarg, NULL, 0); if (max_txg < TXG_INITIAL) { @@ -3427,6 +3466,12 @@ main(int argc, char **argv) case 'U': spa_config_path = optarg; break; + case 'v': + verbose++; + break; + case 'x': + vn_dumpdir = optarg; + break; default: usage(); break; diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 index a76e75c..a8463cf 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 @@ -21,12 +21,12 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs -.\" Copyright (c) 2012 by Delphix. All Rights Reserved. +.\" Copyright (c) 2013 by Delphix. All Rights Reserved. .\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" -.Dd July 25, 2014 +.Dd July 26, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -543,6 +543,15 @@ For example, a value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See .Xr zfs 8 for a description of the deduplication feature. +.It Sy expandsize +Amount of uninitialized space within the pool or device that can be used to +increase the total capacity of the pool. +Uninitialized space consists of +any space on an EFI labeled vdev which has not been brought online +.Pq i.e. zpool online -e . +This space occurs when a LUN is dynamically expanded. +.It Sy fragmentation +The amount of fragmentation in the pool. .It Sy free Number of blocks within the pool that are not allocated. .It Sy freeing @@ -555,13 +564,6 @@ Over time will decrease while .Sy free increases. -.It Sy expandsize -Amount of uninitialized space within the pool or device that can be used to -increase the total capacity of the pool. -Uninitialized space consists of -any space on an EFI labeled vdev which has not been brought online -.Pq i.e. zpool online -e . -This space occurs when a LUN is dynamically expanded. .It Sy guid A unique identifier for the pool. .It Sy health @@ -1408,6 +1410,7 @@ section for a list of valid properties. The default list is .Sy size , .Sy used , .Sy available , +.Sy fragmentation , .Sy expandsize , .Sy capacity , .Sy health , @@ -1794,9 +1797,9 @@ is immediately available to any datasets within the pool. The following command lists all available pools on the system. .Bd -literal -offset 2n .Li # Ic zpool list -NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT -pool 2.70T 473G 2.24T - 17% 1.00x ONLINE - -test 1.98G 89.5K 1.98G - 0% 1.00x ONLINE - +NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT +pool 2.70T 473G 2.24T 33% - 17% 1.00x ONLINE - +test 1.98G 89.5K 1.98G 48% - 0% 1.00x ONLINE - .Ed .It Sy Example 7 No Listing All Properties for a Pool .Pp @@ -1924,7 +1927,35 @@ subcommand as follows: .Bd -literal -offset 2n .Li # Ic zpool iostat -v pool 5 .Ed -.It Sy Example 15 No Removing a Mirrored Log Device +.It Xo +.Sy Example 15 +Displaying expanded space on a device +.Xc +.Pp +The following command dipslays the detailed information for the +.Em data +pool. +This pool is comprised of a single +.Em raidz +vdev where one of its +devices increased its capacity by 10GB. +In this example, the pool will not +be able to utilized this extra capacity until all the devices under the +.Em raidz +vdev have been expanded. +.Bd -literal -offset 2n +.Li # Ic zpool list -v data +NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT +data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE - + raidz1 23.9G 14.6G 9.30G 48% - + ada0 - - - - - + ada1 - - - - 10G + ada2 - - - - - +.Ed +.It Xo +.Sy Example 16 +Removing a Mirrored Log Device +.Xc .Pp The following command removes the mirrored log device .Em mirror-2 . @@ -1956,7 +1987,12 @@ is: .Bd -literal -offset 2n .Li # Ic zpool remove tank mirror-2 .Ed -.It Sy Example 16 No Recovering a Faulted Tn ZFS No Pool +.It Xo +.Sy Example 17 +Recovering a Faulted +.Tn ZFS +Pool +.Xc .Pp If a pool is faulted but recoverable, a message indicating this state is provided by diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 74e07f1..fe73169 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -2900,10 +2900,15 @@ print_one_column(zpool_prop_t prop, uint64_t value, boolean_t scripted) boolean_t fixed; size_t width = zprop_width(prop, &fixed, ZFS_TYPE_POOL); - zfs_nicenum(value, propval, sizeof (propval)); if (prop == ZPOOL_PROP_EXPANDSZ && value == 0) (void) strlcpy(propval, "-", sizeof (propval)); + else if (prop == ZPOOL_PROP_FRAGMENTATION && value == ZFS_FRAG_INVALID) + (void) strlcpy(propval, "-", sizeof (propval)); + else if (prop == ZPOOL_PROP_FRAGMENTATION) + (void) snprintf(propval, sizeof (propval), "%llu%%", value); + else + zfs_nicenum(value, propval, sizeof (propval)); if (scripted) (void) printf("\t%s", propval); @@ -2936,9 +2941,9 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv, /* only toplevel vdevs have capacity stats */ if (vs->vs_space == 0) { if (scripted) - (void) printf("\t-\t-\t-"); + (void) printf("\t-\t-\t-\t-"); else - (void) printf(" - - -"); + (void) printf(" - - - -"); } else { print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, scripted); @@ -2946,6 +2951,8 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv, scripted); print_one_column(ZPOOL_PROP_FREE, vs->vs_space - vs->vs_alloc, scripted); + print_one_column(ZPOOL_PROP_FRAGMENTATION, + vs->vs_fragmentation, scripted); } print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, scripted); @@ -3031,8 +3038,8 @@ zpool_do_list(int argc, char **argv) int ret; list_cbdata_t cb = { 0 }; static char default_props[] = - "name,size,allocated,free,expandsize,capacity,dedupratio," - "health,altroot"; + "name,size,allocated,free,fragmentation,expandsize,capacity," + "dedupratio,health,altroot"; char *props = default_props; unsigned long interval = 0, count = 0; zpool_list_t *list; diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index f6e84f8..30b2d87 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -322,6 +322,14 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, (u_longlong_t)intval); } break; + case ZPOOL_PROP_FRAGMENTATION: + if (intval == UINT64_MAX) { + (void) strlcpy(buf, "-", len); + } else { + (void) snprintf(buf, len, "%llu%%", + (u_longlong_t)intval); + } + break; case ZPOOL_PROP_DEDUPRATIO: (void) snprintf(buf, len, "%llu.%02llux", -- cgit v1.1 From f9b34399a67b7e5176d7eeb634a7bb259e71b15f Mon Sep 17 00:00:00 2001 From: gnn Date: Sat, 26 Jul 2014 19:21:53 +0000 Subject: Port the rwsnoop DTrace Toolkit script to FreeBSD. Remove dependency on the Korn Shell. Remove Zones in favor of Jails. Remove support (for now) for filename printing. --- cddl/contrib/dtracetoolkit/rwsnoop | 53 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/dtracetoolkit/rwsnoop b/cddl/contrib/dtracetoolkit/rwsnoop index 9d49324..e3b2ff4 100755 --- a/cddl/contrib/dtracetoolkit/rwsnoop +++ b/cddl/contrib/dtracetoolkit/rwsnoop @@ -1,10 +1,10 @@ -#!/usr/bin/ksh +#!/bin/sh # # rwsnoop - snoop read/write events. -# Written using DTrace (Solaris 10 3/05). +# Originally written using DTrace (Solaris 10 3/05). # # This is measuring reads and writes at the application level. This matches -# the syscalls read, write, pread and pwrite. +# the syscalls read, and write. # # $Id: rwsnoop 3 2007-08-01 10:50:08Z brendan $ # @@ -12,15 +12,14 @@ # # rwsnoop # default output # -# -j # print project ID # -P # print parent process ID # -t # print timestamp, us # -v # print time, string -# -Z # print zone ID +# -J # print jail ID # -n name # this process name only # -p PID # this PID only # eg, -# rwsnoop -Z # print zone ID +# rwsnoop -J # print jail ID # rwsnoop -n bash # monitor processes named "bash" # rwsnoop > out.txt # recommended # @@ -32,8 +31,7 @@ # FIELDS: # TIME Timestamp, us # TIMESTR Time, string -# ZONE Zone ID -# PROJ Project ID +# JAIL JAIL ID # UID User ID # PID Process ID # PPID Parent Process ID @@ -71,6 +69,7 @@ # 24-Jul-2005 Brendan Gregg Created this. # 17-Sep-2005 " " Increased switchrate. # 17-Sep-2005 " " Last update. +# 26-Jul-2014 George Neville-Neil Port to FreeBSD # @@ -78,9 +77,11 @@ # --- Process Arguments --- # +set -x +set -v ### default variables -opt_name=0; opt_pid=0; opt_proj=0; opt_zone=0; opt_time=0; opt_timestr=0 -opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0 +opt_name=0; opt_pid=0; opt_jailid=0; opt_time=0; opt_timestr=0 +opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0; ### process options while getopts n:Pp:jtvZ name @@ -89,23 +90,21 @@ do n) opt_name=1; pname=$OPTARG ;; p) opt_pid=1; pid=$OPTARG ;; P) opt_ppid=1 ;; - j) opt_proj=1 ;; t) opt_time=1 ;; v) opt_timestr=1 ;; - Z) opt_zone=1 ;; + J) opt_jailid=1 ;; h|?) cat <<-END >&2 USAGE: rwsnoop [-jPtvZ] [-n name] [-p pid] - -j # print project ID -P # print parent process ID -t # print timestamp, us -v # print time, string - -Z # print zone ID + -J # print jail ID -n name # this process name only -p PID # this PID only eg, rwsnoop # default output - rwsnoop -Z # print zone ID + rwsnoop -J # print jail ID rwsnoop -n bash # monitor processes named "bash" END exit 1 @@ -115,11 +114,13 @@ done shift $(( $OPTIND - 1 )) ### option logic -if (( opt_name || opt_pid )); then +if [ $opt_name -ne 0 ]; then filter=1 fi - +if [ $opt_pid -ne 0 ]; then + filter=1 +fi ################################# # --- Main Program, DTrace --- @@ -128,8 +129,7 @@ fi /* * Command line arguments */ - inline int OPT_proj = '$opt_proj'; - inline int OPT_zone = '$opt_zone'; + inline int OPT_jailid = '$opt_jailid'; inline int OPT_bytes = '$opt_bytes'; inline int OPT_name = '$opt_name'; inline int OPT_ppid = '$opt_ppid'; @@ -151,8 +151,7 @@ fi /* print header */ OPT_time ? printf("%-14s ", "TIME") : 1; OPT_timestr ? printf("%-20s ", "TIMESTR") : 1; - OPT_proj ? printf("%5s ", "PROJ") : 1; - OPT_zone ? printf("%5s ", "ZONE") : 1; + OPT_jailid ? printf("%5s ", "JAILID") : 1; OPT_ppid ? printf("%6s ", "PPID") : 1; printf("%5s %6s %-12s %1s %7s %s\n", "UID", "PID", "CMD", "D", "BYTES", "FILE"); @@ -205,7 +204,10 @@ fi { /* * Fetch filename + * XXX Not yet implemented. */ +/* + this->filistp = curthread->t_procp->p_user.u_finfo.fi_list; this->ufentryp = (uf_entry_t *)((uint64_t)this->filistp + (uint64_t)self->fd * (uint64_t)sizeof(uf_entry_t)); @@ -213,17 +215,16 @@ fi this->vnodep = this->filep != 0 ? this->filep->f_vnode : 0; self->vpath = this->vnodep ? (this->vnodep->v_path != 0 ? cleanpath(this->vnodep->v_path) : "") : ""; - +*/ /* * Print details */ OPT_time ? printf("%-14d ", timestamp / 1000) : 1; OPT_timestr ? printf("%-20Y ", walltimestamp) : 1; - OPT_proj ? printf("%5d ", curpsinfo->pr_projid) : 1; - OPT_zone ? printf("%5d ", curpsinfo->pr_zoneid) : 1; + OPT_jailid ? printf("%5d ", curpsinfo->pr_jailid) : 1; OPT_ppid ? printf("%6d ", ppid) : 1; - printf("%5d %6d %-12.12s %1s %7d %s\n", - uid, pid, execname, self->rw, (int)self->size, self->vpath); + printf("%5d %6d %-12.12s %1s %7d \n", + uid, pid, execname, self->rw, (int)self->size); self->ok = 0; self->fd = 0; -- cgit v1.1 From ba9b6cdd1c8fc17e0739b5df07068d70ff54c881 Mon Sep 17 00:00:00 2001 From: gnn Date: Sat, 26 Jul 2014 19:25:52 +0000 Subject: Remove debugging options from the rwsnoop script. --- cddl/contrib/dtracetoolkit/rwsnoop | 2 -- 1 file changed, 2 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/dtracetoolkit/rwsnoop b/cddl/contrib/dtracetoolkit/rwsnoop index e3b2ff4..c213f27 100755 --- a/cddl/contrib/dtracetoolkit/rwsnoop +++ b/cddl/contrib/dtracetoolkit/rwsnoop @@ -77,8 +77,6 @@ # --- Process Arguments --- # -set -x -set -v ### default variables opt_name=0; opt_pid=0; opt_jailid=0; opt_time=0; opt_timestr=0 opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0; -- cgit v1.1 From 0ce768e27cb3928d44e59d2c8121082104c3d404 Mon Sep 17 00:00:00 2001 From: gnn Date: Sat, 26 Jul 2014 20:11:36 +0000 Subject: Since we cannot yet display the name print the file descriptor so that it can be looked up manually using procstat(1). --- cddl/contrib/dtracetoolkit/rwsnoop | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/dtracetoolkit/rwsnoop b/cddl/contrib/dtracetoolkit/rwsnoop index c213f27..bc5f0ce 100755 --- a/cddl/contrib/dtracetoolkit/rwsnoop +++ b/cddl/contrib/dtracetoolkit/rwsnoop @@ -152,7 +152,7 @@ fi OPT_jailid ? printf("%5s ", "JAILID") : 1; OPT_ppid ? printf("%6s ", "PPID") : 1; printf("%5s %6s %-12s %1s %7s %s\n", - "UID", "PID", "CMD", "D", "BYTES", "FILE"); + "UID", "PID", "CMD", "FD", "D", "BYTES"); } /* @@ -221,8 +221,8 @@ fi OPT_timestr ? printf("%-20Y ", walltimestamp) : 1; OPT_jailid ? printf("%5d ", curpsinfo->pr_jailid) : 1; OPT_ppid ? printf("%6d ", ppid) : 1; - printf("%5d %6d %-12.12s %1s %7d \n", - uid, pid, execname, self->rw, (int)self->size); + printf("%5d %6d %-12.12s %4d %1s %7d\n", + uid, pid, execname, self->fd, self->rw, (int)self->size); self->ok = 0; self->fd = 0; -- cgit v1.1 From 0a908fd23b008a1b5808fb4a6ad958fba148986c Mon Sep 17 00:00:00 2001 From: gnn Date: Sat, 26 Jul 2014 20:42:54 +0000 Subject: Update the header printing to match the rest of the output. Pointed out by: mdf --- cddl/contrib/dtracetoolkit/rwsnoop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/dtracetoolkit/rwsnoop b/cddl/contrib/dtracetoolkit/rwsnoop index bc5f0ce..c96bd68 100755 --- a/cddl/contrib/dtracetoolkit/rwsnoop +++ b/cddl/contrib/dtracetoolkit/rwsnoop @@ -151,7 +151,7 @@ fi OPT_timestr ? printf("%-20s ", "TIMESTR") : 1; OPT_jailid ? printf("%5s ", "JAILID") : 1; OPT_ppid ? printf("%6s ", "PPID") : 1; - printf("%5s %6s %-12s %1s %7s %s\n", + printf("%5s %6s %-12s %4s %1s %7s\n", "UID", "PID", "CMD", "FD", "D", "BYTES"); } -- cgit v1.1