aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2012-07-18 09:16:47 +0000
committerMartin Matuska <mm@FreeBSD.org>2012-07-18 09:16:47 +0000
commit77225241cd47b9d06c05bd568fc057328c0c65e5 (patch)
tree7b21d952f88eed0f80743c1b974b35495a428e72
parent5bb19a17c049cd92ccbd811a6bd0daf69ac899c1 (diff)
parent93a00b0821525e25814cd720fafd04d600811c28 (diff)
Copy vendor/opensolaris/dist to vendor/illumos/distvendor/illumos/20100818
Notes
Notes: svn path=/vendor/illumos/dist/; revision=238577 svn path=/vendor/illumos/20100818/; revision=238579; tag=vendor/illumos/20100818
-rw-r--r--cmd/dtrace/dtrace.1452
-rw-r--r--cmd/dtrace/test/cmd/jdtrace/JDTrace.java11
-rw-r--r--cmd/dtrace/test/cmd/jdtrace/exception.lst6
-rw-r--r--cmd/dtrace/test/cmd/jdtrace/jdtrace.c18
-rw-r--r--cmd/dtrace/test/cmd/scripts/dtest.pl45
-rwxr-xr-xcmd/dtrace/test/cmd/scripts/dtfailures.ksh42
-rw-r--r--cmd/dtrace/test/tst/common/aggs/tst.subr.d4
-rw-r--r--cmd/dtrace/test/tst/common/buffering/tst.resize1.d8
-rw-r--r--cmd/dtrace/test/tst/common/buffering/tst.resize2.d8
-rw-r--r--cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d30
-rw-r--r--cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d30
-rw-r--r--cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d30
-rw-r--r--cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d30
-rw-r--r--cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d30
-rw-r--r--cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d30
-rw-r--r--cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d80
-rw-r--r--cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out302
-rw-r--r--cmd/dtrace/test/tst/common/funcs/tst.tolower.d66
-rw-r--r--cmd/dtrace/test/tst/common/funcs/tst.toupper.d66
-rw-r--r--cmd/dtrace/test/tst/common/include/tst.includefirst.ksh76
-rwxr-xr-xcmd/dtrace/test/tst/common/ip/get.ipv4remote.pl3
-rwxr-xr-xcmd/dtrace/test/tst/common/ip/get.ipv6remote.pl3
-rwxr-xr-xcmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh2
-rwxr-xr-xcmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh2
-rw-r--r--cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh2
-rw-r--r--cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh2
-rw-r--r--cmd/dtrace/test/tst/common/java_api/src/TestBean.java47
-rw-r--r--cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out6
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d30
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.bases.d46
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out177
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.basic.d38
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out25
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.negorder.d62
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out148
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d38
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out25
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.normal.d40
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out26
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.range.d38
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.range.d.out29
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.steps.d52
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out2033
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.trunc.d49
-rw-r--r--cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out34
-rw-r--r--cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh4
-rw-r--r--cmd/dtrace/test/tst/common/misc/tst.include.ksh35
-rw-r--r--cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out3
-rw-r--r--cmd/dtrace/test/tst/common/misc/tst.schrock.ksh12
-rw-r--r--cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh9
-rw-r--r--cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh7
-rw-r--r--cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh9
-rw-r--r--cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh76
-rw-r--r--cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d29
-rw-r--r--cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d29
-rw-r--r--cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d29
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.array.d62
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.array.d.out23
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.bitfield.d49
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.bitfield.d.out6
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.primitive.d45
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.primitive.d.out11
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.struct.d59
-rw-r--r--cmd/dtrace/test/tst/common/print/tst.struct.d.out12
-rw-r--r--cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh2
-rwxr-xr-xcmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh72
-rwxr-xr-xcmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh61
-rwxr-xr-xcmd/dtrace/test/tst/common/privs/tst.tick.ksh55
-rw-r--r--cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh6
-rw-r--r--cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh3
-rw-r--r--cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh3
-rw-r--r--cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh3
-rw-r--r--cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d30
-rw-r--r--cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d29
-rw-r--r--cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d29
-rw-r--r--cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d30
-rw-r--r--cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d45
-rw-r--r--cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out1313
-rw-r--r--cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d32
-rw-r--r--cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out4
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh4
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh15
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh15
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh15
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.fork.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.header.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.include.ksh3
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh128
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh124
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.reap.ksh115
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.static.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.static2.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/usdt/tst.user.ksh5
-rw-r--r--cmd/dtrace/test/tst/common/ustack/tst.spin.ksh3
-rw-r--r--cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh3
-rw-r--r--cmd/zdb/zdb.c132
-rw-r--r--cmd/zfs/zfs_main.c2887
-rw-r--r--cmd/zhack/zhack.c540
-rw-r--r--cmd/zpool/zpool_main.c775
-rw-r--r--cmd/ztest/ztest.c1175
-rw-r--r--lib/libctf/common/ctf_lib.c6
-rw-r--r--lib/libdtrace/common/dt_aggregate.c89
-rw-r--r--lib/libdtrace/common/dt_cc.c302
-rw-r--r--lib/libdtrace/common/dt_consume.c186
-rw-r--r--lib/libdtrace/common/dt_dof.c14
-rw-r--r--lib/libdtrace/common/dt_errtags.h30
-rw-r--r--lib/libdtrace/common/dt_impl.h13
-rw-r--r--lib/libdtrace/common/dt_map.c172
-rw-r--r--lib/libdtrace/common/dt_open.c32
-rw-r--r--lib/libdtrace/common/dt_options.c27
-rw-r--r--lib/libdtrace/common/dt_parser.c8
-rw-r--r--lib/libdtrace/common/dt_pragma.c41
-rw-r--r--lib/libdtrace/common/dt_print.c648
-rw-r--r--lib/libdtrace/common/dt_printf.c12
-rw-r--r--lib/libdtrace/common/dt_program.c2
-rw-r--r--lib/libdtrace/common/dtrace.h19
-rw-r--r--lib/libdtrace/i386/regs.d.in151
-rw-r--r--lib/libnvpair/libnvpair.c5
-rw-r--r--lib/libuutil/common/uu_list.c7
-rw-r--r--lib/libzfs/common/libzfs.h111
-rw-r--r--lib/libzfs/common/libzfs_config.c83
-rw-r--r--lib/libzfs/common/libzfs_dataset.c918
-rw-r--r--lib/libzfs/common/libzfs_graph.c653
-rw-r--r--lib/libzfs/common/libzfs_impl.h12
-rw-r--r--lib/libzfs/common/libzfs_import.c18
-rw-r--r--lib/libzfs/common/libzfs_iter.c462
-rw-r--r--lib/libzfs/common/libzfs_pool.c363
-rw-r--r--lib/libzfs/common/libzfs_sendrecv.c642
-rw-r--r--lib/libzfs/common/libzfs_status.c18
-rw-r--r--lib/libzfs/common/libzfs_util.c42
-rw-r--r--lib/libzfs_core/common/libzfs_core.c477
-rw-r--r--lib/libzfs_core/common/libzfs_core.h62
-rw-r--r--lib/libzpool/common/kernel.c12
-rw-r--r--lib/libzpool/common/sys/zfs_context.h21
-rw-r--r--lib/libzpool/common/taskq.c103
-rw-r--r--tools/ctf/cvt/dwarf.c95
167 files changed, 2604 insertions, 16328 deletions
diff --git a/cmd/dtrace/dtrace.1 b/cmd/dtrace/dtrace.1
index fc71612e0f1a..e20ed9fe6ba8 100644
--- a/cmd/dtrace/dtrace.1
+++ b/cmd/dtrace/dtrace.1
@@ -1,42 +1,51 @@
'\" te
-.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DTRACE 1M "Aug 4, 2009"
+.\" CDDL HEADER START
+.\"
+.\" The contents of this file are subject to the terms of the
+.\" Common Development and Distribution License (the "License").
+.\" You may not use this file except in compliance with the License.
+.\"
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+.\" or http://www.opensolaris.org/os/licensing.
+.\" See the License for the specific language governing permissions
+.\" and limitations under the License.
+.\"
+.\" When distributing Covered Code, include this CDDL HEADER in each
+.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+.\" If applicable, add the following below this CDDL HEADER, with the
+.\" fields enclosed by brackets "[]" replaced with your own identifying
+.\" information: Portions Copyright [yyyy] [name of copyright owner]
+.\"
+.\" CDDL HEADER END
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.TH dtrace 1M "5 Sep 2006" "SunOS 5.11" "System Administration Commands"
.SH NAME
dtrace \- DTrace dynamic tracing compiler and tracing utility
.SH SYNOPSIS
.LP
.nf
-\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR]
- [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR]
- [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]]
- [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR]
- [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]]
- [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]]
- [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]]
- [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]]
- [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]]
+\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR]
+ [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR]
+ [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]]
+ [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR]
+ [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]]
.fi
.SH DESCRIPTION
.sp
.LP
-DTrace is a comprehensive dynamic tracing framework for the Solaris Operating
-System. DTrace provides a powerful infrastructure that permits administrators,
-developers, and service personnel to concisely answer arbitrary questions about
-the behavior of the operating system and user programs.
+DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.
.sp
.LP
-The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe,
-debug, and tune system behavior. Refer to this book for a detailed description
-of DTrace features, including the bundled DTrace observability tools,
-instrumentation providers, and the D programming language.
+The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability
+tools, instrumentation providers, and the D programming language.
.sp
.LP
-The \fBdtrace\fR command provides a generic interface to the essential services
-provided by the DTrace facility, including:
+The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including:
.RS +4
.TP
.ie t \(bu
@@ -47,15 +56,13 @@ Options that list the set of probes and providers currently published by DTrace
.TP
.ie t \(bu
.el o
-Options that enable probes directly using any of the probe description
-specifiers (provider, module, function, name)
+Options that enable probes directly using any of the probe description specifiers (provider, module, function, name)
.RE
.RS +4
.TP
.ie t \(bu
.el o
-Options that run the D compiler and compile one or more D program files or
-programs written directly on the command line
+Options that run the D compiler and compile one or more D program files or programs written directly on the command line
.RE
.RS +4
.TP
@@ -73,533 +80,442 @@ Options that generate program stability reports
.TP
.ie t \(bu
.el o
-Options that modify DTrace tracing and buffering behavior and enable additional
-D compiler features
+Options that modify DTrace tracing and buffering behavior and enable additional D compiler features
.RE
.sp
.LP
-You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR
-declaration to create an interpreter file. You can also use \fBdtrace\fR to
-attempt to compile D programs and determine their properties without actually
-enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the
-\fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the
-\fBdtrace\fR utility to perform these tasks.
+You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks.
.SH OPTIONS
.sp
.LP
-The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and
-\fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in
-slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed
-in braces \fB{}\fR. D program code specified on the command line must be
-appropriately quoted to avoid interpretation of meta-characters by the shell.
+The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell.
.sp
.LP
The following options are supported:
.sp
.ne 2
+.mk
.na
\fB\fB-32\fR | \fB-64\fR\fR
.ad
.sp .6
.RS 4n
-The D compiler produces programs using the native data model of the operating
-system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the
-current operating system data model. If the \fB-32\fR option is specified,
-\fBdtrace\fR forces the D compiler to compile a D program using the 32-bit data
-model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler
-to compile a D program using the 64-bit data model. These options are typically
-not required as \fBdtrace\fR selects the native data model as the default. The
-data model affects the sizes of integer types and other language properties. D
-programs compiled for either data model can be executed on both 32-bit and
-64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file
-format (ELF32 or ELF64) produced by the \fB-G\fR option.
+The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces
+the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the
+native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format
+(ELF32 or ELF64) produced by the \fB-G\fR option.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-a\fR\fR
.ad
.sp .6
.RS 4n
-Claim anonymous tracing state and display the traced data. You can combine the
-\fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit
-immediately after consuming the anonymous tracing state rather than continuing
-to wait for new data. See the \fISolaris Dynamic Tracing Guide\fR for more
-information about anonymous tracing.
+Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new
+data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-A\fR\fR
.ad
.sp .6
.RS 4n
-Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option
-constructs a set of \fBdtrace\fR(7D) configuration file directives to enable
-the specified probes for anonymous tracing and then exits. By default,
-\fBdtrace\fR attempts to store the directives to the file
-\fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the
-\fB-o\fR option to specify an alternate output file.
+Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-b\fR \fIbufsz\fR\fR
.ad
.sp .6
.RS 4n
-Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can
-include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the
-buffer space cannot be allocated, \fBdtrace\fR attempts to reduce the buffer
-size or exit depending on the setting of the \fBbufresize\fR property.
+Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts
+to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-c\fR \fIcmd\fR\fR
.ad
.sp .6
.RS 4n
-Run the specified command \fIcmd\fR and exit upon its completion. If more than
-one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all
-commands have exited, reporting the exit status for each child process as it
-terminates. The process-ID of the first command is made available to any D
-programs specified on the command line or using the \fB-s\fR option through the
-\fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR
-for more information on macro variables.
+Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it
+terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information
+on macro variables.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-C\fR\fR
.ad
.sp .6
.RS 4n
-Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You
-can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR,
-and \fB-H\fR options. You can select the degree of C standard conformance if
-you use the \fB-X\fR option. For a description of the set of tokens defined by
-the D compiler when invoking the C preprocessor, see \fB-X\fR.
+Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR
.ad
.sp .6
.RS 4n
-Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR
-option). If you specify the equals sign (\fB=\fR) and additional \fIvalue\fR,
-the name is assigned the corresponding value. This option passes the \fB-D\fR
-option to each \fBcpp\fR invocation.
+Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR)
+and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-e\fR\fR
.ad
.sp .6
.RS 4n
-Exit after compiling any requests and consuming anonymous tracing state
-(\fB-a\fR option) but prior to enabling any probes. You can combine this option
-with the \fB-a\fR option to print anonymous tracing data and exit. You can also
-combine this option with D compiler options. This combination verifies that the
-programs compile without actually executing them and enabling the corresponding
-instrumentation.
+Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D
+compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation.
.RE
.sp
.ne 2
+.mk
.na
-\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[
-[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR
+\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR
.ad
.sp .6
.RS 4n
-Specify function name to trace or list (\fB-l\fR option). The corresponding
-argument can include any of the probe description forms
-\fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR.
-Unspecified probe description fields are left blank and match any probes
-regardless of the values in those fields. If no qualifiers other than
-\fIfunction\fR are specified in the description, all probes with the
-corresponding \fIfunction\fR are matched. The \fB-f\fR argument can be suffixed
-with an optional D probe clause. You can specify more than one \fB-f\fR option
-on the command line at a time.
+Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR.
+Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched.
+The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-F\fR\fR
.ad
.sp .6
.RS 4n
-Coalesce trace output by identifying function entry and return. Function entry
-probe reports are indented and their output is prefixed with \fB->\fR. Function
-return probe reports are unindented and their output is prefixed with
-\fB<-\fR\&. System call entry probe reports are indented and their output is
-prefixed with \fB=>\fR. System call return probe reports are unindented and
-their output is prefixed with \fB<=\fR\&.
+Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call
+entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-G\fR\fR
.ad
.sp .6
.RS 4n
-Generate an ELF file containing an embedded DTrace program. The DTrace probes
-specified in the program are saved inside of a relocatable ELF object which can
-be linked into another program. If the \fB-o\fR option is present, the ELF file
-is saved using the pathname specified as the argument for this operand. If the
-\fB-o\fR option is not present and the DTrace program is contained with a file
-whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name
-\fB\fIfilename\fR.o\fR. Otherwise the ELF file is saved using the name
-\fBd.out\fR.
+Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified
+as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR.
+Otherwise the ELF file is saved using the name \fBd.out\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-H\fR\fR
.ad
.sp .6
.RS 4n
-Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using
-the \fB-C\fR option). This option passes the \fB-H\fR option to each \fBcpp\fR
-invocation, causing it to display the list of pathnames, one for each line, to
-\fBstderr\fR.
+Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option
+to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-h\fR\fR
.ad
.sp .6
.RS 4n
-Generate a header file containing macros that correspond to probes in the
-specified provider definitions. This option should be used to generate a header
-file that is included by other source files for later use with the \fB-G\fR
-option. If the \fB-o\fR option is present, the header file is saved using the
-pathname specified as the argument for that option. If the \fB-o\fR option is
-not present and the DTrace program is contained with a file whose name is
-\fIfilename\fR\fB\&.d\fR, then the header file is saved using the name
-\fIfilename\fR\fB\&.h\fR.
+Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option
+is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved
+using the name \fIfilename\fR\fB\&.h\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR
.ad
.sp .6
.RS 4n
-Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option).
-You can specify probe IDs using decimal integers as shown by \fBdtrace\fR
-\fB-l\fR. The \fB-i\fR argument can be suffixed with an optional D probe
-clause. You can specify more than one \fB-i\fR option at a time.
+Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional
+D probe clause. You can specify more than one \fB-i\fR option at a time.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-I\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
-Add the specified directory \fIpath\fR to the search path for \fB#include\fR
-files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This
-option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified
-\fIpath\fR is inserted into the search path ahead of the default directory
-list.
+Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled
+using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-L\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
-Add the specified directory \fIpath\fR to the search path for DTrace libraries.
-DTrace libraries are used to contain common definitions that can be used when
-writing D programs. The specified \fIpath\fR is added after the default library
+Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library
search path.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-l\fR\fR
.ad
.sp .6
.RS 4n
-List probes instead of enabling them. If the \fB-l\fR option is specified,
-\fBdtrace\fR produces a report of the probes matching the descriptions given
-using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, and \fB-s\fR
-options. If none of these options are specified, this option lists all probes.
+List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR,
+and \fB-s\fR options. If none of these options are specified, this option lists all probes.
.RE
.sp
.ne 2
+.mk
.na
-\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR]
-\fIaction\fR]]\fR
+\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR
.ad
.sp .6
.RS 4n
-Specify module name to trace or list (\fB-l\fR option). The corresponding
-argument can include any of the probe description forms \fIprovider:module\fR
-or \fImodule\fR. Unspecified probe description fields are left blank and match
-any probes regardless of the values in those fields. If no qualifiers other
-than \fImodule\fR are specified in the description, all probes with a
-corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed
-with an optional D probe clause. More than one \fB-m\fR option can be specified
-on the command line at a time.
+Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match
+any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D
+probe clause. More than one \fB-m\fR option can be specified on the command line at a time.
.RE
.sp
.ne 2
+.mk
.na
-\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR
-[[\fIpredicate\fR] \fIaction\fR]\fR
+\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR
.ad
.sp .6
.RS 4n
-Specify probe name to trace or list (\fB-l\fR option). The corresponding
-argument can include any of the probe description forms
-\fIprovider:module:function:name\fR, \fImodule:function:name\fR,
-\fIfunction:name\fR, or \fIname\fR. Unspecified probe description fields are
-left blank and match any probes regardless of the values in those fields. If no
-qualifiers other than \fIname\fR are specified in the description, all probes
-with a corresponding \fIname\fR are matched. The \fB-n\fR argument can be
-suffixed with an optional D probe clause. More than one \fB-n\fR option can be
-specified on the command line at a time.
+Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR,
+or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are
+matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-o\fR \fIoutput\fR\fR
.ad
.sp .6
.RS 4n
-Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, \fB-h\fR, and
-\fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is
-present and \fB-o\fR is not present, the default output file is
-\fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the
-\fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR
-is not present, the default output file is \fB\fIfilename\fR.o\fR. Otherwise
-the default output file is \fBd.out\fR.
+Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR.
+Otherwise the default output file is \fBd.out\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-p\fR \fIpid\fR\fR
.ad
.sp .6
.RS 4n
-Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon
-its completion. If more than one \fB-p\fR option is present on the command
-line, \fBdtrace\fR exits when all commands have exited, reporting the exit
-status for each process as it terminates. The first process-ID is made
-available to any D programs specified on the command line or using the \fB-s\fR
-option through the \fB$target\fR macro variable. Refer to the \fISolaris
-Dynamic Tracing Guide\fR for more information on macro variables.
+Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status
+for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for
+more information on macro variables.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR
.ad
.sp .6
.RS 4n
-Specify provider name to trace or list (\fB-l\fR option). The remaining probe
-description fields module, function, and name are left blank and match any
-probes regardless of the values in those fields. The \fB-P\fR argument can be
-suffixed with an optional D probe clause. You can specify more than one
-\fB-P\fR option on the command line at a time.
+Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D
+probe clause. You can specify more than one \fB-P\fR option on the command line at a time.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-q\fR\fR
.ad
.sp .6
.RS 4n
-Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes
-matched by the specified options and D programs and does not print column
-headers, the CPU ID, the probe ID, or insert newlines into the output. Only
-data traced and formatted by D program statements such as \fBtrace()\fR and
-\fBprintf()\fR is displayed to \fBstdout\fR.
+Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program
+statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-s\fR\fR
.ad
.sp .6
.RS 4n
-Compile the specified D program source file. If the \fB-e\fR option is present,
-the program is compiled but instrumentation is not enabled. If the \fB-l\fR
-option is present, the program is compiled and the set of probes matched by it
-is listed, but instrumentation is not enabled. If none of \fB-e\fR, \fB-l\fR,
-\fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D
-program is enabled and tracing begins.
+Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation
+is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-S\fR\fR
.ad
.sp .6
.RS 4n
-Show D compiler intermediate code. The D compiler produces a report of the
-intermediate code generated for each D program to \fBstderr\fR.
+Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-U\fR \fIname\fR\fR
.ad
.sp .6
.RS 4n
-Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the
-\fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR
-invocation.
+Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-v\fR\fR
.ad
.sp .6
.RS 4n
-Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a
-program stability report showing the minimum interface stability and dependency
-level for the specified D programs. DTrace stability levels are explained in
-further detail in the \fISolaris Dynamic Tracing Guide\fR.
+Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-V\fR\fR
.ad
.sp .6
.RS 4n
-Report the highest D programming interface version supported by \fBdtrace\fR.
-The version information is printed to \fBstdout\fR and the \fBdtrace\fR command
-exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information
-about DTrace versioning features.
+Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for
+more information about DTrace versioning features.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-w\fR\fR
.ad
.sp .6
.RS 4n
-Permit destructive actions in D programs specified using the \fB-s\fR,
-\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR
-option is not specified, \fBdtrace\fR does not permit the compilation or
-enabling of a D program that contains destructive actions.
+Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not
+permit the compilation or enabling of a D program that contains destructive actions.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-x\fR \fIarg\fR [\fI=val\fR]\fR
.ad
.sp .6
.RS 4n
-Enable or modify a DTrace runtime option or D compiler option. The list of
-options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options
-are enabled by specifying their name. Options with values are set by separating
-the option name and value with an equals sign (\fB=\fR).
+Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and
+value with an equals sign (\fB=\fR).
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-X\fR \fBa | c | s | t\fR\fR
.ad
.sp .6
.RS 4n
-Specify the degree of conformance to the ISO C standard that should be selected
-when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). The \fB-X\fR
-option argument affects the value and presence of the \fB__STDC__\fR macro
-depending upon the value of the argument letter.
+Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option).
+The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter.
.sp
The \fB-X\fR option supports the following arguments:
.sp
.ne 2
+.mk
.na
\fB\fBa\fR\fR
.ad
.RS 5n
-Default. ISO C plus K&R compatibility extensions, with semantic changes
-required by ISO C. This is the default mode if \fB-X\fR is not specified. The
-predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in
-conjunction with the \fB-Xa\fR option.
+.rt
+Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction
+with the \fB-Xa\fR option.
.RE
.sp
.ne 2
+.mk
.na
\fB\fBc\fR\fR
.ad
.RS 5n
-Conformance. Strictly conformant ISO C, without K&R C compatibility extensions.
-The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked
-in conjunction with the \fB-Xc\fR option.
+.rt
+Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option.
.RE
.sp
.ne 2
+.mk
.na
\fB\fBs\fR\fR
.ad
.RS 5n
-K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked
-in conjunction with the \fB-Xs\fR option.
+.rt
+K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option.
.RE
.sp
.ne 2
+.mk
.na
\fB\fBt\fR\fR
.ad
.RS 5n
-Transition. ISO C plus K&R C compatibility extensions, without semantic changes
-required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when
-\fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option.
+.rt
+Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option.
.RE
-As the \fB-X\fR option only affects how the D compiler invokes the C
-preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the
-perspective of D and both are provided only to ease re-use of settings from a C
-build environment.
+As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment.
.sp
-Regardless of the \fB-X\fR mode, the following additional C preprocessor
-definitions are always specified and valid in all modes:
+Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes:
.RS +4
.TP
.ie t \(bu
@@ -660,71 +576,66 @@ definitions are always specified and valid in all modes:
.el o
\fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR
.sp
-Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the
-minor release value in hexadecimal, and \fIuuu\fR is the micro release value in
-hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more
-information about DTrace versioning.
+Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the
+micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning.
.RE
.RE
.sp
.ne 2
+.mk
.na
\fB\fB-Z\fR\fR
.ad
.sp .6
.RS 4n
-Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not
-specified, \fBdtrace\fR reports an error and exits if any probe descriptions
-specified in D program files (\fB-s\fR option) or on the command line
-(\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain
-descriptions that do not match any known probes.
+Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes.
.RE
.SH OPERANDS
.sp
.LP
-You can specify zero or more additional arguments on the \fBdtrace\fR command
-line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The
-additional arguments can be used in D programs specified using the \fB-s\fR
-option or on the command line. The use of macro variables is described further
-in the \fISolaris Dynamic Tracing Guide\fR.
+You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option
+or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR.
.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
+.mk
.na
\fB0\fR
.ad
.RS 5n
-Successful completion.
+.rt
+Successful completion.
.sp
-For D program requests, an exit status of \fB0\fR indicates that programs were
-successfully compiled, probes were successfully enabled, or anonymous state was
-successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified
-tracing requests encountered errors or drops.
+For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests
+encountered errors or drops.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB1\fR\fR
.ad
.RS 5n
+.rt
An error occurred.
.sp
-For D program requests, an exit status of \fB1\fR indicates that program
-compilation failed or that the specified request could not be satisfied.
+For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied.
.RE
.sp
.ne 2
+.mk
.na
\fB\fB2\fR\fR
.ad
.RS 5n
+.rt
Invalid command line options or arguments were specified.
.RE
@@ -736,12 +647,15 @@ See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE ATTRIBUTE VALUE
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
_
-Interface Stability See below.
+AvailabilitySUNWdtrc
+_
+Interface StabilitySee below.
.TE
.sp
@@ -750,19 +664,7 @@ The command-line syntax is Committed. The human-readable output is Uncommitted.
.SH SEE ALSO
.sp
.LP
-\fBcpp\fR(1), \fBisainfo\fR(1), \fBssh\fR(1), \fBlibdtrace\fR(3LIB),
-\fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D)
+\fBcpp\fR(1), \fBisainfo\fR(1), \fBlibdtrace\fR(3LIB), \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D)
.sp
.LP
\fISolaris Dynamic Tracing Guide\fR
-.SH USAGE
-.sp
-.LP
-When using the \fB-p\fR flag, \fBdtrace\fR stops the target processes while it
-is inspecting them and reporting results. A process can do nothing while it is
-stopped. This means that, if , for example, the X server is inspected by
-\fBdtrace\fR running in a window under the X server's control, the whole window
-system can become deadlocked, because the \fBproc\fR tool would be attempting
-to display its results to a window that cannot be refreshed. In such a case,
-logging in from another system using \fBssh\fR(1) and killing the offending
-\fBproc\fR tool clears the deadlock.
diff --git a/cmd/dtrace/test/cmd/jdtrace/JDTrace.java b/cmd/dtrace/test/cmd/jdtrace/JDTrace.java
index f8c9ab7337d1..3c5654d88df5 100644
--- a/cmd/dtrace/test/cmd/jdtrace/JDTrace.java
+++ b/cmd/dtrace/test/cmd/jdtrace/JDTrace.java
@@ -23,6 +23,7 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
+ * ident "%Z%%M% %I% %E% SMI"
*/
import org.opensolaris.os.dtrace.*;
import java.io.*;
@@ -302,7 +303,6 @@ public class JDTrace {
Distribution.Bucket bucket;
int b1 = 0; // first displayed bucket
int b2 = d.size() - 1; // last displayed bucket
-
for (; (b1 <= b2) && (d.get(b1).getFrequency() == 0); ++b1);
// If possible, get one bucket before the first non-zero
// bucket and one bucket after the last.
@@ -337,14 +337,9 @@ public class JDTrace {
v = bucket.getFrequency();
b = bucket.getMin();
- if ((d instanceof LinearDistribution) ||
- (d instanceof LogLinearDistribution)) {
+ if (d instanceof LinearDistribution) {
if (b == Long.MIN_VALUE) {
- String lt;
- if (d instanceof LinearDistribution)
- lt = "< " + ((LinearDistribution)d).getBase();
- else
- lt = "< " + ((LogLinearDistribution)d).getBase();
+ String lt = "< " + ((LinearDistribution)d).getBase();
out.printf("%16s ", lt);
} else if (bucket.getMax() == Long.MAX_VALUE) {
String ge = ">= " + b;
diff --git a/cmd/dtrace/test/cmd/jdtrace/exception.lst b/cmd/dtrace/test/cmd/jdtrace/exception.lst
index 19fc3aca51c2..261f8707c18f 100644
--- a/cmd/dtrace/test/cmd/jdtrace/exception.lst
+++ b/cmd/dtrace/test/cmd/jdtrace/exception.lst
@@ -23,6 +23,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
# Exception list: names tests that are bypassed when running in Java
# mode (relative to /opt/SUNWdtrt/tst)
@@ -51,17 +52,14 @@ common/usdt/tst.enabled.ksh
common/usdt/tst.enabled2.ksh
common/usdt/tst.entryreturn.ksh
common/usdt/tst.fork.ksh
+common/usdt/tst.header.ksh
common/usdt/tst.guess32.ksh
common/usdt/tst.guess64.ksh
-common/usdt/tst.header.ksh
common/usdt/tst.linkpriv.ksh
common/usdt/tst.linkunpriv.ksh
common/usdt/tst.multiple.ksh
common/usdt/tst.nodtrace.ksh
-common/usdt/tst.noreap.ksh
-common/usdt/tst.noreapring.ksh
common/usdt/tst.onlyenabled.ksh
-common/usdt/tst.reap.ksh
common/usdt/tst.reeval.ksh
common/usdt/tst.static.ksh
common/usdt/tst.static2.ksh
diff --git a/cmd/dtrace/test/cmd/jdtrace/jdtrace.c b/cmd/dtrace/test/cmd/jdtrace/jdtrace.c
index 81a2d9bcdfd9..095126569cc1 100644
--- a/cmd/dtrace/test/cmd/jdtrace/jdtrace.c
+++ b/cmd/dtrace/test/cmd/jdtrace/jdtrace.c
@@ -22,27 +22,25 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * Copyright 2011, Richard Lowe
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
#include <alloca.h>
#include <stdio.h>
#include <unistd.h>
-#include <err.h>
#include <sys/systeminfo.h>
int
main(int argc, char **argv)
{
- int i, ac;
+ int i, ac, has64;
char **av, **p;
- char isaname[16];
ac = argc + 3;
av = p = alloca(sizeof (char *) * ac);
- *p++ = "/usr/java/bin/java";
+ *p++ = "java";
*p++ = "-jar";
*p++ = "/opt/SUNWdtrt/lib/java/jdtrace.jar";
@@ -54,9 +52,9 @@ main(int argc, char **argv)
}
p[i] = NULL;
- if (sysinfo(SI_ARCHITECTURE_64, isaname, sizeof (isaname)) != -1)
- asprintf(av, "/usr/java/bin/%s/java", isaname);
+ (void) execvp(av[0], av);
+
+ perror("exec failed");
- (void) execv(av[0], av);
- err(1, "exec failed");
+ return (0);
}
diff --git a/cmd/dtrace/test/cmd/scripts/dtest.pl b/cmd/dtrace/test/cmd/scripts/dtest.pl
index f11cf6916c52..3f2442950bbf 100644
--- a/cmd/dtrace/test/cmd/scripts/dtest.pl
+++ b/cmd/dtrace/test/cmd/scripts/dtest.pl
@@ -25,9 +25,6 @@
# Use is subject to license terms.
#
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
require 5.8.4;
use File::Find;
@@ -38,8 +35,8 @@ use Cwd 'abs_path';
$PNAME = $0;
$PNAME =~ s:.*/::;
-$OPTSTR = 'abd:fFghi:jlnqsx:';
-$USAGE = "Usage: $PNAME [-abfFghjlnqs] [-d dir] [-i isa] "
+$OPTSTR = 'abd:fghi:jlnqsx:';
+$USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] "
. "[-x opt[=arg]] [file | dir ...]\n";
($MACH = `uname -p`) =~ s/\W*\n//;
($PLATFORM = `uname -i`) =~ s/\W*\n//;
@@ -72,20 +69,6 @@ sub dirname {
return $i == -1 ? '.' : $i == 0 ? '/' : $s;
}
-sub inpath
-{
- my ($exec) = (@_);
- my @path = File::Spec->path();
-
- for my $dir (@path) {
- if (-x $dir . "/" . $exec) {
- return 1;
- }
- }
-
- return 0;
-}
-
sub usage
{
print $USAGE;
@@ -94,7 +77,6 @@ sub usage
print "\t -d specify directory for test results files and cores\n";
print "\t -g enable libumem debugging when running tests\n";
print "\t -f force bypassed tests to run\n";
- print "\t -F force tests to be run, even if missing dependencies\n";
print "\t -h display verbose usage message\n";
print "\t -i specify ISA to test instead of isaexec(3C) default\n";
print "\t -j execute test suite using jdtrace (Java API) only\n";
@@ -258,8 +240,8 @@ sub run_tests {
my($failed) = $errs;
my($total) = 0;
- die "$PNAME: $dtrace not found; aborting\n" unless (-x "$dtrace");
- logmsg("executing tests using $dtrace ...\n");
+ die "$PNAME: $dtrace not found\n" unless (-x "$dtrace");
+ logmsg($dtrace . "\n");
load_exceptions($exceptions_path);
@@ -564,20 +546,9 @@ $dt_bin = '/opt/SUNWdtrt/bin';
$defdir = -d $dt_tst ? $dt_tst : '.';
$bindir = -d $dt_bin ? $dt_bin : '.';
-if (!$opt_F) {
- my @dependencies = ("gcc", "make", "java", "perl");
-
- for my $dep (@dependencies) {
- if (!inpath($dep)) {
- die "$PNAME: '$dep' not found (use -F to force run)\n";
- }
- }
-}
-
find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0);
find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0);
find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0);
-
die $USAGE if (scalar(@files) == 0);
$dtrace_path = '/usr/sbin/dtrace';
@@ -591,7 +562,7 @@ if ($opt_j || $opt_n || $opt_i) {
push(@dtrace_cmds, $jdtrace_path) if ($opt_j);
push(@dtrace_cmds, "/usr/sbin/$opt_i/dtrace") if ($opt_i);
} else {
- @dtrace_cmds = ($dtrace_path);
+ @dtrace_cmds = ($dtrace_path, $jdtrace_path);
}
if ($opt_d) {
@@ -618,6 +589,12 @@ if ($opt_g) {
$ENV{'LD_PRELOAD'} = 'libumem.so';
}
+#
+# Ensure that $PATH contains a cc(1) so that we can execute the
+# test programs that require compilation of C code.
+#
+$ENV{'PATH'} = $ENV{'PATH'} . ':/ws/onnv-tools/SUNWspro/SS11/bin';
+
if ($opt_b) {
logmsg("badioctl'ing ... ");
diff --git a/cmd/dtrace/test/cmd/scripts/dtfailures.ksh b/cmd/dtrace/test/cmd/scripts/dtfailures.ksh
deleted file mode 100755
index 89ba955871ac..000000000000
--- a/cmd/dtrace/test/cmd/scripts/dtfailures.ksh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/ksh -p
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
-
-let failure=0
-
-printf "%-3s %-10s %-31s %s\n" "#" "KIND" "TEST" "DETAILS"
-
-while [[ -d failure.$failure ]]; do
- dir=failure.$failure
- tst=`cat $dir/README | head -1 | nawk '{ print $2 }'`
- kind=`basename $(dirname $tst)`
- name=`basename $tst`
- cols=$(expr `tput cols` - 47)
- details=`tail -1 $dir/*.err | cut -c1-$cols`
- printf "%-3d %-10s %-31s " $failure $kind $name
- echo $details
- let failure=failure+1
-done
-
diff --git a/cmd/dtrace/test/tst/common/aggs/tst.subr.d b/cmd/dtrace/test/tst/common/aggs/tst.subr.d
index bb0739f0d381..5ca1f1ef9389 100644
--- a/cmd/dtrace/test/tst/common/aggs/tst.subr.d
+++ b/cmd/dtrace/test/tst/common/aggs/tst.subr.d
@@ -24,6 +24,8 @@
* Use is subject to license terms.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
#include <sys/dtrace.h>
#define INTFUNC(x) \
@@ -96,8 +98,6 @@ INTFUNC(ntohll(0x1234567890abcdefL))
STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t))))
STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
-STRFUNC(toupper("foo"))
-STRFUNC(tolower("BAR"))
BEGIN
/subr == DIF_SUBR_MAX + 1/
diff --git a/cmd/dtrace/test/tst/common/buffering/tst.resize1.d b/cmd/dtrace/test/tst/common/buffering/tst.resize1.d
index ca8ad44a621b..396a80811629 100644
--- a/cmd/dtrace/test/tst/common/buffering/tst.resize1.d
+++ b/cmd/dtrace/test/tst/common/buffering/tst.resize1.d
@@ -24,6 +24,8 @@
* Use is subject to license terms.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
/*
* ASSERTION:
* Checks that setting "bufresize" to "auto" will cause buffer
@@ -32,8 +34,14 @@
* SECTION: Buffers and Buffering/Buffer Resizing Policy;
* Options and Tunables/bufsize;
* Options and Tunables/bufresize
+ *
+ * NOTES:
+ * We use the undocumented "preallocate" option to make sure dtrace(1M)
+ * has enough space in its heap to allocate a buffer as large as the
+ * kernel's trace buffer.
*/
+#pragma D option preallocate=100t
#pragma D option bufresize=auto
#pragma D option bufsize=100t
diff --git a/cmd/dtrace/test/tst/common/buffering/tst.resize2.d b/cmd/dtrace/test/tst/common/buffering/tst.resize2.d
index ddb97c89ec1f..50b814b1bfc1 100644
--- a/cmd/dtrace/test/tst/common/buffering/tst.resize2.d
+++ b/cmd/dtrace/test/tst/common/buffering/tst.resize2.d
@@ -24,6 +24,8 @@
* Use is subject to license terms.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
/*
* ASSERTION:
* Checks that setting "bufresize" to "auto" will cause buffer
@@ -32,8 +34,14 @@
* SECTION: Buffers and Buffering/Buffer Resizing Policy;
* Options and Tunables/aggsize;
* Options and Tunables/bufresize
+ *
+ * NOTES:
+ * We use the undocumented "preallocate" option to make sure dtrace(1M)
+ * has enough space in its heap to allocate a buffer as large as the
+ * kernel's trace buffer.
*/
+#pragma D option preallocate=100t
#pragma D option bufresize=auto
#pragma D option aggsize=100t
diff --git a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d b/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d
deleted file mode 100644
index 9d4e40b4dbde..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- trace(tolower(2152006));
- exit(1);
-}
diff --git a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d b/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d
deleted file mode 100644
index 2c1389bdeb48..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- trace(toupper(timestamp));
- exit(1);
-}
diff --git a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d b/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d
deleted file mode 100644
index 7d9c27f902d9..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- trace(tolower());
- exit(1);
-}
diff --git a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d b/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d
deleted file mode 100644
index afaa7f976ed6..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- trace(tolower("dory", "eel", "roughy"));
- exit(1);
-}
diff --git a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d b/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d
deleted file mode 100644
index 9658f6a75441..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- trace(toupper());
- exit(1);
-}
diff --git a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d b/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d
deleted file mode 100644
index bee8697fb2c4..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- trace(tolower("haino", "tylo"));
- exit(1);
-}
diff --git a/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d b/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d
deleted file mode 100644
index 1afe37dc689d..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-int64_t val[int];
-
-BEGIN
-{
- base = -2;
- i = 0;
- val[i++] = -10;
- val[i++] = -1;
- val[i++] = 0;
- val[i++] = 10;
- val[i++] = 100;
- val[i++] = 1000;
- val[i++] = (1LL << 62);
- maxval = i;
- i = 0;
-}
-
-tick-1ms
-/i < maxval/
-{
- printf("base %2d of %20d: ", base, val[i]);
-}
-
-tick-1ms
-/i < maxval/
-{
- printf(" %s\n", lltostr(val[i], base));
-}
-
-ERROR
-{
- printf(" <error>\n");
-}
-
-tick-1ms
-/i < maxval/
-{
- i++;
-}
-
-tick-1ms
-/i == maxval/
-{
- i = 0;
- base++;
-}
-
-tick-1ms
-/base > 40/
-{
- exit(0);
-}
-
diff --git a/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out b/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out
deleted file mode 100644
index 94e22577123a..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out
+++ /dev/null
@@ -1,302 +0,0 @@
-base -2 of -10: <error>
-base -2 of -1: <error>
-base -2 of 0: <error>
-base -2 of 10: <error>
-base -2 of 100: <error>
-base -2 of 1000: <error>
-base -2 of 4611686018427387904: <error>
-base -1 of -10: <error>
-base -1 of -1: <error>
-base -1 of 0: <error>
-base -1 of 10: <error>
-base -1 of 100: <error>
-base -1 of 1000: <error>
-base -1 of 4611686018427387904: <error>
-base 0 of -10: <error>
-base 0 of -1: <error>
-base 0 of 0: <error>
-base 0 of 10: <error>
-base 0 of 100: <error>
-base 0 of 1000: <error>
-base 0 of 4611686018427387904: <error>
-base 1 of -10: <error>
-base 1 of -1: <error>
-base 1 of 0: <error>
-base 1 of 10: <error>
-base 1 of 100: <error>
-base 1 of 1000: <error>
-base 1 of 4611686018427387904: <error>
-base 2 of -10: 1111111111111111111111111111111111111111111111111111111111110110
-base 2 of -1: 1111111111111111111111111111111111111111111111111111111111111111
-base 2 of 0: 0
-base 2 of 10: 1010
-base 2 of 100: 1100100
-base 2 of 1000: 1111101000
-base 2 of 4611686018427387904: 100000000000000000000000000000000000000000000000000000000000000
-base 3 of -10: 11112220022122120101211020120210210211120
-base 3 of -1: 11112220022122120101211020120210210211220
-base 3 of 0: 0
-base 3 of 10: 101
-base 3 of 100: 10201
-base 3 of 1000: 1101001
-base 3 of 4611686018427387904: 1010201120122220002201001122110012110111
-base 4 of -10: 33333333333333333333333333333312
-base 4 of -1: 33333333333333333333333333333333
-base 4 of 0: 0
-base 4 of 10: 22
-base 4 of 100: 1210
-base 4 of 1000: 33220
-base 4 of 4611686018427387904: 10000000000000000000000000000000
-base 5 of -10: 2214220303114400424121122411
-base 5 of -1: 2214220303114400424121122430
-base 5 of 0: 0
-base 5 of 10: 20
-base 5 of 100: 400
-base 5 of 1000: 13000
-base 5 of 4611686018427387904: 302141200402211214402403104
-base 6 of -10: 3520522010102100444244410
-base 6 of -1: 3520522010102100444244423
-base 6 of 0: 0
-base 6 of 10: 14
-base 6 of 100: 244
-base 6 of 1000: 4344
-base 6 of 4611686018427387904: 550120301313313111041104
-base 7 of -10: 45012021522523134134556
-base 7 of -1: 45012021522523134134601
-base 7 of 0: 0
-base 7 of 10: 13
-base 7 of 100: 202
-base 7 of 1000: 2626
-base 7 of 4611686018427387904: 11154003640456024361134
-base 8 of -10: 01777777777777777777766
-base 8 of -1: 01777777777777777777777
-base 8 of 0: 0
-base 8 of 10: 012
-base 8 of 100: 0144
-base 8 of 1000: 01750
-base 8 of 4611686018427387904: 0400000000000000000000
-base 9 of -10: 145808576354216723746
-base 9 of -1: 145808576354216723756
-base 9 of 0: 0
-base 9 of 10: 11
-base 9 of 100: 121
-base 9 of 1000: 1331
-base 9 of 4611686018427387904: 33646586081048405414
-base 10 of -10: -10
-base 10 of -1: -1
-base 10 of 0: 0
-base 10 of 10: 10
-base 10 of 100: 100
-base 10 of 1000: 1000
-base 10 of 4611686018427387904: 4611686018427387904
-base 11 of -10: 335500516a429071276
-base 11 of -1: 335500516a429071284
-base 11 of 0: 0
-base 11 of 10: a
-base 11 of 100: 91
-base 11 of 1000: 82a
-base 11 of 4611686018427387904: 9140013181078458a4
-base 12 of -10: 839365134a2a240706
-base 12 of -1: 839365134a2a240713
-base 12 of 0: 0
-base 12 of 10: a
-base 12 of 100: 84
-base 12 of 1000: 6b4
-base 12 of 4611686018427387904: 20b3a733a268670194
-base 13 of -10: 219505a9511a867b66
-base 13 of -1: 219505a9511a867b72
-base 13 of 0: 0
-base 13 of 10: a
-base 13 of 100: 79
-base 13 of 1000: 5bc
-base 13 of 4611686018427387904: 6c1349246a2881c84
-base 14 of -10: 8681049adb03db166
-base 14 of -1: 8681049adb03db171
-base 14 of 0: 0
-base 14 of 10: a
-base 14 of 100: 72
-base 14 of 1000: 516
-base 14 of 4611686018427387904: 219038263637dd3c4
-base 15 of -10: 2c1d56b648c6cd106
-base 15 of -1: 2c1d56b648c6cd110
-base 15 of 0: 0
-base 15 of 10: a
-base 15 of 100: 6a
-base 15 of 1000: 46a
-base 15 of 4611686018427387904: a7e8ce189a933404
-base 16 of -10: 0xfffffffffffffff6
-base 16 of -1: 0xffffffffffffffff
-base 16 of 0: 0x0
-base 16 of 10: 0xa
-base 16 of 100: 0x64
-base 16 of 1000: 0x3e8
-base 16 of 4611686018427387904: 0x4000000000000000
-base 17 of -10: 67979g60f5428008
-base 17 of -1: 67979g60f5428010
-base 17 of 0: 0
-base 17 of 10: a
-base 17 of 100: 5f
-base 17 of 1000: 37e
-base 17 of 4611686018427387904: 1a6a6ca03e10a88d
-base 18 of -10: 2d3fgb0b9cg4bd26
-base 18 of -1: 2d3fgb0b9cg4bd2f
-base 18 of 0: 0
-base 18 of 10: a
-base 18 of 100: 5a
-base 18 of 1000: 31a
-base 18 of 4611686018427387904: c588bdbfgd12ge4
-base 19 of -10: 141c8786h1ccaag7
-base 19 of -1: 141c8786h1ccaagg
-base 19 of 0: 0
-base 19 of 10: a
-base 19 of 100: 55
-base 19 of 1000: 2ec
-base 19 of 4611686018427387904: 5ecbb6fi9h7ggi9
-base 20 of -10: b53bjh07be4dj06
-base 20 of -1: b53bjh07be4dj0f
-base 20 of 0: 0
-base 20 of 10: a
-base 20 of 100: 50
-base 20 of 1000: 2a0
-base 20 of 4611686018427387904: 2g5hjj51hib39f4
-base 21 of -10: 5e8g4ggg7g56di6
-base 21 of -1: 5e8g4ggg7g56dif
-base 21 of 0: 0
-base 21 of 10: a
-base 21 of 100: 4g
-base 21 of 1000: 25d
-base 21 of 4611686018427387904: 18hjgjjjhebh8f4
-base 22 of -10: 2l4lf104353j8k6
-base 22 of -1: 2l4lf104353j8kf
-base 22 of 0: 0
-base 22 of 10: a
-base 22 of 100: 4c
-base 22 of 1000: 21a
-base 22 of 4611686018427387904: g6g95gc0hha7g4
-base 23 of -10: 1ddh88h2782i50j
-base 23 of -1: 1ddh88h2782i515
-base 23 of 0: 0
-base 23 of 10: a
-base 23 of 100: 48
-base 23 of 1000: 1kb
-base 23 of 4611686018427387904: 93a22467dc4chd
-base 24 of -10: l12ee5fn0ji1i6
-base 24 of -1: l12ee5fn0ji1if
-base 24 of 0: 0
-base 24 of 10: a
-base 24 of 100: 44
-base 24 of 1000: 1hg
-base 24 of 4611686018427387904: 566ffd9ni4mcag
-base 25 of -10: c9c336o0mlb7e6
-base 25 of -1: c9c336o0mlb7ef
-base 25 of 0: 0
-base 25 of 10: a
-base 25 of 100: 40
-base 25 of 1000: 1f0
-base 25 of 4611686018427387904: 32970kc6bo2kg4
-base 26 of -10: 7b7n2pcniokcg6
-base 26 of -1: 7b7n2pcniokcgf
-base 26 of 0: 0
-base 26 of 10: a
-base 26 of 100: 3m
-base 26 of 1000: 1cc
-base 26 of 4611686018427387904: 1m8c769io65344
-base 27 of -10: 4eo8hfam6fllmf
-base 27 of -1: 4eo8hfam6fllmo
-base 27 of 0: 0
-base 27 of 10: a
-base 27 of 100: 3j
-base 27 of 1000: 1a1
-base 27 of 4611686018427387904: 13jfho2j1hc5cd
-base 28 of -10: 2nc6j26l66rho6
-base 28 of -1: 2nc6j26l66rhof
-base 28 of 0: 0
-base 28 of 10: a
-base 28 of 100: 3g
-base 28 of 1000: 17k
-base 28 of 4611686018427387904: jo1ilfj8fkpd4
-base 29 of -10: 1n3rsh11f098re
-base 29 of -1: 1n3rsh11f098rn
-base 29 of 0: 0
-base 29 of 10: a
-base 29 of 100: 3d
-base 29 of 1000: 15e
-base 29 of 4611686018427387904: d0slim0b029e6
-base 30 of -10: 14l9lkmo30o406
-base 30 of -1: 14l9lkmo30o40f
-base 30 of 0: 0
-base 30 of 10: a
-base 30 of 100: 3a
-base 30 of 1000: 13a
-base 30 of 4611686018427387904: 8k9rrkl0ml104
-base 31 of -10: nd075ib45k866
-base 31 of -1: nd075ib45k86f
-base 31 of 0: 0
-base 31 of 10: a
-base 31 of 100: 37
-base 31 of 1000: 118
-base 31 of 4611686018427387904: 5qfh94i8okhh4
-base 32 of -10: fvvvvvvvvvvvm
-base 32 of -1: fvvvvvvvvvvvv
-base 32 of 0: 0
-base 32 of 10: a
-base 32 of 100: 34
-base 32 of 1000: v8
-base 32 of 4611686018427387904: 4000000000000
-base 33 of -10: b1w8p7j5q9r66
-base 33 of -1: b1w8p7j5q9r6f
-base 33 of 0: 0
-base 33 of 10: a
-base 33 of 100: 31
-base 33 of 1000: ua
-base 33 of 4611686018427387904: 2p826a4q6ivi4
-base 34 of -10: 7orp63sh4dph8
-base 34 of -1: 7orp63sh4dphh
-base 34 of 0: 0
-base 34 of 10: a
-base 34 of 100: 2w
-base 34 of 1000: te
-base 34 of 4611686018427387904: 1vnvr0wl9ketu
-base 35 of -10: 5g24a25twkwf6
-base 35 of -1: 5g24a25twkwff
-base 35 of 0: 0
-base 35 of 10: a
-base 35 of 100: 2u
-base 35 of 1000: sk
-base 35 of 4611686018427387904: 1cqrb9a7gvgu4
-base 36 of -10: 3w5e11264sgs6
-base 36 of -1: 3w5e11264sgsf
-base 36 of 0: 0
-base 36 of 10: a
-base 36 of 100: 2s
-base 36 of 1000: rs
-base 36 of 4611686018427387904: z1ci99jj7474
-base 37 of -10: <error>
-base 37 of -1: <error>
-base 37 of 0: <error>
-base 37 of 10: <error>
-base 37 of 100: <error>
-base 37 of 1000: <error>
-base 37 of 4611686018427387904: <error>
-base 38 of -10: <error>
-base 38 of -1: <error>
-base 38 of 0: <error>
-base 38 of 10: <error>
-base 38 of 100: <error>
-base 38 of 1000: <error>
-base 38 of 4611686018427387904: <error>
-base 39 of -10: <error>
-base 39 of -1: <error>
-base 39 of 0: <error>
-base 39 of 10: <error>
-base 39 of 100: <error>
-base 39 of 1000: <error>
-base 39 of 4611686018427387904: <error>
-base 40 of -10: <error>
-base 40 of -1: <error>
-base 40 of 0: <error>
-base 40 of 10: <error>
-base 40 of 100: <error>
-base 40 of 1000: <error>
-base 40 of 4611686018427387904: <error>
-
diff --git a/cmd/dtrace/test/tst/common/funcs/tst.tolower.d b/cmd/dtrace/test/tst/common/funcs/tst.tolower.d
deleted file mode 100644
index 2539630e9d66..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/tst.tolower.d
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-BEGIN
-{
- i = 0;
-
- input[i] = "ahi";
- expected[i++] = "ahi";
-
- input[i] = "MaHi!";
- expected[i++] = "mahi!";
-
- input[i] = " Nase-5";
- expected[i++] = " nase-5";
-
- input[i] = "!@#$%";
- expected[i++] = "!@#$%";
-
- i = 0;
-}
-
-tick-1ms
-/input[i] != NULL && (this->out = tolower(input[i])) != expected[i]/
-{
- printf("expected tolower(\"%s\") to be \"%s\"; found \"%s\"\n",
- input[i], expected[i], this->out);
- exit(1);
-}
-
-tick-1ms
-/input[i] != NULL/
-{
- printf("tolower(\"%s\") is \"%s\", as expected\n",
- input[i], expected[i]);
-}
-
-tick-1ms
-/input[i++] == NULL/
-{
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/funcs/tst.toupper.d b/cmd/dtrace/test/tst/common/funcs/tst.toupper.d
deleted file mode 100644
index fd803f2ef0af..000000000000
--- a/cmd/dtrace/test/tst/common/funcs/tst.toupper.d
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-BEGIN
-{
- i = 0;
-
- input[i] = "ahi";
- expected[i++] = "AHI";
-
- input[i] = "MaHi!";
- expected[i++] = "MAHI!";
-
- input[i] = " dace-9";
- expected[i++] = " DACE-9";
-
- input[i] = "!@#$%";
- expected[i++] = "!@#$%";
-
- i = 0;
-}
-
-tick-1ms
-/input[i] != NULL && (this->out = toupper(input[i])) != expected[i]/
-{
- printf("expected toupper(\"%s\") to be \"%s\"; found \"%s\"\n",
- input[i], expected[i], this->out);
- exit(1);
-}
-
-tick-1ms
-/input[i] != NULL/
-{
- printf("toupper(\"%s\") is \"%s\", as expected\n",
- input[i], expected[i]);
-}
-
-tick-1ms
-/input[i++] == NULL/
-{
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh b/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh
deleted file mode 100644
index b8240d64367c..000000000000
--- a/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent Inc. All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# This test verifies that we only use the first entry of a file with a given
-# name in the library path
-#
-
-if [ $# != 1 ]; then
- echo expected one argument: '<'dtrace-path'>'
- exit 2
-fi
-
-firstinc=${TMPDIR:-/tmp}/firstinc.$$
-secondinc=${TMPDIR:-/tmp}/secondinc.$$
-expexit=23
-
-setup_include()
-{
- mkdir $firstinc
- mkdir $secondinc
- cat > $firstinc/lib.d <<EOF
-inline int foobar = $expexit;
-#pragma D binding "1.0" foobar
-EOF
- cat > $secondinc/lib.d <<EOF
-inline int foobar = 42;
-#pragma D binding "1.0" foobar
-EOF
-}
-
-clean()
-{
- rm -rf $firstinc
- rm -rf $secondinc
-}
-
-fail()
-{
- echo "$@"
- clean
- exit 1
-}
-
-setup_include
-
-dtrace -L$firstinc -L$secondinc -e -n 'BEGIN{ exit(foobar) }'
-[[ $? != 0 ]] && fail "Failed to compile with same file in include path twice"
-dtrace -L$firstinc -L$secondinc -n 'BEGIN{ exit(foobar) }'
-status=$?
-[[ $status != $expexit ]] && fail "Exited with unexpected status code: $status"
-clean
-exit 0
diff --git a/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl b/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
index d2dc8fdbeeb6..fb41255473e6 100755
--- a/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
+++ b/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
@@ -1,4 +1,4 @@
-#!/usr/perl5/bin/perl -w
+#!/usr/bin/perl -w
#
# CDDL HEADER START
#
@@ -24,6 +24,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#pragma ident "%Z%%M% %I% %E% SMI"
#
# get.ipv4remote.pl [tcpport]
diff --git a/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl b/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
index 3b1999f62be7..051ab8c3c32c 100755
--- a/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
+++ b/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
@@ -1,4 +1,4 @@
-#!/usr/perl5/bin/perl -w
+#!/usr/bin/perl -w
#
# CDDL HEADER START
#
@@ -24,6 +24,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#pragma ident "%Z%%M% %I% %E% SMI"
#
# get.ipv6remote.pl
diff --git a/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh b/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
index 4527940ebf87..6fa8c35bf3b3 100755
--- a/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
+++ b/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
@@ -75,7 +75,7 @@ cat > test.pl <<-EOPERL
close \$s;
EOPERL
-$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
BEGIN
{
ipsend = tcpsend = ipreceive = tcpreceive = 0;
diff --git a/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh b/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
index 33d058b90455..89a0cdb95eea 100755
--- a/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
+++ b/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
@@ -78,7 +78,7 @@ cat > test.pl <<-EOPERL
close \$s;
EOPERL
-$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
BEGIN
{
ipsend = tcpsend = ipreceive = tcpreceive = 0;
diff --git a/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh b/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
index 9f730754950b..8a65ce6f8d66 100644
--- a/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
+++ b/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
@@ -81,7 +81,7 @@ cat > test.pl <<-EOPERL
close \$s;
EOPERL
-$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
BEGIN
{
ipsend = tcpsend = ipreceive = tcpreceive = 0;
diff --git a/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh b/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
index cf6d1dcece84..b6b9545d4e20 100644
--- a/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
+++ b/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
@@ -86,7 +86,7 @@ cat > test.pl <<-EOPERL
close \$s;
EOPERL
-$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
BEGIN
{
ipsend = tcpsend = ipreceive = tcpreceive = 0;
diff --git a/cmd/dtrace/test/tst/common/java_api/src/TestBean.java b/cmd/dtrace/test/tst/common/java_api/src/TestBean.java
index 41a04a1394cb..dd4a969d4355 100644
--- a/cmd/dtrace/test/tst/common/java_api/src/TestBean.java
+++ b/cmd/dtrace/test/tst/common/java_api/src/TestBean.java
@@ -22,6 +22,8 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
*/
import org.opensolaris.os.dtrace.*;
@@ -48,7 +50,6 @@ public class TestBean {
"KernelStackRecord",
"LogDistribution",
"LinearDistribution",
- "LogLinearDistribution",
"Option",
"ProcessState",
"ProbeDescription",
@@ -263,50 +264,6 @@ public class TestBean {
return d;
}
- public static LogLinearDistribution
- getLogLinearDistribution()
- {
- Distribution.Bucket bucket;
- long next, step;
- long low = 0;
- long high = 6;
- long factor = 2;
- long nsteps = 2;
- int value = 1;
- int order;
-
- List < Distribution.Bucket > buckets =
- new ArrayList < Distribution.Bucket > ();
-
- for (order = 0; order < low; order++)
- value *= factor;
-
- bucket = new Distribution.Bucket(Long.MIN_VALUE, (value - 1), 0);
- buckets.add(bucket);
-
- next = value * factor;
- step = (next > nsteps) ? (next / nsteps) : 1;
-
- while (order <= high) {
- bucket = new Distribution.Bucket(value, value + step - 1, 5);
- buckets.add(bucket);
-
- if ((value += step) != next)
- continue;
-
- next = value * factor;
- step = (next > nsteps) ? (next / nsteps) : 1;
- order++;
- }
-
- bucket = new Distribution.Bucket(value, Long.MAX_VALUE, 0);
- buckets.add(bucket);
-
- LogLinearDistribution d = new LogLinearDistribution(factor, low, high,
- nsteps, 0, buckets);
- return d;
- }
-
public static Option
getOption()
{
diff --git a/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out b/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out
index 141dcccb1caa..cf24c672645e 100644
--- a/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out
+++ b/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out
@@ -158,12 +158,6 @@ LinearDistribution:
LinearDistribution:
encoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
decoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
-LogLinearDistribution:
- serialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
- deserialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
-LogLinearDistribution:
- encoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
- decoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
Option:
serialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
deserialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d
deleted file mode 100644
index b11d2828bb7f..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 10, 25);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d
deleted file mode 100644
index c8af7d920f3c..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 10, 30);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d
deleted file mode 100644
index 0404b4ffbdcf..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 10, 10);
- @ = llquantize(0, 3, 0, 10, 81);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d
deleted file mode 100644
index fd6b0e67f261..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 10, 7);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d
deleted file mode 100644
index 7074f5f66501..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 1, 0, 10, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d
deleted file mode 100644
index ea39c7e38ca9..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- this->doogle = 10;
- @ = llquantize(0, this->doogle, 0, 10, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d
deleted file mode 100644
index a1ad20f28a62..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 65537, 0, 10, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d
deleted file mode 100644
index 46bf0e6fc206..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 10, 10);
- @ = llquantize(0, 10, 0, 11, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d
deleted file mode 100644
index fee786d39e0d..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- this->doogle = 10;
- @ = llquantize(0, 10, 0, this->doogle, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d
deleted file mode 100644
index 531ab0b6641f..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, -1, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d
deleted file mode 100644
index 126429a2996d..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 10, 10);
- @ = llquantize(0, 10, 1, 10, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d
deleted file mode 100644
index 2a9b2efdc8d1..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- this->doogle = 0;
- @ = llquantize(0, 10, this->doogle, 10, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d
deleted file mode 100644
index e1045d83bdcf..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, -1, 10, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d
deleted file mode 100644
index 9852c1ab9532..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 10, 0, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d
deleted file mode 100644
index c7076308446b..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 100, 10);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d
deleted file mode 100644
index 77b4d8a84d20..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(0, 10, 0, 10, 10);
- @ = llquantize(0, 10, 0, 10, 100);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d
deleted file mode 100644
index 4eb9b2f06d0a..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- this->doogle = 10;
- @ = llquantize(0, 10, 0, 10, this->doogle);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d b/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d
deleted file mode 100644
index 3855beb4adc2..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- @ = llquantize(123, 10, 0, 10, 123456);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.bases.d b/cmd/dtrace/test/tst/common/llquantize/tst.bases.d
deleted file mode 100644
index e3a6ff1a8cde..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.bases.d
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-tick-1ms
-/i++ <= 100/
-{
- @two = llquantize(i, 2, 0, 6, 2);
- @three = llquantize(i, 3, 0, 1, 9);
- @four = llquantize(i, 4, 0, 1, 4);
- @five = llquantize(i, 5, 0, 1, 25);
- @six = llquantize(i, 6, 0, 3, 12);
- @seven = llquantize(i, 7, 0, 1, 7);
- @eight = llquantize(i, 8, 0, 1, 16);
- @nine = llquantize(i, 9, 0, 1, 9);
- @ten = llquantize(i, 10, 0, 1, 10);
-}
-
-tick-1ms
-/i > 100/
-{
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out
deleted file mode 100644
index 1b207bf6f292..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 |@ 2
- 4 |@@ 4
- 8 |@@@ 8
- 16 |@@@@@@ 16
- 32 |@@@@@@@@@@@@@ 32
- 64 |@@@@@@@@@@@@@@@ 38
- >= 128 | 0
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 | 1
- 8 | 1
- >= 9 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 93
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 |@@ 4
- 8 |@@ 4
- 12 |@@ 4
- >= 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 86
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 | 1
- 8 | 1
- 9 | 1
- 10 | 1
- 11 | 1
- 12 | 1
- 13 | 1
- 14 | 1
- 15 | 1
- 16 | 1
- 17 | 1
- 18 | 1
- 19 | 1
- 20 | 1
- 21 | 1
- 22 | 1
- 23 | 1
- 24 | 1
- >= 25 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 77
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 |@ 3
- 9 |@ 3
- 12 |@ 3
- 15 |@ 3
- 18 |@ 3
- 21 |@ 3
- 24 |@ 3
- 27 |@ 3
- 30 |@ 3
- 33 |@ 3
- 36 |@@@@@@@ 18
- 54 |@@@@@@@ 18
- 72 |@@@@@@@ 18
- 90 |@@@@@ 12
- 108 | 0
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 |@@@ 7
- 14 |@@@ 7
- 21 |@@@ 7
- 28 |@@@ 7
- 35 |@@@ 7
- 42 |@@@ 7
- >= 49 |@@@@@@@@@@@@@@@@@@@@@ 53
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 | 1
- 8 |@@ 4
- 12 |@@ 4
- 16 |@@ 4
- 20 |@@ 4
- 24 |@@ 4
- 28 |@@ 4
- 32 |@@ 4
- 36 |@@ 4
- 40 |@@ 4
- 44 |@@ 4
- 48 |@@ 4
- 52 |@@ 4
- 56 |@@ 4
- 60 |@@ 4
- >= 64 |@@@@@@@@@@@@@@@ 38
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 | 1
- 8 | 1
- 9 |@@@@ 9
- 18 |@@@@ 9
- 27 |@@@@ 9
- 36 |@@@@ 9
- 45 |@@@@ 9
- 54 |@@@@ 9
- 63 |@@@@ 9
- 72 |@@@@ 9
- >= 81 |@@@@@@@@ 21
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 | 1
- 8 | 1
- 9 | 1
- 10 |@@@@ 10
- 20 |@@@@ 10
- 30 |@@@@ 10
- 40 |@@@@ 10
- 50 |@@@@ 10
- 60 |@@@@ 10
- 70 |@@@@ 10
- 80 |@@@@ 10
- 90 |@@@@ 10
- >= 100 |@ 2
-
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.basic.d b/cmd/dtrace/test/tst/common/llquantize/tst.basic.d
deleted file mode 100644
index 57b6ed881b7f..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.basic.d
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-tick-1ms
-/i++ <= 100/
-{
- @ = llquantize(i, 10, 0, 10, 10);
-}
-
-tick-1ms
-/i > 100/
-{
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out
deleted file mode 100644
index 9a7b288966f3..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 | 1
- 8 | 1
- 9 | 1
- 10 |@@@@ 10
- 20 |@@@@ 10
- 30 |@@@@ 10
- 40 |@@@@ 10
- 50 |@@@@ 10
- 60 |@@@@ 10
- 70 |@@@@ 10
- 80 |@@@@ 10
- 90 |@@@@ 10
- 100 |@ 2
- 200 | 0
-
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d b/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d
deleted file mode 100644
index b18c688bc750..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-BEGIN
-{
- a = 7;
- b = 13;
- val = (-a * b) + a;
-}
-
-tick-1ms
-{
- incr = val % b;
- val += a;
-}
-
-tick-1ms
-/val == 0/
-{
- val += a;
-}
-
-tick-1ms
-/incr != 0/
-{
- i++;
- @llquanty[i] = llquantize(1, 10, 0, 10, 10, incr);
-}
-
-tick-1ms
-/incr == 0/
-{
- printf("Ordering of llquantize() with some negative weights:\n");
- printa(@llquanty);
- printf("\n");
-
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out
deleted file mode 100644
index ac0f3cb300e1..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out
+++ /dev/null
@@ -1,148 +0,0 @@
-Ordering of llquantize() with some negative weights:
-
- 2
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
- 2 | 0
-
- 4
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
- 2 | 0
-
- 6
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
- 2 | 0
-
- 8
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
- 2 | 0
-
- 10
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
- 2 | 0
-
- 12
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
- 2 | 0
-
- 1
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
- 2 | 0
-
- 3
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
- 2 | 0
-
- 5
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
- 2 | 0
-
- 7
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
- 2 | 0
-
- 9
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
- 2 | 0
-
- 11
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
- 2 | 0
-
- 14
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
- 2 | 0
-
- 16
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
- 2 | 0
-
- 18
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
- 2 | 0
-
- 20
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
- 2 | 0
-
- 22
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
- 2 | 0
-
- 24
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
- 2 | 0
-
- 13
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
- 2 | 0
-
- 15
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
- 2 | 0
-
- 17
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
- 2 | 0
-
- 19
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
- 2 | 0
-
- 21
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
- 2 | 0
-
- 23
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
- 2 | 0
-
-
-
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d b/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d
deleted file mode 100644
index c74d019cb186..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-tick-1ms
-/i++ <= 100/
-{
- @ = llquantize(i, 10, 0, 10, 10, 50 - i);
-}
-
-tick-1ms
-/i > 100/
-{
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out
deleted file mode 100644
index 04b0d5e1bded..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 49
- 2 | 48
- 3 | 47
- 4 | 46
- 5 | 45
- 6 | 44
- 7 | 43
- 8 | 42
- 9 | 41
- 10 |@@@ 355
- 20 |@@ 255
- 30 |@ 155
- 40 | 55
- 50 | -45
- 60 @| -145
- 70 @@| -245
- 80 @@@| -345
- 90 @@@| -445
- 100 @| -101
- 200 | 0
-
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.normal.d b/cmd/dtrace/test/tst/common/llquantize/tst.normal.d
deleted file mode 100644
index 7097ba7d33c7..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.normal.d
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-tick-1ms
-/i++ <= 100/
-{
- @ = llquantize(i, 10, 0, 10, 10);
-}
-
-tick-1ms
-/i > 100/
-{
- normalize(@, 10);
- printa(@);
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out
deleted file mode 100644
index 3b1f41b218fc..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 0
- 2 | 0
- 3 | 0
- 4 | 0
- 5 | 0
- 6 | 0
- 7 | 0
- 8 | 0
- 9 | 0
- 10 |@@@@ 1
- 20 |@@@@ 1
- 30 |@@@@ 1
- 40 |@@@@ 1
- 50 |@@@@ 1
- 60 |@@@@ 1
- 70 |@@@@ 1
- 80 |@@@@ 1
- 90 |@@@@ 1
- 100 |@ 0
- 200 | 0
-
-
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.range.d b/cmd/dtrace/test/tst/common/llquantize/tst.range.d
deleted file mode 100644
index e2882b3f8e3f..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.range.d
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-BEGIN
-{
- @["Screven"] = llquantize(0, 10, 1, 2, 20, 25);
- @["Katz"] = llquantize(1, 10, 1, 2, 20, -100);
- @["Kurian"] = llquantize(7, 10, 1, 2, 20, 15);
- @["Rozwat"] = llquantize(49, 10, 1, 2, 20, 15);
- @["Fowler"] = llquantize(343, 10, 1, 2, 20, 150);
-
- printa(@);
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out
deleted file mode 100644
index c6736c6fc153..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out
+++ /dev/null
@@ -1,29 +0,0 @@
-
- Katz
- value ------------- Distribution ------------- count
- < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100
- 10 | 0
-
- Kurian
- value ------------- Distribution ------------- count
- < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 15
- 10 | 0
-
- Screven
- value ------------- Distribution ------------- count
- < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 25
- 10 | 0
-
- Rozwat
- value ------------- Distribution ------------- count
- 40 | 0
- 45 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 15
- 50 | 0
-
- Fowler
- value ------------- Distribution ------------- count
- 250 | 0
- 300 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 150
- 350 | 0
-
-
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.steps.d b/cmd/dtrace/test/tst/common/llquantize/tst.steps.d
deleted file mode 100644
index f00659e57513..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.steps.d
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-tick-1ms
-/i++ <= 100/
-{
- @ = llquantize(i, 10, 0, 10, 20);
- @hunid = llquantize(i * 10, 10, 0, 10, 100);
- @large = llquantize(i * 100, 10, 0, 10, 1000);
-}
-
-tick-1ms
-/i > 100/
-{
- exit(0);
-}
-
-END
-{
- printf("20 steps:\n");
- printa(@);
-
- printf("100 steps:\n");
- printa(@hunid);
-
- printf("1000 steps:\n");
- printa(@large);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out
deleted file mode 100644
index 08885515c002..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out
+++ /dev/null
@@ -1,2033 +0,0 @@
-20 steps:
-
-
- value ------------- Distribution ------------- count
- < 1 | 0
- 1 | 1
- 2 | 1
- 3 | 1
- 4 | 1
- 5 | 1
- 6 | 1
- 7 | 1
- 8 | 1
- 9 | 1
- 10 |@@ 5
- 15 |@@ 5
- 20 |@@ 5
- 25 |@@ 5
- 30 |@@ 5
- 35 |@@ 5
- 40 |@@ 5
- 45 |@@ 5
- 50 |@@ 5
- 55 |@@ 5
- 60 |@@ 5
- 65 |@@ 5
- 70 |@@ 5
- 75 |@@ 5
- 80 |@@ 5
- 85 |@@ 5
- 90 |@@ 5
- 95 |@@ 5
- 100 |@ 2
- 150 | 0
-
-100 steps:
-
-
- value ------------- Distribution ------------- count
- 9 | 0
- 10 | 1
- 11 | 0
- 12 | 0
- 13 | 0
- 14 | 0
- 15 | 0
- 16 | 0
- 17 | 0
- 18 | 0
- 19 | 0
- 20 | 1
- 21 | 0
- 22 | 0
- 23 | 0
- 24 | 0
- 25 | 0
- 26 | 0
- 27 | 0
- 28 | 0
- 29 | 0
- 30 | 1
- 31 | 0
- 32 | 0
- 33 | 0
- 34 | 0
- 35 | 0
- 36 | 0
- 37 | 0
- 38 | 0
- 39 | 0
- 40 | 1
- 41 | 0
- 42 | 0
- 43 | 0
- 44 | 0
- 45 | 0
- 46 | 0
- 47 | 0
- 48 | 0
- 49 | 0
- 50 | 1
- 51 | 0
- 52 | 0
- 53 | 0
- 54 | 0
- 55 | 0
- 56 | 0
- 57 | 0
- 58 | 0
- 59 | 0
- 60 | 1
- 61 | 0
- 62 | 0
- 63 | 0
- 64 | 0
- 65 | 0
- 66 | 0
- 67 | 0
- 68 | 0
- 69 | 0
- 70 | 1
- 71 | 0
- 72 | 0
- 73 | 0
- 74 | 0
- 75 | 0
- 76 | 0
- 77 | 0
- 78 | 0
- 79 | 0
- 80 | 1
- 81 | 0
- 82 | 0
- 83 | 0
- 84 | 0
- 85 | 0
- 86 | 0
- 87 | 0
- 88 | 0
- 89 | 0
- 90 | 1
- 91 | 0
- 92 | 0
- 93 | 0
- 94 | 0
- 95 | 0
- 96 | 0
- 97 | 0
- 98 | 0
- 99 | 0
- 100 | 1
- 110 | 1
- 120 | 1
- 130 | 1
- 140 | 1
- 150 | 1
- 160 | 1
- 170 | 1
- 180 | 1
- 190 | 1
- 200 | 1
- 210 | 1
- 220 | 1
- 230 | 1
- 240 | 1
- 250 | 1
- 260 | 1
- 270 | 1
- 280 | 1
- 290 | 1
- 300 | 1
- 310 | 1
- 320 | 1
- 330 | 1
- 340 | 1
- 350 | 1
- 360 | 1
- 370 | 1
- 380 | 1
- 390 | 1
- 400 | 1
- 410 | 1
- 420 | 1
- 430 | 1
- 440 | 1
- 450 | 1
- 460 | 1
- 470 | 1
- 480 | 1
- 490 | 1
- 500 | 1
- 510 | 1
- 520 | 1
- 530 | 1
- 540 | 1
- 550 | 1
- 560 | 1
- 570 | 1
- 580 | 1
- 590 | 1
- 600 | 1
- 610 | 1
- 620 | 1
- 630 | 1
- 640 | 1
- 650 | 1
- 660 | 1
- 670 | 1
- 680 | 1
- 690 | 1
- 700 | 1
- 710 | 1
- 720 | 1
- 730 | 1
- 740 | 1
- 750 | 1
- 760 | 1
- 770 | 1
- 780 | 1
- 790 | 1
- 800 | 1
- 810 | 1
- 820 | 1
- 830 | 1
- 840 | 1
- 850 | 1
- 860 | 1
- 870 | 1
- 880 | 1
- 890 | 1
- 900 | 1
- 910 | 1
- 920 | 1
- 930 | 1
- 940 | 1
- 950 | 1
- 960 | 1
- 970 | 1
- 980 | 1
- 990 | 1
- 1000 |@ 2
- 1100 | 0
-
-1000 steps:
-
-
- value ------------- Distribution ------------- count
- 99 | 0
- 100 | 1
- 101 | 0
- 102 | 0
- 103 | 0
- 104 | 0
- 105 | 0
- 106 | 0
- 107 | 0
- 108 | 0
- 109 | 0
- 110 | 0
- 111 | 0
- 112 | 0
- 113 | 0
- 114 | 0
- 115 | 0
- 116 | 0
- 117 | 0
- 118 | 0
- 119 | 0
- 120 | 0
- 121 | 0
- 122 | 0
- 123 | 0
- 124 | 0
- 125 | 0
- 126 | 0
- 127 | 0
- 128 | 0
- 129 | 0
- 130 | 0
- 131 | 0
- 132 | 0
- 133 | 0
- 134 | 0
- 135 | 0
- 136 | 0
- 137 | 0
- 138 | 0
- 139 | 0
- 140 | 0
- 141 | 0
- 142 | 0
- 143 | 0
- 144 | 0
- 145 | 0
- 146 | 0
- 147 | 0
- 148 | 0
- 149 | 0
- 150 | 0
- 151 | 0
- 152 | 0
- 153 | 0
- 154 | 0
- 155 | 0
- 156 | 0
- 157 | 0
- 158 | 0
- 159 | 0
- 160 | 0
- 161 | 0
- 162 | 0
- 163 | 0
- 164 | 0
- 165 | 0
- 166 | 0
- 167 | 0
- 168 | 0
- 169 | 0
- 170 | 0
- 171 | 0
- 172 | 0
- 173 | 0
- 174 | 0
- 175 | 0
- 176 | 0
- 177 | 0
- 178 | 0
- 179 | 0
- 180 | 0
- 181 | 0
- 182 | 0
- 183 | 0
- 184 | 0
- 185 | 0
- 186 | 0
- 187 | 0
- 188 | 0
- 189 | 0
- 190 | 0
- 191 | 0
- 192 | 0
- 193 | 0
- 194 | 0
- 195 | 0
- 196 | 0
- 197 | 0
- 198 | 0
- 199 | 0
- 200 | 1
- 201 | 0
- 202 | 0
- 203 | 0
- 204 | 0
- 205 | 0
- 206 | 0
- 207 | 0
- 208 | 0
- 209 | 0
- 210 | 0
- 211 | 0
- 212 | 0
- 213 | 0
- 214 | 0
- 215 | 0
- 216 | 0
- 217 | 0
- 218 | 0
- 219 | 0
- 220 | 0
- 221 | 0
- 222 | 0
- 223 | 0
- 224 | 0
- 225 | 0
- 226 | 0
- 227 | 0
- 228 | 0
- 229 | 0
- 230 | 0
- 231 | 0
- 232 | 0
- 233 | 0
- 234 | 0
- 235 | 0
- 236 | 0
- 237 | 0
- 238 | 0
- 239 | 0
- 240 | 0
- 241 | 0
- 242 | 0
- 243 | 0
- 244 | 0
- 245 | 0
- 246 | 0
- 247 | 0
- 248 | 0
- 249 | 0
- 250 | 0
- 251 | 0
- 252 | 0
- 253 | 0
- 254 | 0
- 255 | 0
- 256 | 0
- 257 | 0
- 258 | 0
- 259 | 0
- 260 | 0
- 261 | 0
- 262 | 0
- 263 | 0
- 264 | 0
- 265 | 0
- 266 | 0
- 267 | 0
- 268 | 0
- 269 | 0
- 270 | 0
- 271 | 0
- 272 | 0
- 273 | 0
- 274 | 0
- 275 | 0
- 276 | 0
- 277 | 0
- 278 | 0
- 279 | 0
- 280 | 0
- 281 | 0
- 282 | 0
- 283 | 0
- 284 | 0
- 285 | 0
- 286 | 0
- 287 | 0
- 288 | 0
- 289 | 0
- 290 | 0
- 291 | 0
- 292 | 0
- 293 | 0
- 294 | 0
- 295 | 0
- 296 | 0
- 297 | 0
- 298 | 0
- 299 | 0
- 300 | 1
- 301 | 0
- 302 | 0
- 303 | 0
- 304 | 0
- 305 | 0
- 306 | 0
- 307 | 0
- 308 | 0
- 309 | 0
- 310 | 0
- 311 | 0
- 312 | 0
- 313 | 0
- 314 | 0
- 315 | 0
- 316 | 0
- 317 | 0
- 318 | 0
- 319 | 0
- 320 | 0
- 321 | 0
- 322 | 0
- 323 | 0
- 324 | 0
- 325 | 0
- 326 | 0
- 327 | 0
- 328 | 0
- 329 | 0
- 330 | 0
- 331 | 0
- 332 | 0
- 333 | 0
- 334 | 0
- 335 | 0
- 336 | 0
- 337 | 0
- 338 | 0
- 339 | 0
- 340 | 0
- 341 | 0
- 342 | 0
- 343 | 0
- 344 | 0
- 345 | 0
- 346 | 0
- 347 | 0
- 348 | 0
- 349 | 0
- 350 | 0
- 351 | 0
- 352 | 0
- 353 | 0
- 354 | 0
- 355 | 0
- 356 | 0
- 357 | 0
- 358 | 0
- 359 | 0
- 360 | 0
- 361 | 0
- 362 | 0
- 363 | 0
- 364 | 0
- 365 | 0
- 366 | 0
- 367 | 0
- 368 | 0
- 369 | 0
- 370 | 0
- 371 | 0
- 372 | 0
- 373 | 0
- 374 | 0
- 375 | 0
- 376 | 0
- 377 | 0
- 378 | 0
- 379 | 0
- 380 | 0
- 381 | 0
- 382 | 0
- 383 | 0
- 384 | 0
- 385 | 0
- 386 | 0
- 387 | 0
- 388 | 0
- 389 | 0
- 390 | 0
- 391 | 0
- 392 | 0
- 393 | 0
- 394 | 0
- 395 | 0
- 396 | 0
- 397 | 0
- 398 | 0
- 399 | 0
- 400 | 1
- 401 | 0
- 402 | 0
- 403 | 0
- 404 | 0
- 405 | 0
- 406 | 0
- 407 | 0
- 408 | 0
- 409 | 0
- 410 | 0
- 411 | 0
- 412 | 0
- 413 | 0
- 414 | 0
- 415 | 0
- 416 | 0
- 417 | 0
- 418 | 0
- 419 | 0
- 420 | 0
- 421 | 0
- 422 | 0
- 423 | 0
- 424 | 0
- 425 | 0
- 426 | 0
- 427 | 0
- 428 | 0
- 429 | 0
- 430 | 0
- 431 | 0
- 432 | 0
- 433 | 0
- 434 | 0
- 435 | 0
- 436 | 0
- 437 | 0
- 438 | 0
- 439 | 0
- 440 | 0
- 441 | 0
- 442 | 0
- 443 | 0
- 444 | 0
- 445 | 0
- 446 | 0
- 447 | 0
- 448 | 0
- 449 | 0
- 450 | 0
- 451 | 0
- 452 | 0
- 453 | 0
- 454 | 0
- 455 | 0
- 456 | 0
- 457 | 0
- 458 | 0
- 459 | 0
- 460 | 0
- 461 | 0
- 462 | 0
- 463 | 0
- 464 | 0
- 465 | 0
- 466 | 0
- 467 | 0
- 468 | 0
- 469 | 0
- 470 | 0
- 471 | 0
- 472 | 0
- 473 | 0
- 474 | 0
- 475 | 0
- 476 | 0
- 477 | 0
- 478 | 0
- 479 | 0
- 480 | 0
- 481 | 0
- 482 | 0
- 483 | 0
- 484 | 0
- 485 | 0
- 486 | 0
- 487 | 0
- 488 | 0
- 489 | 0
- 490 | 0
- 491 | 0
- 492 | 0
- 493 | 0
- 494 | 0
- 495 | 0
- 496 | 0
- 497 | 0
- 498 | 0
- 499 | 0
- 500 | 1
- 501 | 0
- 502 | 0
- 503 | 0
- 504 | 0
- 505 | 0
- 506 | 0
- 507 | 0
- 508 | 0
- 509 | 0
- 510 | 0
- 511 | 0
- 512 | 0
- 513 | 0
- 514 | 0
- 515 | 0
- 516 | 0
- 517 | 0
- 518 | 0
- 519 | 0
- 520 | 0
- 521 | 0
- 522 | 0
- 523 | 0
- 524 | 0
- 525 | 0
- 526 | 0
- 527 | 0
- 528 | 0
- 529 | 0
- 530 | 0
- 531 | 0
- 532 | 0
- 533 | 0
- 534 | 0
- 535 | 0
- 536 | 0
- 537 | 0
- 538 | 0
- 539 | 0
- 540 | 0
- 541 | 0
- 542 | 0
- 543 | 0
- 544 | 0
- 545 | 0
- 546 | 0
- 547 | 0
- 548 | 0
- 549 | 0
- 550 | 0
- 551 | 0
- 552 | 0
- 553 | 0
- 554 | 0
- 555 | 0
- 556 | 0
- 557 | 0
- 558 | 0
- 559 | 0
- 560 | 0
- 561 | 0
- 562 | 0
- 563 | 0
- 564 | 0
- 565 | 0
- 566 | 0
- 567 | 0
- 568 | 0
- 569 | 0
- 570 | 0
- 571 | 0
- 572 | 0
- 573 | 0
- 574 | 0
- 575 | 0
- 576 | 0
- 577 | 0
- 578 | 0
- 579 | 0
- 580 | 0
- 581 | 0
- 582 | 0
- 583 | 0
- 584 | 0
- 585 | 0
- 586 | 0
- 587 | 0
- 588 | 0
- 589 | 0
- 590 | 0
- 591 | 0
- 592 | 0
- 593 | 0
- 594 | 0
- 595 | 0
- 596 | 0
- 597 | 0
- 598 | 0
- 599 | 0
- 600 | 1
- 601 | 0
- 602 | 0
- 603 | 0
- 604 | 0
- 605 | 0
- 606 | 0
- 607 | 0
- 608 | 0
- 609 | 0
- 610 | 0
- 611 | 0
- 612 | 0
- 613 | 0
- 614 | 0
- 615 | 0
- 616 | 0
- 617 | 0
- 618 | 0
- 619 | 0
- 620 | 0
- 621 | 0
- 622 | 0
- 623 | 0
- 624 | 0
- 625 | 0
- 626 | 0
- 627 | 0
- 628 | 0
- 629 | 0
- 630 | 0
- 631 | 0
- 632 | 0
- 633 | 0
- 634 | 0
- 635 | 0
- 636 | 0
- 637 | 0
- 638 | 0
- 639 | 0
- 640 | 0
- 641 | 0
- 642 | 0
- 643 | 0
- 644 | 0
- 645 | 0
- 646 | 0
- 647 | 0
- 648 | 0
- 649 | 0
- 650 | 0
- 651 | 0
- 652 | 0
- 653 | 0
- 654 | 0
- 655 | 0
- 656 | 0
- 657 | 0
- 658 | 0
- 659 | 0
- 660 | 0
- 661 | 0
- 662 | 0
- 663 | 0
- 664 | 0
- 665 | 0
- 666 | 0
- 667 | 0
- 668 | 0
- 669 | 0
- 670 | 0
- 671 | 0
- 672 | 0
- 673 | 0
- 674 | 0
- 675 | 0
- 676 | 0
- 677 | 0
- 678 | 0
- 679 | 0
- 680 | 0
- 681 | 0
- 682 | 0
- 683 | 0
- 684 | 0
- 685 | 0
- 686 | 0
- 687 | 0
- 688 | 0
- 689 | 0
- 690 | 0
- 691 | 0
- 692 | 0
- 693 | 0
- 694 | 0
- 695 | 0
- 696 | 0
- 697 | 0
- 698 | 0
- 699 | 0
- 700 | 1
- 701 | 0
- 702 | 0
- 703 | 0
- 704 | 0
- 705 | 0
- 706 | 0
- 707 | 0
- 708 | 0
- 709 | 0
- 710 | 0
- 711 | 0
- 712 | 0
- 713 | 0
- 714 | 0
- 715 | 0
- 716 | 0
- 717 | 0
- 718 | 0
- 719 | 0
- 720 | 0
- 721 | 0
- 722 | 0
- 723 | 0
- 724 | 0
- 725 | 0
- 726 | 0
- 727 | 0
- 728 | 0
- 729 | 0
- 730 | 0
- 731 | 0
- 732 | 0
- 733 | 0
- 734 | 0
- 735 | 0
- 736 | 0
- 737 | 0
- 738 | 0
- 739 | 0
- 740 | 0
- 741 | 0
- 742 | 0
- 743 | 0
- 744 | 0
- 745 | 0
- 746 | 0
- 747 | 0
- 748 | 0
- 749 | 0
- 750 | 0
- 751 | 0
- 752 | 0
- 753 | 0
- 754 | 0
- 755 | 0
- 756 | 0
- 757 | 0
- 758 | 0
- 759 | 0
- 760 | 0
- 761 | 0
- 762 | 0
- 763 | 0
- 764 | 0
- 765 | 0
- 766 | 0
- 767 | 0
- 768 | 0
- 769 | 0
- 770 | 0
- 771 | 0
- 772 | 0
- 773 | 0
- 774 | 0
- 775 | 0
- 776 | 0
- 777 | 0
- 778 | 0
- 779 | 0
- 780 | 0
- 781 | 0
- 782 | 0
- 783 | 0
- 784 | 0
- 785 | 0
- 786 | 0
- 787 | 0
- 788 | 0
- 789 | 0
- 790 | 0
- 791 | 0
- 792 | 0
- 793 | 0
- 794 | 0
- 795 | 0
- 796 | 0
- 797 | 0
- 798 | 0
- 799 | 0
- 800 | 1
- 801 | 0
- 802 | 0
- 803 | 0
- 804 | 0
- 805 | 0
- 806 | 0
- 807 | 0
- 808 | 0
- 809 | 0
- 810 | 0
- 811 | 0
- 812 | 0
- 813 | 0
- 814 | 0
- 815 | 0
- 816 | 0
- 817 | 0
- 818 | 0
- 819 | 0
- 820 | 0
- 821 | 0
- 822 | 0
- 823 | 0
- 824 | 0
- 825 | 0
- 826 | 0
- 827 | 0
- 828 | 0
- 829 | 0
- 830 | 0
- 831 | 0
- 832 | 0
- 833 | 0
- 834 | 0
- 835 | 0
- 836 | 0
- 837 | 0
- 838 | 0
- 839 | 0
- 840 | 0
- 841 | 0
- 842 | 0
- 843 | 0
- 844 | 0
- 845 | 0
- 846 | 0
- 847 | 0
- 848 | 0
- 849 | 0
- 850 | 0
- 851 | 0
- 852 | 0
- 853 | 0
- 854 | 0
- 855 | 0
- 856 | 0
- 857 | 0
- 858 | 0
- 859 | 0
- 860 | 0
- 861 | 0
- 862 | 0
- 863 | 0
- 864 | 0
- 865 | 0
- 866 | 0
- 867 | 0
- 868 | 0
- 869 | 0
- 870 | 0
- 871 | 0
- 872 | 0
- 873 | 0
- 874 | 0
- 875 | 0
- 876 | 0
- 877 | 0
- 878 | 0
- 879 | 0
- 880 | 0
- 881 | 0
- 882 | 0
- 883 | 0
- 884 | 0
- 885 | 0
- 886 | 0
- 887 | 0
- 888 | 0
- 889 | 0
- 890 | 0
- 891 | 0
- 892 | 0
- 893 | 0
- 894 | 0
- 895 | 0
- 896 | 0
- 897 | 0
- 898 | 0
- 899 | 0
- 900 | 1
- 901 | 0
- 902 | 0
- 903 | 0
- 904 | 0
- 905 | 0
- 906 | 0
- 907 | 0
- 908 | 0
- 909 | 0
- 910 | 0
- 911 | 0
- 912 | 0
- 913 | 0
- 914 | 0
- 915 | 0
- 916 | 0
- 917 | 0
- 918 | 0
- 919 | 0
- 920 | 0
- 921 | 0
- 922 | 0
- 923 | 0
- 924 | 0
- 925 | 0
- 926 | 0
- 927 | 0
- 928 | 0
- 929 | 0
- 930 | 0
- 931 | 0
- 932 | 0
- 933 | 0
- 934 | 0
- 935 | 0
- 936 | 0
- 937 | 0
- 938 | 0
- 939 | 0
- 940 | 0
- 941 | 0
- 942 | 0
- 943 | 0
- 944 | 0
- 945 | 0
- 946 | 0
- 947 | 0
- 948 | 0
- 949 | 0
- 950 | 0
- 951 | 0
- 952 | 0
- 953 | 0
- 954 | 0
- 955 | 0
- 956 | 0
- 957 | 0
- 958 | 0
- 959 | 0
- 960 | 0
- 961 | 0
- 962 | 0
- 963 | 0
- 964 | 0
- 965 | 0
- 966 | 0
- 967 | 0
- 968 | 0
- 969 | 0
- 970 | 0
- 971 | 0
- 972 | 0
- 973 | 0
- 974 | 0
- 975 | 0
- 976 | 0
- 977 | 0
- 978 | 0
- 979 | 0
- 980 | 0
- 981 | 0
- 982 | 0
- 983 | 0
- 984 | 0
- 985 | 0
- 986 | 0
- 987 | 0
- 988 | 0
- 989 | 0
- 990 | 0
- 991 | 0
- 992 | 0
- 993 | 0
- 994 | 0
- 995 | 0
- 996 | 0
- 997 | 0
- 998 | 0
- 999 | 0
- 1000 | 1
- 1010 | 0
- 1020 | 0
- 1030 | 0
- 1040 | 0
- 1050 | 0
- 1060 | 0
- 1070 | 0
- 1080 | 0
- 1090 | 0
- 1100 | 1
- 1110 | 0
- 1120 | 0
- 1130 | 0
- 1140 | 0
- 1150 | 0
- 1160 | 0
- 1170 | 0
- 1180 | 0
- 1190 | 0
- 1200 | 1
- 1210 | 0
- 1220 | 0
- 1230 | 0
- 1240 | 0
- 1250 | 0
- 1260 | 0
- 1270 | 0
- 1280 | 0
- 1290 | 0
- 1300 | 1
- 1310 | 0
- 1320 | 0
- 1330 | 0
- 1340 | 0
- 1350 | 0
- 1360 | 0
- 1370 | 0
- 1380 | 0
- 1390 | 0
- 1400 | 1
- 1410 | 0
- 1420 | 0
- 1430 | 0
- 1440 | 0
- 1450 | 0
- 1460 | 0
- 1470 | 0
- 1480 | 0
- 1490 | 0
- 1500 | 1
- 1510 | 0
- 1520 | 0
- 1530 | 0
- 1540 | 0
- 1550 | 0
- 1560 | 0
- 1570 | 0
- 1580 | 0
- 1590 | 0
- 1600 | 1
- 1610 | 0
- 1620 | 0
- 1630 | 0
- 1640 | 0
- 1650 | 0
- 1660 | 0
- 1670 | 0
- 1680 | 0
- 1690 | 0
- 1700 | 1
- 1710 | 0
- 1720 | 0
- 1730 | 0
- 1740 | 0
- 1750 | 0
- 1760 | 0
- 1770 | 0
- 1780 | 0
- 1790 | 0
- 1800 | 1
- 1810 | 0
- 1820 | 0
- 1830 | 0
- 1840 | 0
- 1850 | 0
- 1860 | 0
- 1870 | 0
- 1880 | 0
- 1890 | 0
- 1900 | 1
- 1910 | 0
- 1920 | 0
- 1930 | 0
- 1940 | 0
- 1950 | 0
- 1960 | 0
- 1970 | 0
- 1980 | 0
- 1990 | 0
- 2000 | 1
- 2010 | 0
- 2020 | 0
- 2030 | 0
- 2040 | 0
- 2050 | 0
- 2060 | 0
- 2070 | 0
- 2080 | 0
- 2090 | 0
- 2100 | 1
- 2110 | 0
- 2120 | 0
- 2130 | 0
- 2140 | 0
- 2150 | 0
- 2160 | 0
- 2170 | 0
- 2180 | 0
- 2190 | 0
- 2200 | 1
- 2210 | 0
- 2220 | 0
- 2230 | 0
- 2240 | 0
- 2250 | 0
- 2260 | 0
- 2270 | 0
- 2280 | 0
- 2290 | 0
- 2300 | 1
- 2310 | 0
- 2320 | 0
- 2330 | 0
- 2340 | 0
- 2350 | 0
- 2360 | 0
- 2370 | 0
- 2380 | 0
- 2390 | 0
- 2400 | 1
- 2410 | 0
- 2420 | 0
- 2430 | 0
- 2440 | 0
- 2450 | 0
- 2460 | 0
- 2470 | 0
- 2480 | 0
- 2490 | 0
- 2500 | 1
- 2510 | 0
- 2520 | 0
- 2530 | 0
- 2540 | 0
- 2550 | 0
- 2560 | 0
- 2570 | 0
- 2580 | 0
- 2590 | 0
- 2600 | 1
- 2610 | 0
- 2620 | 0
- 2630 | 0
- 2640 | 0
- 2650 | 0
- 2660 | 0
- 2670 | 0
- 2680 | 0
- 2690 | 0
- 2700 | 1
- 2710 | 0
- 2720 | 0
- 2730 | 0
- 2740 | 0
- 2750 | 0
- 2760 | 0
- 2770 | 0
- 2780 | 0
- 2790 | 0
- 2800 | 1
- 2810 | 0
- 2820 | 0
- 2830 | 0
- 2840 | 0
- 2850 | 0
- 2860 | 0
- 2870 | 0
- 2880 | 0
- 2890 | 0
- 2900 | 1
- 2910 | 0
- 2920 | 0
- 2930 | 0
- 2940 | 0
- 2950 | 0
- 2960 | 0
- 2970 | 0
- 2980 | 0
- 2990 | 0
- 3000 | 1
- 3010 | 0
- 3020 | 0
- 3030 | 0
- 3040 | 0
- 3050 | 0
- 3060 | 0
- 3070 | 0
- 3080 | 0
- 3090 | 0
- 3100 | 1
- 3110 | 0
- 3120 | 0
- 3130 | 0
- 3140 | 0
- 3150 | 0
- 3160 | 0
- 3170 | 0
- 3180 | 0
- 3190 | 0
- 3200 | 1
- 3210 | 0
- 3220 | 0
- 3230 | 0
- 3240 | 0
- 3250 | 0
- 3260 | 0
- 3270 | 0
- 3280 | 0
- 3290 | 0
- 3300 | 1
- 3310 | 0
- 3320 | 0
- 3330 | 0
- 3340 | 0
- 3350 | 0
- 3360 | 0
- 3370 | 0
- 3380 | 0
- 3390 | 0
- 3400 | 1
- 3410 | 0
- 3420 | 0
- 3430 | 0
- 3440 | 0
- 3450 | 0
- 3460 | 0
- 3470 | 0
- 3480 | 0
- 3490 | 0
- 3500 | 1
- 3510 | 0
- 3520 | 0
- 3530 | 0
- 3540 | 0
- 3550 | 0
- 3560 | 0
- 3570 | 0
- 3580 | 0
- 3590 | 0
- 3600 | 1
- 3610 | 0
- 3620 | 0
- 3630 | 0
- 3640 | 0
- 3650 | 0
- 3660 | 0
- 3670 | 0
- 3680 | 0
- 3690 | 0
- 3700 | 1
- 3710 | 0
- 3720 | 0
- 3730 | 0
- 3740 | 0
- 3750 | 0
- 3760 | 0
- 3770 | 0
- 3780 | 0
- 3790 | 0
- 3800 | 1
- 3810 | 0
- 3820 | 0
- 3830 | 0
- 3840 | 0
- 3850 | 0
- 3860 | 0
- 3870 | 0
- 3880 | 0
- 3890 | 0
- 3900 | 1
- 3910 | 0
- 3920 | 0
- 3930 | 0
- 3940 | 0
- 3950 | 0
- 3960 | 0
- 3970 | 0
- 3980 | 0
- 3990 | 0
- 4000 | 1
- 4010 | 0
- 4020 | 0
- 4030 | 0
- 4040 | 0
- 4050 | 0
- 4060 | 0
- 4070 | 0
- 4080 | 0
- 4090 | 0
- 4100 | 1
- 4110 | 0
- 4120 | 0
- 4130 | 0
- 4140 | 0
- 4150 | 0
- 4160 | 0
- 4170 | 0
- 4180 | 0
- 4190 | 0
- 4200 | 1
- 4210 | 0
- 4220 | 0
- 4230 | 0
- 4240 | 0
- 4250 | 0
- 4260 | 0
- 4270 | 0
- 4280 | 0
- 4290 | 0
- 4300 | 1
- 4310 | 0
- 4320 | 0
- 4330 | 0
- 4340 | 0
- 4350 | 0
- 4360 | 0
- 4370 | 0
- 4380 | 0
- 4390 | 0
- 4400 | 1
- 4410 | 0
- 4420 | 0
- 4430 | 0
- 4440 | 0
- 4450 | 0
- 4460 | 0
- 4470 | 0
- 4480 | 0
- 4490 | 0
- 4500 | 1
- 4510 | 0
- 4520 | 0
- 4530 | 0
- 4540 | 0
- 4550 | 0
- 4560 | 0
- 4570 | 0
- 4580 | 0
- 4590 | 0
- 4600 | 1
- 4610 | 0
- 4620 | 0
- 4630 | 0
- 4640 | 0
- 4650 | 0
- 4660 | 0
- 4670 | 0
- 4680 | 0
- 4690 | 0
- 4700 | 1
- 4710 | 0
- 4720 | 0
- 4730 | 0
- 4740 | 0
- 4750 | 0
- 4760 | 0
- 4770 | 0
- 4780 | 0
- 4790 | 0
- 4800 | 1
- 4810 | 0
- 4820 | 0
- 4830 | 0
- 4840 | 0
- 4850 | 0
- 4860 | 0
- 4870 | 0
- 4880 | 0
- 4890 | 0
- 4900 | 1
- 4910 | 0
- 4920 | 0
- 4930 | 0
- 4940 | 0
- 4950 | 0
- 4960 | 0
- 4970 | 0
- 4980 | 0
- 4990 | 0
- 5000 | 1
- 5010 | 0
- 5020 | 0
- 5030 | 0
- 5040 | 0
- 5050 | 0
- 5060 | 0
- 5070 | 0
- 5080 | 0
- 5090 | 0
- 5100 | 1
- 5110 | 0
- 5120 | 0
- 5130 | 0
- 5140 | 0
- 5150 | 0
- 5160 | 0
- 5170 | 0
- 5180 | 0
- 5190 | 0
- 5200 | 1
- 5210 | 0
- 5220 | 0
- 5230 | 0
- 5240 | 0
- 5250 | 0
- 5260 | 0
- 5270 | 0
- 5280 | 0
- 5290 | 0
- 5300 | 1
- 5310 | 0
- 5320 | 0
- 5330 | 0
- 5340 | 0
- 5350 | 0
- 5360 | 0
- 5370 | 0
- 5380 | 0
- 5390 | 0
- 5400 | 1
- 5410 | 0
- 5420 | 0
- 5430 | 0
- 5440 | 0
- 5450 | 0
- 5460 | 0
- 5470 | 0
- 5480 | 0
- 5490 | 0
- 5500 | 1
- 5510 | 0
- 5520 | 0
- 5530 | 0
- 5540 | 0
- 5550 | 0
- 5560 | 0
- 5570 | 0
- 5580 | 0
- 5590 | 0
- 5600 | 1
- 5610 | 0
- 5620 | 0
- 5630 | 0
- 5640 | 0
- 5650 | 0
- 5660 | 0
- 5670 | 0
- 5680 | 0
- 5690 | 0
- 5700 | 1
- 5710 | 0
- 5720 | 0
- 5730 | 0
- 5740 | 0
- 5750 | 0
- 5760 | 0
- 5770 | 0
- 5780 | 0
- 5790 | 0
- 5800 | 1
- 5810 | 0
- 5820 | 0
- 5830 | 0
- 5840 | 0
- 5850 | 0
- 5860 | 0
- 5870 | 0
- 5880 | 0
- 5890 | 0
- 5900 | 1
- 5910 | 0
- 5920 | 0
- 5930 | 0
- 5940 | 0
- 5950 | 0
- 5960 | 0
- 5970 | 0
- 5980 | 0
- 5990 | 0
- 6000 | 1
- 6010 | 0
- 6020 | 0
- 6030 | 0
- 6040 | 0
- 6050 | 0
- 6060 | 0
- 6070 | 0
- 6080 | 0
- 6090 | 0
- 6100 | 1
- 6110 | 0
- 6120 | 0
- 6130 | 0
- 6140 | 0
- 6150 | 0
- 6160 | 0
- 6170 | 0
- 6180 | 0
- 6190 | 0
- 6200 | 1
- 6210 | 0
- 6220 | 0
- 6230 | 0
- 6240 | 0
- 6250 | 0
- 6260 | 0
- 6270 | 0
- 6280 | 0
- 6290 | 0
- 6300 | 1
- 6310 | 0
- 6320 | 0
- 6330 | 0
- 6340 | 0
- 6350 | 0
- 6360 | 0
- 6370 | 0
- 6380 | 0
- 6390 | 0
- 6400 | 1
- 6410 | 0
- 6420 | 0
- 6430 | 0
- 6440 | 0
- 6450 | 0
- 6460 | 0
- 6470 | 0
- 6480 | 0
- 6490 | 0
- 6500 | 1
- 6510 | 0
- 6520 | 0
- 6530 | 0
- 6540 | 0
- 6550 | 0
- 6560 | 0
- 6570 | 0
- 6580 | 0
- 6590 | 0
- 6600 | 1
- 6610 | 0
- 6620 | 0
- 6630 | 0
- 6640 | 0
- 6650 | 0
- 6660 | 0
- 6670 | 0
- 6680 | 0
- 6690 | 0
- 6700 | 1
- 6710 | 0
- 6720 | 0
- 6730 | 0
- 6740 | 0
- 6750 | 0
- 6760 | 0
- 6770 | 0
- 6780 | 0
- 6790 | 0
- 6800 | 1
- 6810 | 0
- 6820 | 0
- 6830 | 0
- 6840 | 0
- 6850 | 0
- 6860 | 0
- 6870 | 0
- 6880 | 0
- 6890 | 0
- 6900 | 1
- 6910 | 0
- 6920 | 0
- 6930 | 0
- 6940 | 0
- 6950 | 0
- 6960 | 0
- 6970 | 0
- 6980 | 0
- 6990 | 0
- 7000 | 1
- 7010 | 0
- 7020 | 0
- 7030 | 0
- 7040 | 0
- 7050 | 0
- 7060 | 0
- 7070 | 0
- 7080 | 0
- 7090 | 0
- 7100 | 1
- 7110 | 0
- 7120 | 0
- 7130 | 0
- 7140 | 0
- 7150 | 0
- 7160 | 0
- 7170 | 0
- 7180 | 0
- 7190 | 0
- 7200 | 1
- 7210 | 0
- 7220 | 0
- 7230 | 0
- 7240 | 0
- 7250 | 0
- 7260 | 0
- 7270 | 0
- 7280 | 0
- 7290 | 0
- 7300 | 1
- 7310 | 0
- 7320 | 0
- 7330 | 0
- 7340 | 0
- 7350 | 0
- 7360 | 0
- 7370 | 0
- 7380 | 0
- 7390 | 0
- 7400 | 1
- 7410 | 0
- 7420 | 0
- 7430 | 0
- 7440 | 0
- 7450 | 0
- 7460 | 0
- 7470 | 0
- 7480 | 0
- 7490 | 0
- 7500 | 1
- 7510 | 0
- 7520 | 0
- 7530 | 0
- 7540 | 0
- 7550 | 0
- 7560 | 0
- 7570 | 0
- 7580 | 0
- 7590 | 0
- 7600 | 1
- 7610 | 0
- 7620 | 0
- 7630 | 0
- 7640 | 0
- 7650 | 0
- 7660 | 0
- 7670 | 0
- 7680 | 0
- 7690 | 0
- 7700 | 1
- 7710 | 0
- 7720 | 0
- 7730 | 0
- 7740 | 0
- 7750 | 0
- 7760 | 0
- 7770 | 0
- 7780 | 0
- 7790 | 0
- 7800 | 1
- 7810 | 0
- 7820 | 0
- 7830 | 0
- 7840 | 0
- 7850 | 0
- 7860 | 0
- 7870 | 0
- 7880 | 0
- 7890 | 0
- 7900 | 1
- 7910 | 0
- 7920 | 0
- 7930 | 0
- 7940 | 0
- 7950 | 0
- 7960 | 0
- 7970 | 0
- 7980 | 0
- 7990 | 0
- 8000 | 1
- 8010 | 0
- 8020 | 0
- 8030 | 0
- 8040 | 0
- 8050 | 0
- 8060 | 0
- 8070 | 0
- 8080 | 0
- 8090 | 0
- 8100 | 1
- 8110 | 0
- 8120 | 0
- 8130 | 0
- 8140 | 0
- 8150 | 0
- 8160 | 0
- 8170 | 0
- 8180 | 0
- 8190 | 0
- 8200 | 1
- 8210 | 0
- 8220 | 0
- 8230 | 0
- 8240 | 0
- 8250 | 0
- 8260 | 0
- 8270 | 0
- 8280 | 0
- 8290 | 0
- 8300 | 1
- 8310 | 0
- 8320 | 0
- 8330 | 0
- 8340 | 0
- 8350 | 0
- 8360 | 0
- 8370 | 0
- 8380 | 0
- 8390 | 0
- 8400 | 1
- 8410 | 0
- 8420 | 0
- 8430 | 0
- 8440 | 0
- 8450 | 0
- 8460 | 0
- 8470 | 0
- 8480 | 0
- 8490 | 0
- 8500 | 1
- 8510 | 0
- 8520 | 0
- 8530 | 0
- 8540 | 0
- 8550 | 0
- 8560 | 0
- 8570 | 0
- 8580 | 0
- 8590 | 0
- 8600 | 1
- 8610 | 0
- 8620 | 0
- 8630 | 0
- 8640 | 0
- 8650 | 0
- 8660 | 0
- 8670 | 0
- 8680 | 0
- 8690 | 0
- 8700 | 1
- 8710 | 0
- 8720 | 0
- 8730 | 0
- 8740 | 0
- 8750 | 0
- 8760 | 0
- 8770 | 0
- 8780 | 0
- 8790 | 0
- 8800 | 1
- 8810 | 0
- 8820 | 0
- 8830 | 0
- 8840 | 0
- 8850 | 0
- 8860 | 0
- 8870 | 0
- 8880 | 0
- 8890 | 0
- 8900 | 1
- 8910 | 0
- 8920 | 0
- 8930 | 0
- 8940 | 0
- 8950 | 0
- 8960 | 0
- 8970 | 0
- 8980 | 0
- 8990 | 0
- 9000 | 1
- 9010 | 0
- 9020 | 0
- 9030 | 0
- 9040 | 0
- 9050 | 0
- 9060 | 0
- 9070 | 0
- 9080 | 0
- 9090 | 0
- 9100 | 1
- 9110 | 0
- 9120 | 0
- 9130 | 0
- 9140 | 0
- 9150 | 0
- 9160 | 0
- 9170 | 0
- 9180 | 0
- 9190 | 0
- 9200 | 1
- 9210 | 0
- 9220 | 0
- 9230 | 0
- 9240 | 0
- 9250 | 0
- 9260 | 0
- 9270 | 0
- 9280 | 0
- 9290 | 0
- 9300 | 1
- 9310 | 0
- 9320 | 0
- 9330 | 0
- 9340 | 0
- 9350 | 0
- 9360 | 0
- 9370 | 0
- 9380 | 0
- 9390 | 0
- 9400 | 1
- 9410 | 0
- 9420 | 0
- 9430 | 0
- 9440 | 0
- 9450 | 0
- 9460 | 0
- 9470 | 0
- 9480 | 0
- 9490 | 0
- 9500 | 1
- 9510 | 0
- 9520 | 0
- 9530 | 0
- 9540 | 0
- 9550 | 0
- 9560 | 0
- 9570 | 0
- 9580 | 0
- 9590 | 0
- 9600 | 1
- 9610 | 0
- 9620 | 0
- 9630 | 0
- 9640 | 0
- 9650 | 0
- 9660 | 0
- 9670 | 0
- 9680 | 0
- 9690 | 0
- 9700 | 1
- 9710 | 0
- 9720 | 0
- 9730 | 0
- 9740 | 0
- 9750 | 0
- 9760 | 0
- 9770 | 0
- 9780 | 0
- 9790 | 0
- 9800 | 1
- 9810 | 0
- 9820 | 0
- 9830 | 0
- 9840 | 0
- 9850 | 0
- 9860 | 0
- 9870 | 0
- 9880 | 0
- 9890 | 0
- 9900 | 1
- 9910 | 0
- 9920 | 0
- 9930 | 0
- 9940 | 0
- 9950 | 0
- 9960 | 0
- 9970 | 0
- 9980 | 0
- 9990 | 0
- 10000 | 1
- 10100 | 1
- 10200 | 0
-
-
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d b/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d
deleted file mode 100644
index e3db03002c46..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-int i;
-
-tick-10ms
-/i < 100/
-{
- @[i] = llquantize(i, 10, 1, 2, 10, 150);
- @[i] = llquantize(i + 1, 10, 1, 2, 10, 150);
- @[i] = llquantize(i + 2, 10, 1, 2, 10, 150);
- @[i] = llquantize(i + 3, 10, 1, 2, 10, 150);
- i++;
-}
-
-tick-10ms
-/i == 100/
-{
- exit(0);
-}
-
-END
-{
- trunc(@, 5);
-}
diff --git a/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out b/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out
deleted file mode 100644
index 941c62679b07..000000000000
--- a/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out
+++ /dev/null
@@ -1,34 +0,0 @@
-
- 95
- value ------------- Distribution ------------- count
- 80 | 0
- 90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 600
- 100 | 0
-
- 96
- value ------------- Distribution ------------- count
- 80 | 0
- 90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 600
- 100 | 0
-
- 97
- value ------------- Distribution ------------- count
- 80 | 0
- 90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 450
- 100 |@@@@@@@@@@ 150
- 200 | 0
-
- 98
- value ------------- Distribution ------------- count
- 80 | 0
- 90 |@@@@@@@@@@@@@@@@@@@@ 300
- 100 |@@@@@@@@@@@@@@@@@@@@ 300
- 200 | 0
-
- 99
- value ------------- Distribution ------------- count
- 80 | 0
- 90 |@@@@@@@@@@ 150
- 100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 450
- 200 | 0
-
diff --git a/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh b/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh
index 6ca9712736ac..561f8549d924 100644
--- a/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh
+++ b/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh
@@ -24,6 +24,8 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
+#
#
# This script primarily tests that the ::dtrace dcmd is not dumping
@@ -34,7 +36,7 @@
script()
{
- exec $dtrace -o $dtraceout -s /dev/stdin <<EOF
+ $dtrace -o $dtraceout -s /dev/stdin <<EOF
syscall:::entry
{
@[probefunc] = count();
diff --git a/cmd/dtrace/test/tst/common/misc/tst.include.ksh b/cmd/dtrace/test/tst/common/misc/tst.include.ksh
index 5b57805d12f5..ec328021b3a3 100644
--- a/cmd/dtrace/test/tst/common/misc/tst.include.ksh
+++ b/cmd/dtrace/test/tst/common/misc/tst.include.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -30,7 +31,7 @@ if [ $# != 1 ]; then
fi
dtrace=$1
-CC=`which gcc`
+CC=/usr/sfw/bin/gcc
CFLAGS=
doit()
@@ -82,37 +83,13 @@ files=/usr/include/sys/*.h
# because they include static globals (!) or function bodies (!!) in the header
# file. Hopefully these remain sufficiently few that the O(#files * #badfiles)
# algorithm, below, doesn't become a problem. (And yes, writing scripts in
-# something other than ksh would probably be a good idea.) If this script
+# something other than ksh1888 would probably be a good idea.) If this script
# becomes a problem, kindly fix it by reducing the number of bad files! (That
# is, fix it by fixing the broken file, not the broken script.)
#
-badfiles="\
- bootconf.h \
- bootstat.h \
- ctype.h \
- dtrace.h \
- dumphdr.h \
- exacct_impl.h \
- fasttrap.h \
- hook_event.h \
- iscsi_authclient.h \
- kiconv_ja.h \
- kiconv_ja_jis_to_unicode.h \
- kiconv_ja_unicode_to_jis.h \
- kobj.h \
- kobj_impl.h \
- ksyms.h \
- lockstat.h \
- neti.h \
- rds.h \
- ser_sync.h \
- smbios_impl.h \
- smedia.h \
- sockfilter.h \
- stat.h \
- u8_textprep_data.h \
- utsname.h \
- vnic.h"
+badfiles="ctype.h eri_msg.h ser_sync.h sbpro.h neti.h hook_event.h \
+ bootconf.h bootstat.h dtrace.h dumphdr.h exacct_impl.h fasttrap.h \
+ kobj.h kobj_impl.h ksyms.h lockstat.h smedia.h stat.h utsname.h"
for inc in $files; do
file=`basename $inc`
diff --git a/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out b/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out
index 09d984d3fa02..8a9ac6d96c5a 100644
--- a/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out
+++ b/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out
@@ -4,15 +4,12 @@ read entry
FUNCTION NAME
read entry
readlink entry
-readlinkat entry
readv entry
FUNCTION NAME
read entry
readlink entry
-readlinkat entry
readv entry
FUNCTION NAME
readlink entry
-readlinkat entry
FUNCTION NAME
pread64 entry
diff --git a/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh b/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
index bc29f714cbf2..494f6f8e6605 100644
--- a/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
+++ b/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -32,12 +33,13 @@ fi
dtrace=$1
#
-# Some variants of nm may exec a 64-bit version of themselves. DTrace uses
-# libproc (which uses /proc) to find out when the traced process exits, but a
-# 32-bit process can't examine a 64-bit one with libproc. The LD_NOEXEC_64
-# variable prevents nm from re-execing itself.
+# /usr/ccs/bin/nm execs a 64-bit version of itself. DTrace uses libproc
+# (which uses /proc) to find out when the traced process exits, but a
+# 32-bit process can't examine a 64-bit one with libproc. The
+# LD_NOEXEC_64 variable prevents nm from re-execing itself.
#
-LD_NOEXEC_64=nono $dtrace -F -s /dev/stdin -c 'nm /bin/ls' stat <<EOF
+LD_NOEXEC_64=tomeeisrad $dtrace -F -s /dev/stdin -c \
+ '/usr/ccs/bin/nm /bin/ls' stat <<EOF
pid\$target::\$1:entry
{
diff --git a/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh b/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
index 692a7153031b..892ff3e24df1 100644
--- a/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
+++ b/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
@@ -24,6 +24,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# This test verifies that specifying a glob in a pid provider name
@@ -45,10 +46,10 @@ cat > Makefile <<EOF
all: main
main: main.o
- gcc -o main main.o
+ cc -o main main.o
main.o: main.c
- gcc -c main.c
+ cc -c main.c
EOF
cat > main.c <<EOF
diff --git a/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh b/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
index 03b6003fed3c..8d83bddd2319 100644
--- a/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
+++ b/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
@@ -24,6 +24,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# This test verifies that probes will be picked up after a dlopen(3C)
@@ -45,16 +46,16 @@ cat > Makefile <<EOF
all: main altlib.so
main: main.o
- gcc -o main main.o
+ cc -o main main.o
main.o: main.c
- gcc -c main.c
+ cc -c main.c
altlib.so: altlib.o
- gcc -shared -o altlib.so altlib.o -lc
+ cc -z defs -G -o altlib.so altlib.o -lc
altlib.o: altlib.c
- gcc -c altlib.c
+ cc -c altlib.c
EOF
cat > altlib.c <<EOF
diff --git a/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh b/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
index 4a74cb050a7a..c9ac6b1dd6a8 100644
--- a/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
+++ b/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
@@ -24,6 +24,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# This test verifies that a regex in the provider name will match
@@ -43,13 +44,13 @@ mkdir $DIR
cd $DIR
cat > Makefile <<EOF
-all: main
+ all: main
main: main.o prov.o
- gcc -o main main.o prov.o
+ cc -o main main.o prov.o
main.o: main.c prov.h
- gcc -c main.c
+ cc -c main.c
prov.h: prov.d
$dtrace -h -s prov.d
diff --git a/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh b/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
index 8d326ad7c107..278ec128131c 100644
--- a/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
+++ b/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
@@ -24,6 +24,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# This test verifies that USDT probes will be picked up after a dlopen(3C)
@@ -46,10 +47,10 @@ cat > Makefile <<EOF
all: main altlib.so
main: main.o provmain.o
- gcc -o main main.o provmain.o
+ cc -o main main.o provmain.o
main.o: main.c prov.h
- gcc -c main.c
+ cc -c main.c
prov.h: prov.d
$dtrace -h -s prov.d
@@ -58,10 +59,10 @@ provmain.o: prov.d main.o
$dtrace -G -32 -o provmain.o -s prov.d main.o
altlib.so: altlib.o provalt.o
- gcc -shared -o altlib.so altlib.o provalt.o -lc
+ cc -z defs -G -o altlib.so altlib.o provalt.o -lc
altlib.o: altlib.c prov.h
- gcc -c altlib.c
+ cc -c altlib.c
provalt.o: prov.d altlib.o
$dtrace -G -32 -o provalt.o -s prov.d altlib.o
diff --git a/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh b/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh
deleted file mode 100644
index ced65849b98d..000000000000
--- a/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent Inc. All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Test to catch that we properly look for libraries dependencies in
-# our full library parth
-#
-
-if [ $# != 1 ]; then
- echo expected one argument: '<'dtrace-path'>'
- exit 2
-fi
-
-libdira=${TMPDIR:-/tmp}/libdepa.$$
-libdirb=${TMPDIR:-/tmp}/libdepb.$$
-libdirc=${TMPDIR:-/tmp}/libdepc.$$
-dtrace=$1
-
-setup_libs()
-{
- mkdir $libdira
- mkdir $libdirb
- mkdir $libdirc
- cat > $libdira/liba.$$.d <<EOF
-#pragma D depends_on library libb.$$.d
-#pragma D depends_on library libc.$$.d
-#pragma D depends_on library libd.$$.d
-EOF
- cat > $libdirb/libb.$$.d <<EOF
-#pragma D depends_on library libc.$$.d
-EOF
- cat > $libdirb/libc.$$.d <<EOF
-EOF
- cat > $libdirb/libd.$$.d <<EOF
-EOF
- cat > $libdirc/libe.$$.d <<EOF
-#pragma D depends_on library liba.$$.d
-EOF
- cat > $libdirc/libf.$$.d <<EOF
-EOF
-}
-
-
-setup_libs
-
-$dtrace -L$libdira -L$libdirb -L$libdirc -e
-
-status=$?
-rm -rf $libdira
-rm -rf $libdirb
-rm -rf $libdirc
-return $status
-
diff --git a/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d b/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
deleted file mode 100644
index 892b44561376..000000000000
--- a/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-BEGIN
-{
- print(*curpsinfo);
-}
diff --git a/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d b/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d
deleted file mode 100644
index 902f07272dd0..000000000000
--- a/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-BEGIN
-{
- print((void)`p0);
-}
diff --git a/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d b/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d
deleted file mode 100644
index a1d3be1f62d3..000000000000
--- a/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-BEGIN
-{
- print();
-}
diff --git a/cmd/dtrace/test/tst/common/print/tst.array.d b/cmd/dtrace/test/tst/common/print/tst.array.d
deleted file mode 100644
index 9650bf7c0f5e..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.array.d
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-#pragma D option quiet
-
-typedef struct bar {
- int alpha;
-} bar_t;
-
-typedef struct foo {
- int a[3];
- char b[30];
- bar_t c[2];
- char d[3];
-} foo_t;
-
-BEGIN
-{
- this->f = (foo_t *)alloca(sizeof (foo_t));
-
- this->f->a[0] = 1;
- this->f->a[1] = 2;
- this->f->a[2] = 3;
- this->f->b[0] = 'a';
- this->f->b[1] = 'b';
- this->f->b[2] = 0;
- this->f->c[0].alpha = 5;
- this->f->c[1].alpha = 6;
- this->f->c[2].alpha = 7;
- this->f->d[0] = 4;
- this->f->d[1] = 0;
- this->f->d[2] = 0;
-
- print(this->f->a);
- print(this->f->b);
- print(this->f->c);
- print(*this->f);
-
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/print/tst.array.d.out b/cmd/dtrace/test/tst/common/print/tst.array.d.out
deleted file mode 100644
index 0702d4bb5a80..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.array.d.out
+++ /dev/null
@@ -1,23 +0,0 @@
-int [3] [ 0x1, 0x2, 0x3 ]
-char [30] "ab"
-bar_t [2] [
- bar_t {
- int alpha = 0x5
- },
- bar_t {
- int alpha = 0x6
- }
-]
-foo_t {
- int [3] a = [ 0x1, 0x2, 0x3 ]
- char [30] b = [ "ab" ]
- bar_t [2] c = [
- bar_t {
- int alpha = 0x5
- },
- bar_t {
- int alpha = 0x6
- }
- ]
- char [3] d = [ '\004', '\0', '\0' ]
-}
diff --git a/cmd/dtrace/test/tst/common/print/tst.bitfield.d b/cmd/dtrace/test/tst/common/print/tst.bitfield.d
deleted file mode 100644
index ff77bb0ec74d..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.bitfield.d
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-#pragma D option quiet
-
-typedef struct forward forward_t;
-
-typedef struct foo {
- int a:4;
- int b:7;
- int c:1;
- int d:2;
-} foo_t;
-
-BEGIN
-{
- this->s = (foo_t *)alloca(sizeof (foo_t));
-
- this->s->a = 1;
- this->s->b = 5;
- this->s->c = 0;
- this->s->d = 2;
-
- print(*this->s);
-
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out b/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out
deleted file mode 100644
index 309444d5c8d4..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out
+++ /dev/null
@@ -1,6 +0,0 @@
-foo_t {
- int a :4 = 0x1
- int b :7 = 0x5
- int c :1 = 0
- int d :2 = 0x2
-}
diff --git a/cmd/dtrace/test/tst/common/print/tst.primitive.d b/cmd/dtrace/test/tst/common/print/tst.primitive.d
deleted file mode 100644
index 559dab1840c7..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.primitive.d
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-#pragma D option quiet
-
-BEGIN
-{
- i = (int)'a';
-
- printf("\n");
-
- print((char)'a');
- print((int)-1);
- print((unsigned int)23);
- print((short)456);
- print((unsigned short)789);
- print((long)1234);
- print((ulong_t)56789);
- print((void *)0x1234);
- print("hello");
-
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/print/tst.primitive.d.out b/cmd/dtrace/test/tst/common/print/tst.primitive.d.out
deleted file mode 100644
index f7e4076726ae..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.primitive.d.out
+++ /dev/null
@@ -1,11 +0,0 @@
-
-char 'a'
-int 0xffffffff
-unsigned int 0x17
-short 0x1c8
-unsigned short 0x315
-long 0x4d2
-ulong_t 0xddd5
-void * 0x1234
-string "hello"
-
diff --git a/cmd/dtrace/test/tst/common/print/tst.struct.d b/cmd/dtrace/test/tst/common/print/tst.struct.d
deleted file mode 100644
index 2fb1c41401e5..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.struct.d
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-#pragma D option quiet
-
-typedef struct forward forward_t;
-
-typedef struct foo {
- int a;
- void *b;
- struct {
- uint64_t alpha;
- uint64_t beta;
- } c;
- ushort_t d;
- int e;
- forward_t *f;
- void (*g)();
-} foo_t;
-
-BEGIN
-{
- this->s = (foo_t *)alloca(sizeof (foo_t));
-
- this->s->a = 1;
- this->s->b = (void *)2;
- this->s->c.alpha = 3;
- this->s->c.beta = 4;
- this->s->d = 5;
- this->s->e = 6;
- this->s->f = (void *)7;
- this->s->g = (void *)8;
-
- print(*this->s);
-
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/print/tst.struct.d.out b/cmd/dtrace/test/tst/common/print/tst.struct.d.out
deleted file mode 100644
index b7b210837552..000000000000
--- a/cmd/dtrace/test/tst/common/print/tst.struct.d.out
+++ /dev/null
@@ -1,12 +0,0 @@
-foo_t {
- int a = 0x1
- void *b = 0x2
- struct c = {
- uint64_t alpha = 0x3
- uint64_t beta = 0x4
- }
- ushort_t d = 0x5
- int e = 0x6
- forward_t *f = 0x7
- int (*)() g = 0x8
-}
diff --git a/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh b/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
index 4c5df0a1efae..ed375fdbf9b4 100644
--- a/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
+++ b/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
@@ -50,7 +50,7 @@ main(int argc, char *argv[])
}
EOF
-gcc -o test test.c
+cc -o test test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
diff --git a/cmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh b/cmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh
deleted file mode 100755
index a5cd18386c38..000000000000
--- a/cmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
-
-ppriv -s A=basic,dtrace_user $$
-
-#
-# We expect some number of these profile probes to be silently dropped.
-# Note that this test will fail if something is stuck on all CPUs that
-# whomever is running the test happens to own.
-#
-count=$(/usr/sbin/dtrace -q -s /dev/stdin <<EOF
-BEGIN
-{
- start = timestamp;
- @ = count();
-}
-
-ERROR
-{
- exit(1);
-}
-
-profile-1000hz
-{
- @ = count();
-}
-
-tick-10ms
-{
- ticks++;
-}
-
-tick-10ms
-/ticks > 100/
-{
- printa("%@d", @);
- exit(0);
-}
-EOF)
-
-cpus=`psrinfo | grep -- on-line | wc -l`
-max=`expr $cpus \* 500`
-
-if [[ $count -gt $max ]]; then
- echo "count ($count) is greater than allowed max ($max)"
- exit 1
-fi
-
-echo "count ($count) is within allowed max ($max)"
-exit 0
diff --git a/cmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh b/cmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh
deleted file mode 100755
index 358ed92c6f83..000000000000
--- a/cmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
-
-ppriv -s A=basic,dtrace_user $$
-
-#
-# We expect at least one of these tick probes to error out because only
-# dtrace_user is set, and we are attempting to access arguments. Note that
-# this test will fail if something is stuck on CPU that whomever is running
-# the test happens to own.
-#
-/usr/sbin/dtrace -q -s /dev/stdin <<EOF
-BEGIN
-{
- start = timestamp;
-}
-
-tick-1000hz
-{
- @[arg0] = count();
-}
-
-ERROR
-{
- errcnt++;
-}
-
-tick-10ms
-{
- ticks++;
-}
-
-tick-10ms
-/ticks > 100/
-{
- printf("error count is %d\n", errcnt);
- exit(errcnt != 0 ? 0 : 1);
-}
-EOF
diff --git a/cmd/dtrace/test/tst/common/privs/tst.tick.ksh b/cmd/dtrace/test/tst/common/privs/tst.tick.ksh
deleted file mode 100755
index eaff59fa94db..000000000000
--- a/cmd/dtrace/test/tst/common/privs/tst.tick.ksh
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
-
-ppriv -s A=basic,dtrace_user $$
-
-#
-# We expect tick probes to fire if dtrace_user is set
-#
-/usr/sbin/dtrace -q -s /dev/stdin <<EOF
-BEGIN
-{
- start = timestamp;
-}
-
-tick-10ms
-{
- ticks++;
-}
-
-tick-10ms
-/ticks > 10 && (this->ms = (timestamp - start) / 1000000) > 2000/
-{
- printf("expected completion in 100 ms, found %d!\n", this->ms);
- exit(1);
-}
-
-tick-10ms
-/ticks > 10/
-{
- printf("completed in %d ms\n", this->ms);
- exit(0);
-}
-EOF
diff --git a/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh b/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh
index 478307a11a2c..69c0f84a490c 100644
--- a/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh
+++ b/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
script()
{
@@ -60,9 +61,10 @@ child=$!
#
# The only thing we can be sure of here is that we caught some function in
-# ksh doing work.
+# ksh doing work. (This actually goes one step further and assumes that we
+# catch some non-static function in ksh.)
#
-script | tee /dev/fd/2 | egrep '(ksh|libshell\.so\.[0-9])`[a-zA-Z_]' > /dev/null
+script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null
status=$?
kill $child
diff --git a/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh b/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh
index fe5649da76cd..6ca823f5ddd3 100644
--- a/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh
+++ b/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
script()
{
@@ -61,7 +62,7 @@ child=$!
#
# The only thing we can be sure of here is that ksh is doing some work.
#
-script | tee /dev/fd/2 | egrep '(ksh|libshell)' > /dev/null
+script | tee /dev/fd/2 | grep -w ksh > /dev/null
status=$?
kill $child
diff --git a/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh b/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh
index 36edf0ed39f5..b1a3ab9de2ff 100644
--- a/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh
+++ b/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
script()
{
@@ -62,7 +63,7 @@ child=$!
# This test is essentially the same as that in the ufunc test; see that
# test for the rationale.
#
-script | tee /dev/fd/2 | egrep '(ksh|libshell\.so\.[0-9])`[a-zA-Z_]' > /dev/null
+script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null
status=$?
kill $child
diff --git a/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh b/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh
index d701053b68c6..879774a42ea3 100644
--- a/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh
+++ b/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh
@@ -23,10 +23,11 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
script()
{
- exec $dtrace -x bufpolicy=ring -x bufsize=1k -s /dev/stdin <<EOF
+ $dtrace -x bufpolicy=ring -x bufsize=1k -s /dev/stdin <<EOF
fbt:::
{}
EOF
diff --git a/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d b/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d
deleted file mode 100644
index c921db88b62d..000000000000
--- a/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
- */
-
-BEGIN
-{
- trace(sizeof (struct suckitlarry));
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d b/cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d
deleted file mode 100644
index 8436df67353e..000000000000
--- a/cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-BEGIN
-{
- trace(*curpsinfo);
-}
diff --git a/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d b/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d
deleted file mode 100644
index 1eb96be529cc..000000000000
--- a/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- tracemem(`dtrace_zero, 256, 0, "fishpong");
-}
diff --git a/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d b/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d
deleted file mode 100644
index 554bb7dfb4df..000000000000
--- a/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-BEGIN
-{
- tracemem(`dtrace_zero, 256, "fishpong");
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d b/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d
deleted file mode 100644
index de530e811cb1..000000000000
--- a/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-BEGIN
-{
- i = -10;
-}
-
-tick-10ms
-/i++ < 150/
-{
- printf("%d:", i);
- tracemem(`dtrace_zero, 128, i);
- printf("\n");
-}
-
-tick-10ms
-/i >= 150/
-{
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out b/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out
deleted file mode 100644
index 6415893b8db1..000000000000
--- a/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out
+++ /dev/null
@@ -1,1313 +0,0 @@
--9:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--8:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--7:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--6:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--5:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--4:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--3:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--2:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
--1:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-0:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-1:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 .
-
-2:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 ..
-
-3:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 ...
-
-4:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 ....
-
-5:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 .....
-
-6:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 ......
-
-7:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 .......
-
-8:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 ........
-
-9:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 .........
-
-10:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 ..........
-
-11:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-12:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-13:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-14:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-15:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-16:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-17:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 .
-
-18:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 ..
-
-19:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 ...
-
-20:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 ....
-
-21:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 .....
-
-22:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 ......
-
-23:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 .......
-
-24:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 ........
-
-25:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 .........
-
-26:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 ..........
-
-27:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-28:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-29:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-30:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-31:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-32:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-33:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 .
-
-34:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 ..
-
-35:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 ...
-
-36:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 ....
-
-37:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 .....
-
-38:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 ......
-
-39:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 .......
-
-40:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 ........
-
-41:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 .........
-
-42:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 ..........
-
-43:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-44:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-45:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-46:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-47:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-48:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-49:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 .
-
-50:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 ..
-
-51:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 ...
-
-52:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 ....
-
-53:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 .....
-
-54:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 ......
-
-55:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 .......
-
-56:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 ........
-
-57:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 .........
-
-58:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 ..........
-
-59:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-60:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-61:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-62:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-63:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-64:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-65:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 .
-
-66:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 ..
-
-67:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 ...
-
-68:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 ....
-
-69:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 .....
-
-70:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 ......
-
-71:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 .......
-
-72:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 ........
-
-73:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 .........
-
-74:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 ..........
-
-75:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-76:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-77:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-78:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-79:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-80:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-81:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 .
-
-82:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 ..
-
-83:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 ...
-
-84:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 ....
-
-85:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 .....
-
-86:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 ......
-
-87:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 .......
-
-88:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 ........
-
-89:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 .........
-
-90:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 ..........
-
-91:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-92:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-93:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-94:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-95:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-96:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-97:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 .
-
-98:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 ..
-
-99:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 ...
-
-100:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 ....
-
-101:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 .....
-
-102:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 ......
-
-103:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 .......
-
-104:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 ........
-
-105:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 .........
-
-106:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 ..........
-
-107:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-108:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-109:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-110:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-111:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-112:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-113:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 .
-
-114:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 ..
-
-115:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 ...
-
-116:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 ....
-
-117:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 .....
-
-118:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 ......
-
-119:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 .......
-
-120:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 ........
-
-121:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 .........
-
-122:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 ..........
-
-123:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 ...........
-
-124:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-
-125:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
-
-126:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
-
-127:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
-
-128:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-129:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-130:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-131:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-132:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-133:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-134:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-135:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-136:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-137:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-138:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-139:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-140:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-141:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-142:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-143:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-144:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-145:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-146:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-147:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-148:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-149:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-150:
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-
-
diff --git a/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d b/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d
deleted file mode 100644
index ae447709ee3e..000000000000
--- a/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
-#pragma D option quiet
-
-BEGIN
-{
- tracemem(`utsname.sysname, 5);
- exit(0);
-}
diff --git a/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out b/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out
deleted file mode 100644
index 8cefb5860417..000000000000
--- a/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out
+++ /dev/null
@@ -1,4 +0,0 @@
-
- 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
- 0: 53 75 6e 4f 53 SunOS
-
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh b/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh
index 3c41f6621461..291fe83fac25 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -60,12 +61,12 @@ main(int argc, char **argv)
}
EOF
-gcc -m64 -c -o test64.o test.c
+cc -xarch=generic64 -c -o test64.o test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c 64-bit"
exit 1
fi
-gcc -m32 -c -o test32.o test.c
+cc -xarch=generic -c -o test32.o test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c 32-bit"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh b/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
index c9bcb03e6311..68dbb03456cc 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
@@ -60,10 +60,10 @@ cat > Makefile <<EOF
all: main
main: main.o prov.o
- gcc -o main main.o prov.o
+ \$(CC) -o main main.o prov.o
main.o: main.c prov.h
- gcc -c main.c
+ \$(CC) -c main.c
prov.h: prov.d
$dtrace -h -s prov.d
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh b/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
index ade3a54d48a6..0a6666628fd4 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
@@ -24,6 +24,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# This test verifies that USDT providers are removed when its associated
@@ -45,17 +46,17 @@ cat > Makefile <<EOF
all: main livelib.so deadlib.so
main: main.o prov.o
- gcc -o main main.o
+ cc -o main main.o
main.o: main.c
- gcc -c main.c
+ cc -c main.c
livelib.so: livelib.o prov.o
- gcc -shared -o livelib.so livelib.o prov.o -lc
+ cc -z defs -G -o livelib.so livelib.o prov.o -lc
livelib.o: livelib.c prov.h
- gcc -c livelib.c
+ cc -c livelib.c
prov.o: livelib.o prov.d
$dtrace -G -s prov.d livelib.o
@@ -65,10 +66,10 @@ prov.h: prov.d
deadlib.so: deadlib.o
- gcc -shared -o deadlib.so deadlib.o -lc
+ cc -z defs -G -o deadlib.so deadlib.o -lc
deadlib.o: deadlib.c
- gcc -c deadlib.c
+ cc -c deadlib.c
clean:
rm -f main.o livelib.o prov.o prov.h deadlib.o
@@ -124,7 +125,7 @@ main(int argc, char **argv)
}
EOF
-make > /dev/null
+/usr/ccs/bin/make > /dev/null
if [ $? -ne 0 ]; then
print -u2 "failed to build"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh b/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
index 692c8d9b5c5b..c83d8bfa8618 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
@@ -24,6 +24,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -40,17 +41,17 @@ cat > Makefile <<EOF
all: main livelib.so deadlib.so
main: main.o prov.o
- gcc -o main main.o
+ cc -o main main.o
main.o: main.c
- gcc -c main.c
+ cc -c main.c
livelib.so: livelib.o prov.o
- gcc -shared -o livelib.so livelib.o prov.o -lc
+ cc -z defs -G -o livelib.so livelib.o prov.o -lc
livelib.o: livelib.c prov.h
- gcc -c livelib.c
+ cc -c livelib.c
prov.o: livelib.o prov.d
$dtrace -G -s prov.d livelib.o
@@ -60,10 +61,10 @@ prov.h: prov.d
deadlib.so: deadlib.o
- gcc -shared -o deadlib.so deadlib.o -lc
+ cc -z defs -G -o deadlib.so deadlib.o -lc
deadlib.o: deadlib.c
- gcc -c deadlib.c
+ cc -c deadlib.c
clean:
rm -f main.o livelib.o prov.o prov.h deadlib.o
@@ -135,7 +136,7 @@ main(int argc, char **argv)
}
EOF
-make > /dev/null
+/usr/ccs/bin/make > /dev/null
if [ $? -ne 0 ]; then
print -u2 "failed to build"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh b/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
index e950eb4af2b9..72f24ce5e30d 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
@@ -24,6 +24,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# This test verifies that performing a dlclose(3dl) on a library doesn't
@@ -45,17 +46,17 @@ cat > Makefile <<EOF
all: main livelib.so deadlib.so
main: main.o prov.o
- gcc -o main main.o
+ cc -o main main.o
main.o: main.c
- gcc -c main.c
+ cc -c main.c
livelib.so: livelib.o prov.o
- gcc -shared -o livelib.so livelib.o prov.o -lc
+ cc -z defs -G -o livelib.so livelib.o prov.o -lc
livelib.o: livelib.c prov.h
- gcc -c livelib.c
+ cc -c livelib.c
prov.o: livelib.o prov.d
$dtrace -G -s prov.d livelib.o
@@ -65,10 +66,10 @@ prov.h: prov.d
deadlib.so: deadlib.o
- gcc -shared -o deadlib.so deadlib.o -lc
+ cc -z defs -G -o deadlib.so deadlib.o -lc
deadlib.o: deadlib.c
- gcc -c deadlib.c
+ cc -c deadlib.c
clean:
rm -f main.o livelib.o prov.o prov.h deadlib.o
@@ -130,7 +131,7 @@ main(int argc, char **argv)
}
EOF
-make > /dev/null
+/usr/ccs/bin/make > /dev/null
if [ $? -ne 0 ]; then
print -u2 "failed to build"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh b/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
index 3d50443370a9..687e435e3fcb 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# Make sure temporary symbols generated due to DTrace probes in static
@@ -71,7 +72,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -81,7 +82,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh b/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
index 47ea79f37610..ba62be75a4ca 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -60,7 +61,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -70,7 +71,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh b/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
index 9b71ac26377c..340164847bfb 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
@@ -23,6 +23,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
#
# This test is primarily intended to verify a fix for SPARC, but there's no
@@ -76,7 +77,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c -xO2 test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -86,7 +87,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh b/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
index 79e82661927e..9d2646cdf1fb 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -69,7 +70,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -79,7 +80,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh b/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
index 1264e3ffb694..9c12e6dea29e 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
@@ -24,6 +24,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -70,7 +71,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -80,7 +81,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh b/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh
index 59339f766c0a..68a8d016073c 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -60,7 +61,7 @@ main(int argc, char **argv)
}
EOF
-gcc -m32 -c test.c
+cc -xarch=generic -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -70,7 +71,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -m32 -o test test.o prov.o
+cc -xarch=generic -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh b/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh
index e270290e7d88..39de8e0d81b0 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -60,7 +61,7 @@ main(int argc, char **argv)
}
EOF
-gcc -m64 -c test.c
+cc -xarch=generic64 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -70,7 +71,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -m64 -o test test.o prov.o
+cc -xarch=generic64 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.header.ksh b/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
index f4679bc3f8ed..08a1912bae84 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -64,7 +65,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -74,7 +75,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.include.ksh b/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
index 5576ab81ec48..5683f47d4277 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
# Make sure <unistd.h> defines _DTRACE_VERSION
@@ -45,7 +46,7 @@ main(int argc, char **argv)
}
EOF
-gcc -m32 -o test test.c
+cc -xarch=generic -o test test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh b/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
index bbe1a4acc9a7..ec07e057af88 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -61,7 +62,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -71,7 +72,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh b/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
index 35d97afc4828..01b2126c9442 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -63,7 +64,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -73,7 +74,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh b/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
index 852f5a0b3c7f..0c8b072cb0d3 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
@@ -24,6 +24,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -64,7 +65,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -74,7 +75,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh b/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh
index c0c3465e7626..a911bcdfdfbb 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
# Fake up a scenario where _DTRACE_VERSION is not defined by having our own
# <unistd.h>. This tests that dtrace -h will produce a header file which can
@@ -69,12 +70,12 @@ main(int argc, char **argv)
}
EOF
-gcc -I. -m32 -c test.c
+cc -I. -xarch=generic -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
fi
-gcc -m32 -o test test.o
+cc -xarch=generic -o test test.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh b/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
deleted file mode 100644
index 338dcdf03e6f..000000000000
--- a/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
+++ /dev/null
@@ -1,128 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
-
-if [ $# != 1 ]; then
- echo expected one argument: '<'dtrace-path'>'
- exit 2
-fi
-
-dtrace=$1
-DIR=/var/tmp/dtest.$$
-
-mkdir $DIR
-cd $DIR
-
-cat > test.c <<EOF
-#include <unistd.h>
-#include <sys/sdt.h>
-
-int
-main(int argc, char **argv)
-{
- DTRACE_PROBE(test_prov, probe1);
-}
-EOF
-
-cat > prov.d <<EOF
-provider test_prov {
- probe probe1();
-};
-EOF
-
-gcc -c test.c
-if [ $? -ne 0 ]; then
- print -u2 "failed to compile test.c"
- exit 1
-fi
-$dtrace -G -32 -s prov.d test.o
-if [ $? -ne 0 ]; then
- print -u2 "failed to create DOF"
- exit 1
-fi
-gcc -o test test.o prov.o
-if [ $? -ne 0 ]; then
- print -u2 "failed to link final executable"
- exit 1
-fi
-
-script()
-{
- $dtrace -Zwqs /dev/stdin <<EOF
-
- BEGIN
- {
- spec = speculation();
- speculate(spec);
- printf("this is speculative!\n");
- }
-
- test_prov*:::
- {
- probeid = id;
- }
-
- tick-1sec
- /probeid == 0/
- {
- printf("launching test\n");
- system("./test");
- }
-
- tick-1sec
- /probeid != 0/
- {
- printf("attempting re-enabling\n");
- system("dtrace -e -x errtags -i %d", probeid);
- attempts++;
- }
-
- tick-1sec
- /attempts > 10/
- {
- exit(0);
- }
-EOF
-}
-
-script 2>&1 | tee test.out
-
-#
-# It should be true that our probe was not reaped after the provider was made
-# defunct: the speculative tracing action prevents reaping of any ECB in the
-# enabling.
-#
-status=0
-
-if grep D_PDESC_INVAL test.out 2> /dev/null 1>&2 ; then
- status=1
-else
- grep D_PROC_GRAB test.out 2> /dev/null 1>&2
- status=$?
-fi
-
-cd /
-/usr/bin/rm -rf $DIR
-
-exit $status
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh b/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
deleted file mode 100644
index a2e5edee3814..000000000000
--- a/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
+++ /dev/null
@@ -1,124 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
-
-if [ $# != 1 ]; then
- echo expected one argument: '<'dtrace-path'>'
- exit 2
-fi
-
-dtrace=$1
-DIR=/var/tmp/dtest.$$
-
-mkdir $DIR
-cd $DIR
-
-cat > test.c <<EOF
-#include <unistd.h>
-#include <sys/sdt.h>
-
-int
-main(int argc, char **argv)
-{
- DTRACE_PROBE(test_prov, probe1);
-}
-EOF
-
-cat > prov.d <<EOF
-provider test_prov {
- probe probe1();
-};
-EOF
-
-gcc -c test.c
-if [ $? -ne 0 ]; then
- print -u2 "failed to compile test.c"
- exit 1
-fi
-$dtrace -G -32 -s prov.d test.o
-if [ $? -ne 0 ]; then
- print -u2 "failed to create DOF"
- exit 1
-fi
-gcc -o test test.o prov.o
-if [ $? -ne 0 ]; then
- print -u2 "failed to link final executable"
- exit 1
-fi
-
-script()
-{
- $dtrace -Zwqs /dev/stdin <<EOF
- test_prov*:::
- {
- probeid = id;
- }
-
- tick-1sec
- /probeid == 0/
- {
- printf("launching test\n");
- system("./test");
- }
-
- tick-1sec
- /probeid != 0/
- {
- printf("attempting re-enabling\n");
- system("dtrace -e -x errtags -i %d", probeid);
- attempts++;
- }
-
- tick-1sec
- /attempts > 10/
- {
- exit(0);
- }
-EOF
-}
-
-$dtrace -x bufpolicy=ring -ZwqP test_prov\* > /dev/null 2>&1 &
-background=$!
-echo launched ring buffered enabling as pid $background
-script 2>&1 | tee test.out
-
-#
-# It should be true that our probe was not reaped after the provider was made
-# defunct: the active ring buffer in the earlier enabling prevents reaping of
-# any of the earlier enabling's ECBs.
-#
-status=0
-
-if grep D_PDESC_INVAL test.out 2> /dev/null 1>&2 ; then
- status=1
-else
- grep D_PROC_GRAB test.out 2> /dev/null 1>&2
- status=$?
-fi
-
-kill $background
-cd /
-/usr/bin/rm -rf $DIR
-
-exit $status
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh b/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
index a1e939c8839f..989d6d32aff9 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -61,7 +62,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -71,7 +72,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh b/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
deleted file mode 100644
index f18c585ef6c8..000000000000
--- a/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
+++ /dev/null
@@ -1,115 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2011, Joyent, Inc. All rights reserved.
-#
-
-if [ $# != 1 ]; then
- echo expected one argument: '<'dtrace-path'>'
- exit 2
-fi
-
-dtrace=$1
-DIR=/var/tmp/dtest.$$
-
-mkdir $DIR
-cd $DIR
-
-cat > test.c <<EOF
-#include <unistd.h>
-#include <sys/sdt.h>
-
-int
-main(int argc, char **argv)
-{
- DTRACE_PROBE(test_prov, probe1);
-}
-EOF
-
-cat > prov.d <<EOF
-provider test_prov {
- probe probe1();
-};
-EOF
-
-gcc -c test.c
-if [ $? -ne 0 ]; then
- print -u2 "failed to compile test.c"
- exit 1
-fi
-$dtrace -G -32 -s prov.d test.o
-if [ $? -ne 0 ]; then
- print -u2 "failed to create DOF"
- exit 1
-fi
-gcc -o test test.o prov.o
-if [ $? -ne 0 ]; then
- print -u2 "failed to link final executable"
- exit 1
-fi
-
-script()
-{
- $dtrace -Zwqs /dev/stdin <<EOF
- test_prov*:::
- {
- probeid = id;
- }
-
- tick-1sec
- /probeid == 0/
- {
- printf("launching test\n");
- system("./test");
- }
-
- tick-1sec
- /probeid != 0/
- {
- printf("attempting re-enabling\n");
- system("dtrace -e -x errtags -i %d", probeid);
- attempts++;
- }
-
- tick-1sec
- /attempts > 10/
- {
- exit(0);
- }
-EOF
-}
-
-script 2>&1 | tee test.out
-
-#
-# It should be true that our probe was reaped over the course of the enabling,
-# causing the embedded DTrace invocation to fail on an invalid probe (that is,
-# D_PDESC_INVAL) instead of an inability to grab the underlying process
-# (D_PROC_GRAB).
-#
-grep D_PDESC_INVAL test.out 2> /dev/null 1>&2
-status=$?
-
-cd /
-/usr/bin/rm -rf $DIR
-
-exit $status
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh b/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
index 2f0ee33f1e29..7fad40156a09 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -51,7 +52,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -61,7 +62,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.static.ksh b/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
index 85b0e553c469..1ebcdb95fdf2 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -62,7 +63,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -72,7 +73,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh b/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
index 07b765702cae..7cf9004c612c 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
# Rebuilding an object file containing DOF changes slightly when the object
# files containing the probes have already been modified. This tests that
@@ -66,7 +67,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -82,7 +83,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create final DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/usdt/tst.user.ksh b/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
index f52c1c351e91..d5d9fdc4d3fd 100644
--- a/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
+++ b/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
@@ -24,6 +24,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -61,7 +62,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+cc -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -71,7 +72,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh b/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh
index 57c13d5abee4..1a7e0e12365b 100644
--- a/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh
+++ b/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh
@@ -23,6 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+#ident "%Z%%M% %I% %E% SMI"
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -34,7 +35,7 @@ dtrace=$1
rm -f $file
-dir=`/bin/dirname $tst`
+dir=`dirname $tst`
$dtrace -o $file -c $dir/tst.spin.exe -s /dev/stdin <<EOF
diff --git a/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh b/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh
index a06f44e42b63..cfd7a631211a 100644
--- a/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh
+++ b/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh
@@ -23,6 +23,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# ident "%Z%%M% %I% %E% SMI"
#
# ASSERTION: Make sure USDT probes work as tail-calls on SPARC.
@@ -87,7 +88,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
-gcc -o test test.o prov.o
+cc -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index d462d3f18e4d..c6e219df9e1d 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -18,10 +18,8 @@
*
* CDDL HEADER END
*/
-
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <stdio.h>
@@ -56,8 +54,6 @@
#include <sys/zfs_fuid.h>
#include <sys/arc.h>
#include <sys/ddt.h>
-#include <sys/zfeature.h>
-#include <zfs_comutil.h>
#undef ZFS_MAXNAMELEN
#undef verify
#include <libzfs.h>
@@ -67,8 +63,7 @@
#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \
zio_checksum_table[(idx)].ci_name : "UNKNOWN")
#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \
- dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \
- dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN")
+ dmu_ot[(idx)].ot_name : "UNKNOWN")
#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES)
#ifndef lint
@@ -107,16 +102,13 @@ static void
usage(void)
{
(void) fprintf(stderr,
- "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] "
- "poolname [object...]\n"
- " %s [-divPA] [-e -p path...] dataset [object...]\n"
- " %s -m [-LXFPA] [-t txg] [-e [-p path...]] "
- "poolname [vdev [metaslab...]]\n"
- " %s -R [-A] [-e [-p path...]] poolname "
- "vdev:offset:size[:flags]\n"
- " %s -S [-PA] [-e [-p path...]] poolname\n"
- " %s -l [-uA] device\n"
- " %s -C [-A] [-U config]\n\n",
+ "Usage: %s [-CumdibcsDvhL] poolname [object...]\n"
+ " %s [-div] dataset [object...]\n"
+ " %s -m [-L] poolname [vdev [metaslab...]]\n"
+ " %s -R poolname vdev:offset:size[:flags]\n"
+ " %s -S poolname\n"
+ " %s -l [-u] device\n"
+ " %s -C\n\n",
cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname);
(void) fprintf(stderr, " Dataset name must include at least one "
@@ -158,7 +150,7 @@ usage(void)
"has altroot/not in a cachefile\n");
(void) fprintf(stderr, " -p <path> -- 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, " -P print numbers parsable\n");
(void) fprintf(stderr, " -t <txg> -- highest txg to use when "
"searching for uberblocks\n");
(void) fprintf(stderr, "Specify an option more than once (e.g. -bb) "
@@ -205,27 +197,6 @@ dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size)
nvlist_free(nv);
}
-/* ARGSUSED */
-static void
-dump_history_offsets(objset_t *os, uint64_t object, void *data, size_t size)
-{
- spa_history_phys_t *shp = data;
-
- if (shp == NULL)
- return;
-
- (void) printf("\t\tpool_create_len = %llu\n",
- (u_longlong_t)shp->sh_pool_create_len);
- (void) printf("\t\tphys_max_off = %llu\n",
- (u_longlong_t)shp->sh_phys_max_off);
- (void) printf("\t\tbof = %llu\n",
- (u_longlong_t)shp->sh_bof);
- (void) printf("\t\teof = %llu\n",
- (u_longlong_t)shp->sh_eof);
- (void) printf("\t\trecords_lost = %llu\n",
- (u_longlong_t)shp->sh_records_lost);
-}
-
static void
zdb_nicenum(uint64_t num, char *buf)
{
@@ -875,22 +846,21 @@ dump_history(spa_t *spa)
for (int i = 0; i < num; i++) {
uint64_t time, txg, ievent;
char *cmd, *intstr;
- boolean_t printed = B_FALSE;
if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME,
&time) != 0)
- goto next;
+ continue;
if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD,
&cmd) != 0) {
if (nvlist_lookup_uint64(events[i],
ZPOOL_HIST_INT_EVENT, &ievent) != 0)
- goto next;
+ continue;
verify(nvlist_lookup_uint64(events[i],
ZPOOL_HIST_TXG, &txg) == 0);
verify(nvlist_lookup_string(events[i],
ZPOOL_HIST_INT_STR, &intstr) == 0);
- if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS)
- goto next;
+ if (ievent >= LOG_END)
+ continue;
(void) snprintf(internalstr,
sizeof (internalstr),
@@ -903,14 +873,6 @@ dump_history(spa_t *spa)
(void) localtime_r(&tsec, &t);
(void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t);
(void) printf("%s %s\n", tbuf, cmd);
- printed = B_TRUE;
-
-next:
- if (dump_opt['h'] > 1) {
- if (!printed)
- (void) printf("unrecognized record:\n");
- dump_nvlist(events[i], 2);
- }
}
}
@@ -1123,7 +1085,7 @@ dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size)
ASSERT(size == sizeof (*ds));
crtime = ds->ds_creation_time;
- zdb_nicenum(ds->ds_referenced_bytes, used);
+ zdb_nicenum(ds->ds_used_bytes, used);
zdb_nicenum(ds->ds_compressed_bytes, compressed);
zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed);
zdb_nicenum(ds->ds_unique_bytes, unique);
@@ -1167,44 +1129,6 @@ dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size)
/* ARGSUSED */
static int
-dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
-{
- char blkbuf[BP_SPRINTF_LEN];
-
- if (bp->blk_birth != 0) {
- sprintf_blkptr(blkbuf, bp);
- (void) printf("\t%s\n", blkbuf);
- }
- return (0);
-}
-
-static void
-dump_bptree(objset_t *os, uint64_t obj, char *name)
-{
- char bytes[32];
- bptree_phys_t *bt;
- dmu_buf_t *db;
-
- if (dump_opt['d'] < 3)
- return;
-
- VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
- bt = db->db_data;
- zdb_nicenum(bt->bt_bytes, bytes);
- (void) printf("\n %s: %llu datasets, %s\n",
- name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes);
- dmu_buf_rele(db, FTAG);
-
- if (dump_opt['d'] < 5)
- return;
-
- (void) printf("\n");
-
- (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL);
-}
-
-/* ARGSUSED */
-static int
dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
{
char blkbuf[BP_SPRINTF_LEN];
@@ -1487,7 +1411,7 @@ static object_viewer_t *object_viewer[DMU_OT_NUMTYPES + 1] = {
dump_zap, /* other ZAP */
dump_zap, /* persistent error log */
dump_uint8, /* SPA history */
- dump_history_offsets, /* SPA history offsets */
+ dump_uint64, /* SPA history offsets */
dump_zap, /* Pool properties */
dump_zap, /* DSL permissions */
dump_acl, /* ZFS ACL */
@@ -1956,13 +1880,11 @@ typedef struct zdb_blkstats {
*/
#define ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0)
#define ZDB_OT_DITTO (DMU_OT_NUMTYPES + 1)
-#define ZDB_OT_OTHER (DMU_OT_NUMTYPES + 2)
-#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 3)
+#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 2)
static char *zdb_ot_extname[] = {
"deferred free",
"dedup ditto",
- "other",
"Total",
};
@@ -2043,10 +1965,9 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
type = BP_GET_TYPE(bp);
- zdb_count_block(zcb, zilog, bp,
- (type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type);
+ zdb_count_block(zcb, zilog, bp, type);
- is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type));
+ is_metadata = (BP_GET_LEVEL(bp) != 0 || dmu_ot[type].ot_metadata);
if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) {
int ioerr;
@@ -2271,12 +2192,6 @@ dump_block_stats(spa_t *spa)
count_block_cb, &zcb, NULL);
(void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
count_block_cb, &zcb, NULL);
- if (spa_feature_is_active(spa,
- &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
- VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset,
- spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb,
- &zcb, NULL));
- }
if (dump_opt['c'] > 1)
flags |= TRAVERSE_PREFETCH_DATA;
@@ -2453,7 +2368,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
}
if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF ||
- BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp)))
+ BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata)
return (0);
ddt_key_fill(&zdde_search.zdde_key, bp);
@@ -2558,14 +2473,7 @@ dump_zpool(spa_t *spa)
dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees");
if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj,
- "Pool snapshot frees");
- }
-
- if (spa_feature_is_active(spa,
- &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
- dump_bptree(spa->spa_meta_objset,
- spa->spa_dsl_pool->dp_bptree_obj,
- "Pool dataset frees");
+ "Pool frees");
}
dump_dtl(spa->spa_root_vdev, 0);
}
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 1fd27c5677d8..9516697390ef 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -21,10 +21,6 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright 2012 Milan Jurik. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <assert.h>
@@ -45,7 +41,6 @@
#include <grp.h>
#include <pwd.h>
#include <signal.h>
-#include <sys/list.h>
#include <sys/mkdev.h>
#include <sys/mntent.h>
#include <sys/mnttab.h>
@@ -56,12 +51,7 @@
#include <time.h>
#include <libzfs.h>
-#include <libzfs_core.h>
-#include <zfs_prop.h>
-#include <zfs_deleg.h>
#include <libuutil.h>
-#include <aclutils.h>
-#include <directory.h>
#include "zfs_iter.h"
#include "zfs_util.h"
@@ -71,7 +61,7 @@ libzfs_handle_t *g_zfs;
static FILE *mnttab_file;
static char history_str[HIS_MAX_RECORD_LEN];
-static boolean_t log_history = B_TRUE;
+const char *pypath = "/usr/lib/zfs/pyzfs.py";
static int zfs_do_clone(int argc, char **argv);
static int zfs_do_create(int argc, char **argv);
@@ -92,10 +82,8 @@ static int zfs_do_send(int argc, char **argv);
static int zfs_do_receive(int argc, char **argv);
static int zfs_do_promote(int argc, char **argv);
static int zfs_do_userspace(int argc, char **argv);
-static int zfs_do_allow(int argc, char **argv);
-static int zfs_do_unallow(int argc, char **argv);
+static int zfs_do_python(int argc, char **argv);
static int zfs_do_hold(int argc, char **argv);
-static int zfs_do_holds(int argc, char **argv);
static int zfs_do_release(int argc, char **argv);
static int zfs_do_diff(int argc, char **argv);
@@ -143,7 +131,7 @@ typedef enum {
HELP_HOLD,
HELP_HOLDS,
HELP_RELEASE,
- HELP_DIFF,
+ HELP_DIFF
} zfs_help_t;
typedef struct zfs_command {
@@ -188,12 +176,12 @@ static zfs_command_t command_table[] = {
{ "send", zfs_do_send, HELP_SEND },
{ "receive", zfs_do_receive, HELP_RECEIVE },
{ NULL },
- { "allow", zfs_do_allow, HELP_ALLOW },
+ { "allow", zfs_do_python, HELP_ALLOW },
{ NULL },
- { "unallow", zfs_do_unallow, HELP_UNALLOW },
+ { "unallow", zfs_do_python, HELP_UNALLOW },
{ NULL },
{ "hold", zfs_do_hold, HELP_HOLD },
- { "holds", zfs_do_holds, HELP_HOLDS },
+ { "holds", zfs_do_python, HELP_HOLDS },
{ "release", zfs_do_release, HELP_RELEASE },
{ "diff", zfs_do_diff, HELP_DIFF },
};
@@ -215,13 +203,11 @@ get_usage(zfs_help_t idx)
"\tcreate [-ps] [-b blocksize] [-o property=value] ... "
"-V <size> <volume>\n"));
case HELP_DESTROY:
- return (gettext("\tdestroy [-fnpRrv] <filesystem|volume>\n"
- "\tdestroy [-dnpRrv] "
- "<filesystem|volume>@<snap>[%<snap>][,...]\n"));
+ return (gettext("\tdestroy [-rRf] <filesystem|volume>\n"
+ "\tdestroy [-rRd] <snapshot>\n"));
case HELP_GET:
return (gettext("\tget [-rHp] [-d max] "
- "[-o \"all\" | field[,...]] [-t type[,...]] "
- "[-s source[,...]]\n"
+ "[-o \"all\" | field[,...]] [-s source[,...]]\n"
"\t <\"all\" | property[,...]> "
"[filesystem|volume|snapshot] ...\n"));
case HELP_INHERIT:
@@ -245,15 +231,14 @@ get_usage(zfs_help_t idx)
"snapshot>\n"
"\treceive [-vnFu] [-d | -e] <filesystem>\n"));
case HELP_RENAME:
- return (gettext("\trename [-f] <filesystem|volume|snapshot> "
+ return (gettext("\trename <filesystem|volume|snapshot> "
"<filesystem|volume|snapshot>\n"
- "\trename [-f] -p <filesystem|volume> <filesystem|volume>\n"
+ "\trename -p <filesystem|volume> <filesystem|volume>\n"
"\trename -r <snapshot> <snapshot>"));
case HELP_ROLLBACK:
return (gettext("\trollback [-rRf] <snapshot>\n"));
case HELP_SEND:
- return (gettext("\tsend [-DnPpRrv] [-[iI] snapshot] "
- "<snapshot>\n"));
+ return (gettext("\tsend [-RDp] [-[iI] snapshot] <snapshot>\n"));
case HELP_SET:
return (gettext("\tset <property=value> "
"<filesystem|volume|snapshot> ...\n"));
@@ -261,7 +246,7 @@ get_usage(zfs_help_t idx)
return (gettext("\tshare <-a | filesystem>\n"));
case HELP_SNAPSHOT:
return (gettext("\tsnapshot [-r] [-o property=value] ... "
- "<filesystem@snapname|volume@snapname> ...\n"));
+ "<filesystem@snapname|volume@snapname>\n"));
case HELP_UNMOUNT:
return (gettext("\tunmount [-f] "
"<-a | filesystem|mountpoint>\n"));
@@ -432,8 +417,6 @@ usage(boolean_t requested)
(void) fprintf(fp, "YES NO <size> | none\n");
(void) fprintf(fp, "\t%-15s ", "groupquota@...");
(void) fprintf(fp, "YES NO <size> | none\n");
- (void) fprintf(fp, "\t%-15s ", "written@<snap>");
- (void) fprintf(fp, " NO NO <size>\n");
(void) fprintf(fp, gettext("\nSizes are specified in bytes "
"with standard units such as K, M, G, etc.\n"));
@@ -579,7 +562,7 @@ zfs_do_clone(int argc, char **argv)
zfs_handle_t *zhp = NULL;
boolean_t parents = B_FALSE;
nvlist_t *props;
- int ret = 0;
+ int ret;
int c;
if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
@@ -746,6 +729,7 @@ zfs_do_create(int argc, char **argv)
(void) fprintf(stderr, gettext("missing size "
"argument\n"));
goto badusage;
+ break;
case '?':
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
optopt);
@@ -878,23 +862,15 @@ badusage:
*/
typedef struct destroy_cbdata {
boolean_t cb_first;
- boolean_t cb_force;
- boolean_t cb_recurse;
- boolean_t cb_error;
- boolean_t cb_doclones;
+ int cb_force;
+ int cb_recurse;
+ int cb_error;
+ int cb_needforce;
+ int cb_doclones;
+ boolean_t cb_closezhp;
zfs_handle_t *cb_target;
+ char *cb_snapname;
boolean_t cb_defer_destroy;
- boolean_t cb_verbose;
- boolean_t cb_parsable;
- boolean_t cb_dryrun;
- nvlist_t *cb_nvl;
-
- /* first snap in contiguous run */
- char *cb_firstsnap;
- /* previous snap in contiguous run */
- char *cb_prevsnap;
- int64_t cb_snapused;
- char *cb_snapspec;
} destroy_cbdata_t;
/*
@@ -924,7 +900,7 @@ destroy_check_dependent(zfs_handle_t *zhp, void *data)
(void) fprintf(stderr, gettext("use '-r' to destroy "
"the following datasets:\n"));
cbp->cb_first = B_FALSE;
- cbp->cb_error = B_TRUE;
+ cbp->cb_error = 1;
}
(void) fprintf(stderr, "%s\n", zfs_get_name(zhp));
@@ -945,8 +921,7 @@ destroy_check_dependent(zfs_handle_t *zhp, void *data)
(void) fprintf(stderr, gettext("use '-R' to destroy "
"the following datasets:\n"));
cbp->cb_first = B_FALSE;
- cbp->cb_error = B_TRUE;
- cbp->cb_dryrun = B_TRUE;
+ cbp->cb_error = 1;
}
(void) fprintf(stderr, "%s\n", zfs_get_name(zhp));
@@ -960,20 +935,7 @@ out:
static int
destroy_callback(zfs_handle_t *zhp, void *data)
{
- destroy_cbdata_t *cb = data;
- const char *name = zfs_get_name(zhp);
-
- if (cb->cb_verbose) {
- if (cb->cb_parsable) {
- (void) printf("destroy\t%s\n", name);
- } else if (cb->cb_dryrun) {
- (void) printf(gettext("would destroy %s\n"),
- name);
- } else {
- (void) printf(gettext("will destroy %s\n"),
- name);
- }
- }
+ destroy_cbdata_t *cbp = data;
/*
* Ignore pools (which we've already flagged as an error before getting
@@ -985,12 +947,13 @@ destroy_callback(zfs_handle_t *zhp, void *data)
return (0);
}
- if (!cb->cb_dryrun) {
- if (zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 ||
- zfs_destroy(zhp, cb->cb_defer_destroy) != 0) {
- zfs_close(zhp);
- return (-1);
- }
+ /*
+ * Bail out on the first error.
+ */
+ if (zfs_unmount(zhp, NULL, cbp->cb_force ? MS_FORCE : 0) != 0 ||
+ zfs_destroy(zhp, cbp->cb_defer_destroy) != 0) {
+ zfs_close(zhp);
+ return (-1);
}
zfs_close(zhp);
@@ -998,144 +961,39 @@ destroy_callback(zfs_handle_t *zhp, void *data)
}
static int
-destroy_print_cb(zfs_handle_t *zhp, void *arg)
-{
- destroy_cbdata_t *cb = arg;
- const char *name = zfs_get_name(zhp);
- int err = 0;
-
- if (nvlist_exists(cb->cb_nvl, name)) {
- if (cb->cb_firstsnap == NULL)
- cb->cb_firstsnap = strdup(name);
- if (cb->cb_prevsnap != NULL)
- free(cb->cb_prevsnap);
- /* this snap continues the current range */
- cb->cb_prevsnap = strdup(name);
- if (cb->cb_firstsnap == NULL || cb->cb_prevsnap == NULL)
- nomem();
- if (cb->cb_verbose) {
- if (cb->cb_parsable) {
- (void) printf("destroy\t%s\n", name);
- } else if (cb->cb_dryrun) {
- (void) printf(gettext("would destroy %s\n"),
- name);
- } else {
- (void) printf(gettext("will destroy %s\n"),
- name);
- }
- }
- } else if (cb->cb_firstsnap != NULL) {
- /* end of this range */
- uint64_t used = 0;
- err = lzc_snaprange_space(cb->cb_firstsnap,
- cb->cb_prevsnap, &used);
- cb->cb_snapused += used;
- free(cb->cb_firstsnap);
- cb->cb_firstsnap = NULL;
- free(cb->cb_prevsnap);
- cb->cb_prevsnap = NULL;
- }
- zfs_close(zhp);
- return (err);
-}
-
-static int
-destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb)
-{
- int err = 0;
- assert(cb->cb_firstsnap == NULL);
- assert(cb->cb_prevsnap == NULL);
- err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb);
- if (cb->cb_firstsnap != NULL) {
- uint64_t used = 0;
- if (err == 0) {
- err = lzc_snaprange_space(cb->cb_firstsnap,
- cb->cb_prevsnap, &used);
- }
- cb->cb_snapused += used;
- free(cb->cb_firstsnap);
- cb->cb_firstsnap = NULL;
- free(cb->cb_prevsnap);
- cb->cb_prevsnap = NULL;
- }
- return (err);
-}
-
-static int
-snapshot_to_nvl_cb(zfs_handle_t *zhp, void *arg)
+destroy_snap_clones(zfs_handle_t *zhp, void *arg)
{
- destroy_cbdata_t *cb = arg;
- int err = 0;
-
- /* Check for clones. */
- if (!cb->cb_doclones && !cb->cb_defer_destroy) {
- cb->cb_target = zhp;
- cb->cb_first = B_TRUE;
- err = zfs_iter_dependents(zhp, B_TRUE,
- destroy_check_dependent, cb);
- }
-
- if (err == 0) {
- if (nvlist_add_boolean(cb->cb_nvl, zfs_get_name(zhp)))
- nomem();
- }
- zfs_close(zhp);
- return (err);
-}
+ destroy_cbdata_t *cbp = arg;
+ char thissnap[MAXPATHLEN];
+ zfs_handle_t *szhp;
+ boolean_t closezhp = cbp->cb_closezhp;
+ int rv;
-static int
-gather_snapshots(zfs_handle_t *zhp, void *arg)
-{
- destroy_cbdata_t *cb = arg;
- int err = 0;
+ (void) snprintf(thissnap, sizeof (thissnap),
+ "%s@%s", zfs_get_name(zhp), cbp->cb_snapname);
- err = zfs_iter_snapspec(zhp, cb->cb_snapspec, snapshot_to_nvl_cb, cb);
- if (err == ENOENT)
- err = 0;
- if (err != 0)
- goto out;
-
- if (cb->cb_verbose) {
- err = destroy_print_snapshots(zhp, cb);
- if (err != 0)
- goto out;
- }
-
- if (cb->cb_recurse)
- err = zfs_iter_filesystems(zhp, gather_snapshots, cb);
-
-out:
- zfs_close(zhp);
- return (err);
-}
-
-static int
-destroy_clones(destroy_cbdata_t *cb)
-{
- nvpair_t *pair;
- for (pair = nvlist_next_nvpair(cb->cb_nvl, NULL);
- pair != NULL;
- pair = nvlist_next_nvpair(cb->cb_nvl, pair)) {
- zfs_handle_t *zhp = zfs_open(g_zfs, nvpair_name(pair),
- ZFS_TYPE_SNAPSHOT);
- if (zhp != NULL) {
- boolean_t defer = cb->cb_defer_destroy;
- int err = 0;
-
- /*
- * We can't defer destroy non-snapshots, so set it to
- * false while destroying the clones.
- */
- cb->cb_defer_destroy = B_FALSE;
- err = zfs_iter_dependents(zhp, B_FALSE,
- destroy_callback, cb);
- cb->cb_defer_destroy = defer;
- zfs_close(zhp);
- if (err != 0)
- return (err);
+ libzfs_print_on_error(g_zfs, B_FALSE);
+ szhp = zfs_open(g_zfs, thissnap, ZFS_TYPE_SNAPSHOT);
+ libzfs_print_on_error(g_zfs, B_TRUE);
+ if (szhp) {
+ /*
+ * Destroy any clones of this snapshot
+ */
+ if (zfs_iter_dependents(szhp, B_FALSE, destroy_callback,
+ cbp) != 0) {
+ zfs_close(szhp);
+ if (closezhp)
+ zfs_close(zhp);
+ return (-1);
}
+ zfs_close(szhp);
}
- return (0);
+
+ cbp->cb_closezhp = B_TRUE;
+ rv = zfs_iter_filesystems(zhp, destroy_snap_clones, arg);
+ if (closezhp)
+ zfs_close(zhp);
+ return (rv);
}
static int
@@ -1144,35 +1002,25 @@ zfs_do_destroy(int argc, char **argv)
destroy_cbdata_t cb = { 0 };
int c;
zfs_handle_t *zhp;
- char *at;
+ char *cp;
zfs_type_t type = ZFS_TYPE_DATASET;
/* check options */
- while ((c = getopt(argc, argv, "vpndfrR")) != -1) {
+ while ((c = getopt(argc, argv, "dfrR")) != -1) {
switch (c) {
- case 'v':
- cb.cb_verbose = B_TRUE;
- break;
- case 'p':
- cb.cb_verbose = B_TRUE;
- cb.cb_parsable = B_TRUE;
- break;
- case 'n':
- cb.cb_dryrun = B_TRUE;
- break;
case 'd':
cb.cb_defer_destroy = B_TRUE;
type = ZFS_TYPE_SNAPSHOT;
break;
case 'f':
- cb.cb_force = B_TRUE;
+ cb.cb_force = 1;
break;
case 'r':
- cb.cb_recurse = B_TRUE;
+ cb.cb_recurse = 1;
break;
case 'R':
- cb.cb_recurse = B_TRUE;
- cb.cb_doclones = B_TRUE;
+ cb.cb_recurse = 1;
+ cb.cb_doclones = 1;
break;
case '?':
default:
@@ -1187,7 +1035,7 @@ zfs_do_destroy(int argc, char **argv)
/* check number of arguments */
if (argc == 0) {
- (void) fprintf(stderr, gettext("missing dataset argument\n"));
+ (void) fprintf(stderr, gettext("missing path argument\n"));
usage(B_FALSE);
}
if (argc > 1) {
@@ -1195,117 +1043,91 @@ zfs_do_destroy(int argc, char **argv)
usage(B_FALSE);
}
- at = strchr(argv[0], '@');
- if (at != NULL) {
- int err = 0;
-
- /* Build the list of snaps to destroy in cb_nvl. */
- if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0)
- nomem();
+ /*
+ * If we are doing recursive destroy of a snapshot, then the
+ * named snapshot may not exist. Go straight to libzfs.
+ */
+ if (cb.cb_recurse && (cp = strchr(argv[0], '@'))) {
+ int ret;
- *at = '\0';
- zhp = zfs_open(g_zfs, argv[0],
- ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
- if (zhp == NULL)
+ *cp = '\0';
+ if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_DATASET)) == NULL)
return (1);
+ *cp = '@';
+ cp++;
- cb.cb_snapspec = at + 1;
- if (gather_snapshots(zfs_handle_dup(zhp), &cb) != 0 ||
- cb.cb_error) {
- zfs_close(zhp);
- nvlist_free(cb.cb_nvl);
- return (1);
- }
+ if (cb.cb_doclones) {
+ boolean_t defer = cb.cb_defer_destroy;
- if (nvlist_empty(cb.cb_nvl)) {
- (void) fprintf(stderr, gettext("could not find any "
- "snapshots to destroy; check snapshot names.\n"));
- zfs_close(zhp);
- nvlist_free(cb.cb_nvl);
- return (1);
- }
-
- if (cb.cb_verbose) {
- char buf[16];
- zfs_nicenum(cb.cb_snapused, buf, sizeof (buf));
- if (cb.cb_parsable) {
- (void) printf("reclaim\t%llu\n",
- cb.cb_snapused);
- } else if (cb.cb_dryrun) {
- (void) printf(gettext("would reclaim %s\n"),
- buf);
- } else {
- (void) printf(gettext("will reclaim %s\n"),
- buf);
+ /*
+ * Temporarily ignore the defer_destroy setting since
+ * it's not supported for clones.
+ */
+ cb.cb_defer_destroy = B_FALSE;
+ cb.cb_snapname = cp;
+ if (destroy_snap_clones(zhp, &cb) != 0) {
+ zfs_close(zhp);
+ return (1);
}
+ cb.cb_defer_destroy = defer;
}
- if (!cb.cb_dryrun) {
- if (cb.cb_doclones)
- err = destroy_clones(&cb);
- if (err == 0) {
- err = zfs_destroy_snaps_nvl(zhp, cb.cb_nvl,
- cb.cb_defer_destroy);
- }
+ ret = zfs_destroy_snaps(zhp, cp, cb.cb_defer_destroy);
+ zfs_close(zhp);
+ if (ret) {
+ (void) fprintf(stderr,
+ gettext("no snapshots destroyed\n"));
}
+ return (ret != 0);
+ }
- zfs_close(zhp);
- nvlist_free(cb.cb_nvl);
- if (err != 0)
- return (1);
- } else {
- /* Open the given dataset */
- if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL)
- return (1);
+ /* Open the given dataset */
+ if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL)
+ return (1);
- cb.cb_target = zhp;
+ cb.cb_target = zhp;
- /*
- * Perform an explicit check for pools before going any further.
- */
- if (!cb.cb_recurse && strchr(zfs_get_name(zhp), '/') == NULL &&
- zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) {
- (void) fprintf(stderr, gettext("cannot destroy '%s': "
- "operation does not apply to pools\n"),
- zfs_get_name(zhp));
- (void) fprintf(stderr, gettext("use 'zfs destroy -r "
- "%s' to destroy all datasets in the pool\n"),
- zfs_get_name(zhp));
- (void) fprintf(stderr, gettext("use 'zpool destroy %s' "
- "to destroy the pool itself\n"), zfs_get_name(zhp));
- zfs_close(zhp);
- return (1);
- }
+ /*
+ * Perform an explicit check for pools before going any further.
+ */
+ if (!cb.cb_recurse && strchr(zfs_get_name(zhp), '/') == NULL &&
+ zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) {
+ (void) fprintf(stderr, gettext("cannot destroy '%s': "
+ "operation does not apply to pools\n"),
+ zfs_get_name(zhp));
+ (void) fprintf(stderr, gettext("use 'zfs destroy -r "
+ "%s' to destroy all datasets in the pool\n"),
+ zfs_get_name(zhp));
+ (void) fprintf(stderr, gettext("use 'zpool destroy %s' "
+ "to destroy the pool itself\n"), zfs_get_name(zhp));
+ zfs_close(zhp);
+ return (1);
+ }
- /*
- * Check for any dependents and/or clones.
- */
- cb.cb_first = B_TRUE;
- if (!cb.cb_doclones &&
- zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent,
- &cb) != 0) {
- zfs_close(zhp);
- return (1);
- }
+ /*
+ * Check for any dependents and/or clones.
+ */
+ cb.cb_first = B_TRUE;
+ if (!cb.cb_doclones && !cb.cb_defer_destroy &&
+ zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent,
+ &cb) != 0) {
+ zfs_close(zhp);
+ return (1);
+ }
- if (cb.cb_error) {
- zfs_close(zhp);
- return (1);
- }
+ if (cb.cb_error || (!cb.cb_defer_destroy &&
+ (zfs_iter_dependents(zhp, B_FALSE, destroy_callback, &cb) != 0))) {
+ zfs_close(zhp);
+ return (1);
+ }
- if (zfs_iter_dependents(zhp, B_FALSE, destroy_callback,
- &cb) != 0) {
- zfs_close(zhp);
- return (1);
- }
+ /*
+ * Do the real thing. The callback will close the handle regardless of
+ * whether it succeeds or not.
+ */
- /*
- * Do the real thing. The callback will close the
- * handle regardless of whether it succeeds or not.
- */
- if (destroy_callback(zhp, &cb) != 0)
- return (1);
- }
+ if (destroy_callback(zhp, &cb) != 0)
+ return (1);
return (0);
}
@@ -1407,17 +1229,6 @@ get_callback(zfs_handle_t *zhp, void *data)
zprop_print_one_property(zfs_get_name(zhp), cbp,
pl->pl_user_prop, buf, sourcetype, source, NULL);
- } else if (zfs_prop_written(pl->pl_user_prop)) {
- sourcetype = ZPROP_SRC_LOCAL;
-
- if (zfs_prop_get_written(zhp, pl->pl_user_prop,
- buf, sizeof (buf), cbp->cb_literal) != 0) {
- sourcetype = ZPROP_SRC_NONE;
- (void) strlcpy(buf, "-", sizeof (buf));
- }
-
- zprop_print_one_property(zfs_get_name(zhp), cbp,
- pl->pl_user_prop, buf, sourcetype, source, NULL);
} else {
if (nvlist_lookup_nvlist(user_props,
pl->pl_user_prop, &propval) != 0) {
@@ -1462,10 +1273,9 @@ static int
zfs_do_get(int argc, char **argv)
{
zprop_get_cbdata_t cb = { 0 };
- int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
- int types = ZFS_TYPE_DATASET;
+ int i, c, flags = 0;
char *value, *fields;
- int ret = 0;
+ int ret;
int limit = 0;
zprop_list_t fake_name = { 0 };
@@ -1480,7 +1290,7 @@ zfs_do_get(int argc, char **argv)
cb.cb_type = ZFS_TYPE_DATASET;
/* check options */
- while ((c = getopt(argc, argv, ":d:o:s:rt:Hp")) != -1) {
+ while ((c = getopt(argc, argv, ":d:o:s:rHp")) != -1) {
switch (c) {
case 'p':
cb.cb_literal = B_TRUE;
@@ -1598,37 +1408,6 @@ zfs_do_get(int argc, char **argv)
}
break;
- case 't':
- types = 0;
- flags &= ~ZFS_ITER_PROP_LISTSNAPS;
- while (*optarg != '\0') {
- static char *type_subopts[] = { "filesystem",
- "volume", "snapshot", "all", NULL };
-
- switch (getsubopt(&optarg, type_subopts,
- &value)) {
- case 0:
- types |= ZFS_TYPE_FILESYSTEM;
- break;
- case 1:
- types |= ZFS_TYPE_VOLUME;
- break;
- case 2:
- types |= ZFS_TYPE_SNAPSHOT;
- break;
- case 3:
- types = ZFS_TYPE_DATASET;
- break;
-
- default:
- (void) fprintf(stderr,
- gettext("invalid type '%s'\n"),
- value);
- usage(B_FALSE);
- }
- }
- break;
-
case '?':
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
optopt);
@@ -1672,7 +1451,7 @@ zfs_do_get(int argc, char **argv)
cb.cb_first = B_TRUE;
/* run for each object */
- ret = zfs_for_each(argc, argv, flags, types, NULL,
+ ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_DATASET, NULL,
&cb.cb_proplist, limit, get_callback, &cb);
if (cb.cb_proplist == &fake_name)
@@ -1733,7 +1512,7 @@ zfs_do_inherit(int argc, char **argv)
zfs_prop_t prop;
inherit_cbdata_t cb = { 0 };
char *propname;
- int ret = 0;
+ int ret;
int flags = 0;
boolean_t received = B_FALSE;
@@ -1908,11 +1687,9 @@ upgrade_set_callback(zfs_handle_t *zhp, void *data)
/*
* If they did "zfs upgrade -a", then we could
* be doing ioctls to different pools. We need
- * to log this history once to each pool, and bypass
- * the normal history logging that happens in main().
+ * to log this history once to each pool.
*/
- (void) zpool_log_history(g_zfs, history_str);
- log_history = B_FALSE;
+ verify(zpool_stage_history(g_zfs, history_str) == 0);
}
if (zfs_prop_set(zhp, "version", verstr) == 0)
cb->cb_numupgraded++;
@@ -1941,7 +1718,7 @@ zfs_do_upgrade(int argc, char **argv)
{
boolean_t all = B_FALSE;
boolean_t showversions = B_FALSE;
- int ret = 0;
+ int ret;
upgrade_cbdata_t cb = { 0 };
char c;
int flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
@@ -1996,8 +1773,8 @@ zfs_do_upgrade(int argc, char **argv)
"---------------\n");
(void) printf(gettext(" 1 Initial ZFS filesystem version\n"));
(void) printf(gettext(" 2 Enhanced directory entries\n"));
- (void) printf(gettext(" 3 Case insensitive and filesystem "
- "user identifier (FUID)\n"));
+ (void) printf(gettext(" 3 Case insensitive and File system "
+ "unique identifier (FUID)\n"));
(void) printf(gettext(" 4 userquota, groupquota "
"properties\n"));
(void) printf(gettext(" 5 System attributes\n"));
@@ -2046,721 +1823,81 @@ zfs_do_upgrade(int argc, char **argv)
return (ret);
}
-#define USTYPE_USR_BIT (0)
-#define USTYPE_GRP_BIT (1)
-#define USTYPE_PSX_BIT (2)
-#define USTYPE_SMB_BIT (3)
-
-#define USTYPE_USR (1 << USTYPE_USR_BIT)
-#define USTYPE_GRP (1 << USTYPE_GRP_BIT)
-
-#define USTYPE_PSX (1 << USTYPE_PSX_BIT)
-#define USTYPE_SMB (1 << USTYPE_SMB_BIT)
-
-#define USTYPE_PSX_USR (USTYPE_PSX | USTYPE_USR)
-#define USTYPE_SMB_USR (USTYPE_SMB | USTYPE_USR)
-#define USTYPE_PSX_GRP (USTYPE_PSX | USTYPE_GRP)
-#define USTYPE_SMB_GRP (USTYPE_SMB | USTYPE_GRP)
-#define USTYPE_ALL (USTYPE_PSX_USR | USTYPE_SMB_USR \
- | USTYPE_PSX_GRP | USTYPE_SMB_GRP)
-
-
-#define USPROP_USED_BIT (0)
-#define USPROP_QUOTA_BIT (1)
-
-#define USPROP_USED (1 << USPROP_USED_BIT)
-#define USPROP_QUOTA (1 << USPROP_QUOTA_BIT)
-
-typedef struct us_node {
- nvlist_t *usn_nvl;
- uu_avl_node_t usn_avlnode;
- uu_list_node_t usn_listnode;
-} us_node_t;
-
-typedef struct us_cbdata {
- nvlist_t **cb_nvlp;
- uu_avl_pool_t *cb_avl_pool;
- uu_avl_t *cb_avl;
- boolean_t cb_numname;
- boolean_t cb_nicenum;
- boolean_t cb_sid2posix;
- zfs_userquota_prop_t cb_prop;
- zfs_sort_column_t *cb_sortcol;
- size_t cb_max_typelen;
- size_t cb_max_namelen;
- size_t cb_max_usedlen;
- size_t cb_max_quotalen;
-} us_cbdata_t;
-
-typedef struct {
- zfs_sort_column_t *si_sortcol;
- boolean_t si_num_name;
- boolean_t si_parsable;
-} us_sort_info_t;
-
-static int
-us_compare(const void *larg, const void *rarg, void *unused)
-{
- const us_node_t *l = larg;
- const us_node_t *r = rarg;
- int rc = 0;
- us_sort_info_t *si = (us_sort_info_t *)unused;
- zfs_sort_column_t *sortcol = si->si_sortcol;
- boolean_t num_name = si->si_num_name;
- nvlist_t *lnvl = l->usn_nvl;
- nvlist_t *rnvl = r->usn_nvl;
-
- for (; sortcol != NULL; sortcol = sortcol->sc_next) {
- char *lvstr = "";
- char *rvstr = "";
- uint32_t lv32 = 0;
- uint32_t rv32 = 0;
- uint64_t lv64 = 0;
- uint64_t rv64 = 0;
- zfs_prop_t prop = sortcol->sc_prop;
- const char *propname = NULL;
- boolean_t reverse = sortcol->sc_reverse;
-
- switch (prop) {
- case ZFS_PROP_TYPE:
- propname = "type";
- (void) nvlist_lookup_uint32(lnvl, propname, &lv32);
- (void) nvlist_lookup_uint32(rnvl, propname, &rv32);
- if (rv32 != lv32)
- rc = (rv32 > lv32) ? 1 : -1;
- break;
- case ZFS_PROP_NAME:
- propname = "name";
- if (num_name) {
- (void) nvlist_lookup_uint32(lnvl, propname,
- &lv32);
- (void) nvlist_lookup_uint32(rnvl, propname,
- &rv32);
- if (rv32 != lv32)
- rc = (rv32 > lv32) ? 1 : -1;
- } else {
- (void) nvlist_lookup_string(lnvl, propname,
- &lvstr);
- (void) nvlist_lookup_string(rnvl, propname,
- &rvstr);
- rc = strcmp(lvstr, rvstr);
- }
- break;
-
- case ZFS_PROP_USED:
- case ZFS_PROP_QUOTA:
- if (ZFS_PROP_USED == prop)
- propname = "used";
- else
- propname = "quota";
- (void) nvlist_lookup_uint64(lnvl, propname, &lv64);
- (void) nvlist_lookup_uint64(rnvl, propname, &rv64);
- if (rv64 != lv64)
- rc = (rv64 > lv64) ? 1 : -1;
- }
-
- if (rc)
- if (rc < 0)
- return (reverse ? 1 : -1);
- else
- return (reverse ? -1 : 1);
- }
-
- return (rc);
-}
-
-static inline const char *
-us_type2str(unsigned field_type)
-{
- switch (field_type) {
- case USTYPE_PSX_USR:
- return ("POSIX User");
- case USTYPE_PSX_GRP:
- return ("POSIX Group");
- case USTYPE_SMB_USR:
- return ("SMB User");
- case USTYPE_SMB_GRP:
- return ("SMB Group");
- default:
- return ("Undefined");
- }
-}
-
/*
* zfs userspace
*/
static int
userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
{
- us_cbdata_t *cb = (us_cbdata_t *)arg;
- zfs_userquota_prop_t prop = cb->cb_prop;
+ zfs_userquota_prop_t *typep = arg;
+ zfs_userquota_prop_t p = *typep;
char *name = NULL;
- char *propname;
+ char *ug, *propname;
char namebuf[32];
char sizebuf[32];
- us_node_t *node;
- uu_avl_pool_t *avl_pool = cb->cb_avl_pool;
- uu_avl_t *avl = cb->cb_avl;
- uu_avl_index_t idx;
- nvlist_t *props;
- us_node_t *n;
- zfs_sort_column_t *sortcol = cb->cb_sortcol;
- unsigned type;
- const char *typestr;
- size_t namelen;
- size_t typelen;
- size_t sizelen;
- us_sort_info_t sortinfo = { sortcol, cb->cb_numname };
if (domain == NULL || domain[0] == '\0') {
- /* POSIX */
- if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) {
- type = USTYPE_PSX_GRP;
+ if (p == ZFS_PROP_GROUPUSED || p == ZFS_PROP_GROUPQUOTA) {
struct group *g = getgrgid(rid);
if (g)
name = g->gr_name;
} else {
- type = USTYPE_PSX_USR;
struct passwd *p = getpwuid(rid);
if (p)
name = p->pw_name;
}
- } else {
- char sid[ZFS_MAXNAMELEN+32];
- uid_t id;
- uint64_t classes;
- int err = 0;
- directory_error_t e;
-
- (void) snprintf(sid, sizeof (sid), "%s-%u", domain, rid);
- /* SMB */
- if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) {
- type = USTYPE_SMB_GRP;
- err = sid_to_id(sid, B_FALSE, &id);
- } else {
- type = USTYPE_SMB_USR;
- err = sid_to_id(sid, B_TRUE, &id);
- }
-
- if (err == 0) {
- rid = id;
-
- e = directory_name_from_sid(NULL, sid, &name, &classes);
- if (e != NULL) {
- directory_error_free(e);
- return (NULL);
- }
-
- if (name == NULL)
- name = sid;
- }
}
-/*
- * if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA)
- * ug = "group";
- * else
- * ug = "user";
- */
+ if (p == ZFS_PROP_GROUPUSED || p == ZFS_PROP_GROUPQUOTA)
+ ug = "group";
+ else
+ ug = "user";
- if (prop == ZFS_PROP_USERUSED || prop == ZFS_PROP_GROUPUSED)
+ if (p == ZFS_PROP_USERUSED || p == ZFS_PROP_GROUPUSED)
propname = "used";
else
propname = "quota";
- (void) snprintf(namebuf, sizeof (namebuf), "%u", rid);
- if (name == NULL)
+ if (name == NULL) {
+ (void) snprintf(namebuf, sizeof (namebuf),
+ "%llu", (longlong_t)rid);
name = namebuf;
-
- if (cb->cb_nicenum)
- zfs_nicenum(space, sizebuf, sizeof (sizebuf));
- else
- (void) sprintf(sizebuf, "%llu", space);
-
- node = safe_malloc(sizeof (us_node_t));
- uu_avl_node_init(node, &node->usn_avlnode, avl_pool);
-
- if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) {
- free(node);
- return (-1);
- }
-
- if (nvlist_add_uint32(props, "type", type) != 0)
- nomem();
-
- if (cb->cb_numname) {
- if (nvlist_add_uint32(props, "name", rid) != 0)
- nomem();
- namelen = strlen(namebuf);
- } else {
- if (nvlist_add_string(props, "name", name) != 0)
- nomem();
- namelen = strlen(name);
- }
-
- typestr = us_type2str(type);
- typelen = strlen(gettext(typestr));
- if (typelen > cb->cb_max_typelen)
- cb->cb_max_typelen = typelen;
-
- if (namelen > cb->cb_max_namelen)
- cb->cb_max_namelen = namelen;
-
- sizelen = strlen(sizebuf);
- if (0 == strcmp(propname, "used")) {
- if (sizelen > cb->cb_max_usedlen)
- cb->cb_max_usedlen = sizelen;
- } else {
- if (sizelen > cb->cb_max_quotalen)
- cb->cb_max_quotalen = sizelen;
}
+ zfs_nicenum(space, sizebuf, sizeof (sizebuf));
- node->usn_nvl = props;
-
- n = uu_avl_find(avl, node, &sortinfo, &idx);
- if (n == NULL)
- uu_avl_insert(avl, node, idx);
- else {
- nvlist_free(props);
- free(node);
- node = n;
- props = node->usn_nvl;
- }
-
- if (nvlist_add_uint64(props, propname, space) != 0)
- nomem();
+ (void) printf("%s %s %s%c%s %s\n", propname, ug, domain,
+ domain[0] ? '-' : ' ', name, sizebuf);
return (0);
}
-static inline boolean_t
-usprop_check(zfs_userquota_prop_t p, unsigned types, unsigned props)
-{
- unsigned type;
- unsigned prop;
-
- switch (p) {
- case ZFS_PROP_USERUSED:
- type = USTYPE_USR;
- prop = USPROP_USED;
- break;
- case ZFS_PROP_USERQUOTA:
- type = USTYPE_USR;
- prop = USPROP_QUOTA;
- break;
- case ZFS_PROP_GROUPUSED:
- type = USTYPE_GRP;
- prop = USPROP_USED;
- break;
- case ZFS_PROP_GROUPQUOTA:
- type = USTYPE_GRP;
- prop = USPROP_QUOTA;
- break;
- default: /* ALL */
- return (B_TRUE);
- };
-
- return (type & types && prop & props);
-}
-
-#define USFIELD_TYPE (1 << 0)
-#define USFIELD_NAME (1 << 1)
-#define USFIELD_USED (1 << 2)
-#define USFIELD_QUOTA (1 << 3)
-#define USFIELD_ALL (USFIELD_TYPE | USFIELD_NAME | USFIELD_USED | USFIELD_QUOTA)
-
-static int
-parsefields(unsigned *fieldsp, char **names, unsigned *bits, size_t len)
-{
- char *field = optarg;
- char *delim;
-
- do {
- int i;
- boolean_t found = B_FALSE;
- delim = strchr(field, ',');
- if (delim != NULL)
- *delim = '\0';
-
- for (i = 0; i < len; i++)
- if (0 == strcmp(field, names[i])) {
- found = B_TRUE;
- *fieldsp |= bits[i];
- break;
- }
-
- if (!found) {
- (void) fprintf(stderr, gettext("invalid type '%s'"
- "for -t option\n"), field);
- return (-1);
- }
-
- field = delim + 1;
- } while (delim);
-
- return (0);
-}
-
-
-static char *type_names[] = { "posixuser", "smbuser", "posixgroup", "smbgroup",
- "all" };
-static unsigned type_bits[] = {
- USTYPE_PSX_USR,
- USTYPE_SMB_USR,
- USTYPE_PSX_GRP,
- USTYPE_SMB_GRP,
- USTYPE_ALL
-};
-
-static char *us_field_names[] = { "type", "name", "used", "quota" };
-static unsigned us_field_bits[] = {
- USFIELD_TYPE,
- USFIELD_NAME,
- USFIELD_USED,
- USFIELD_QUOTA
-};
-
-static void
-print_us_node(boolean_t scripted, boolean_t parseable, unsigned fields,
- size_t type_width, size_t name_width, size_t used_width,
- size_t quota_width, us_node_t *node)
-{
- nvlist_t *nvl = node->usn_nvl;
- nvpair_t *nvp = NULL;
- char valstr[ZFS_MAXNAMELEN];
- boolean_t first = B_TRUE;
- boolean_t quota_found = B_FALSE;
-
- if (fields & USFIELD_QUOTA && !nvlist_exists(nvl, "quota"))
- if (nvlist_add_string(nvl, "quota", "none") != 0)
- nomem();
-
- while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
- char *pname = nvpair_name(nvp);
- data_type_t type = nvpair_type(nvp);
- uint32_t val32 = 0;
- uint64_t val64 = 0;
- char *strval = NULL;
- unsigned field = 0;
- unsigned width = 0;
- int i;
- for (i = 0; i < 4; i++) {
- if (0 == strcmp(pname, us_field_names[i])) {
- field = us_field_bits[i];
- break;
- }
- }
-
- if (!(field & fields))
- continue;
-
- switch (type) {
- case DATA_TYPE_UINT32:
- (void) nvpair_value_uint32(nvp, &val32);
- break;
- case DATA_TYPE_UINT64:
- (void) nvpair_value_uint64(nvp, &val64);
- break;
- case DATA_TYPE_STRING:
- (void) nvpair_value_string(nvp, &strval);
- break;
- default:
- (void) fprintf(stderr, "Invalid data type\n");
- }
-
- if (!first)
- if (scripted)
- (void) printf("\t");
- else
- (void) printf(" ");
-
- switch (field) {
- case USFIELD_TYPE:
- strval = (char *)us_type2str(val32);
- width = type_width;
- break;
- case USFIELD_NAME:
- if (type == DATA_TYPE_UINT64) {
- (void) sprintf(valstr, "%llu", val64);
- strval = valstr;
- }
- width = name_width;
- break;
- case USFIELD_USED:
- case USFIELD_QUOTA:
- if (type == DATA_TYPE_UINT64) {
- (void) nvpair_value_uint64(nvp, &val64);
- if (parseable)
- (void) sprintf(valstr, "%llu", val64);
- else
- zfs_nicenum(val64, valstr,
- sizeof (valstr));
- strval = valstr;
- }
-
- if (field == USFIELD_USED)
- width = used_width;
- else {
- quota_found = B_FALSE;
- width = quota_width;
- }
-
- break;
- }
-
- if (field == USFIELD_QUOTA && !quota_found)
- (void) printf("%*s", width, strval);
- else {
- if (type == DATA_TYPE_STRING)
- (void) printf("%-*s", width, strval);
- else
- (void) printf("%*s", width, strval);
- }
-
- first = B_FALSE;
-
- }
-
- (void) printf("\n");
-}
-
-static void
-print_us(boolean_t scripted, boolean_t parsable, unsigned fields,
- unsigned type_width, unsigned name_width, unsigned used_width,
- unsigned quota_width, boolean_t rmnode, uu_avl_t *avl)
-{
- static char *us_field_hdr[] = { "TYPE", "NAME", "USED", "QUOTA" };
- us_node_t *node;
- const char *col;
- int i;
- size_t width[4] = { type_width, name_width, used_width, quota_width };
-
- if (!scripted) {
- boolean_t first = B_TRUE;
- for (i = 0; i < 4; i++) {
- unsigned field = us_field_bits[i];
- if (!(field & fields))
- continue;
-
- col = gettext(us_field_hdr[i]);
- if (field == USFIELD_TYPE || field == USFIELD_NAME)
- (void) printf(first?"%-*s":" %-*s", width[i],
- col);
- else
- (void) printf(first?"%*s":" %*s", width[i],
- col);
- first = B_FALSE;
- }
- (void) printf("\n");
- }
-
- for (node = uu_avl_first(avl); node != NULL;
- node = uu_avl_next(avl, node)) {
- print_us_node(scripted, parsable, fields, type_width,
- name_width, used_width, used_width, node);
- if (rmnode)
- nvlist_free(node->usn_nvl);
- }
-}
-
static int
zfs_do_userspace(int argc, char **argv)
{
zfs_handle_t *zhp;
zfs_userquota_prop_t p;
- uu_avl_pool_t *avl_pool;
- uu_avl_t *avl_tree;
- uu_avl_walk_t *walk;
-
- char *cmd;
- boolean_t scripted = B_FALSE;
- boolean_t prtnum = B_FALSE;
- boolean_t parseable = B_FALSE;
- boolean_t sid2posix = B_FALSE;
- int error = 0;
- int c;
- zfs_sort_column_t *default_sortcol = NULL;
- zfs_sort_column_t *sortcol = NULL;
- unsigned types = USTYPE_PSX_USR | USTYPE_SMB_USR;
- unsigned fields = 0;
- unsigned props = USPROP_USED | USPROP_QUOTA;
- us_cbdata_t cb;
- us_node_t *node;
- boolean_t resort_avl = B_FALSE;
-
- if (argc < 2)
- usage(B_FALSE);
-
- cmd = argv[0];
- if (0 == strcmp(cmd, "groupspace"))
- /* toggle default group types */
- types = USTYPE_PSX_GRP | USTYPE_SMB_GRP;
-
- /* check options */
- while ((c = getopt(argc, argv, "nHpo:s:S:t:i")) != -1) {
- switch (c) {
- case 'n':
- prtnum = B_TRUE;
- break;
- case 'H':
- scripted = B_TRUE;
- break;
- case 'p':
- parseable = B_TRUE;
- break;
- case 'o':
- if (parsefields(&fields, us_field_names, us_field_bits,
- 4) != 0)
- return (1);
- break;
- case 's':
- if (zfs_add_sort_column(&sortcol, optarg,
- B_FALSE) != 0) {
- (void) fprintf(stderr,
- gettext("invalid property '%s'\n"), optarg);
- usage(B_FALSE);
- }
- break;
- case 'S':
- if (zfs_add_sort_column(&sortcol, optarg,
- B_TRUE) != 0) {
- (void) fprintf(stderr,
- gettext("invalid property '%s'\n"), optarg);
- usage(B_FALSE);
- }
- break;
- case 't':
- if (parsefields(&types, type_names, type_bits, 5))
- return (1);
- break;
- case 'i':
- sid2posix = B_TRUE;
- break;
- case ':':
- (void) fprintf(stderr, gettext("missing argument for "
- "'%c' option\n"), optopt);
- usage(B_FALSE);
- break;
- case '?':
- (void) fprintf(stderr, gettext("invalid option '%c'\n"),
- optopt);
- usage(B_FALSE);
- }
- }
-
- argc -= optind;
- argv += optind;
+ int error;
- /* ok, now we have sorted by default colums (type,name) avl tree */
- if (sortcol) {
- zfs_sort_column_t *sc;
- for (sc = sortcol; sc; sc = sc->sc_next) {
- if (sc->sc_prop == ZFS_PROP_QUOTA) {
- resort_avl = B_TRUE;
- break;
- }
- }
- }
+ /*
+ * Try the python version. If the execv fails, we'll continue
+ * and do a simplistic implementation.
+ */
+ (void) execv(pypath, argv-1);
- if (!fields)
- fields = USFIELD_ALL;
+ (void) printf("internal error: %s not found\n"
+ "falling back on built-in implementation, "
+ "some features will not work\n", pypath);
if ((zhp = zfs_open(g_zfs, argv[argc-1], ZFS_TYPE_DATASET)) == NULL)
return (1);
- if ((avl_pool = uu_avl_pool_create("us_avl_pool", sizeof (us_node_t),
- offsetof(us_node_t, usn_avlnode),
- us_compare, UU_DEFAULT)) == NULL)
- nomem();
- if ((avl_tree = uu_avl_create(avl_pool, NULL, UU_DEFAULT)) == NULL)
- nomem();
-
- if (sortcol && !resort_avl)
- cb.cb_sortcol = sortcol;
- else {
- (void) zfs_add_sort_column(&default_sortcol, "type", B_FALSE);
- (void) zfs_add_sort_column(&default_sortcol, "name", B_FALSE);
- cb.cb_sortcol = default_sortcol;
- }
- cb.cb_numname = prtnum;
- cb.cb_nicenum = !parseable;
- cb.cb_avl_pool = avl_pool;
- cb.cb_avl = avl_tree;
- cb.cb_sid2posix = sid2posix;
- cb.cb_max_typelen = strlen(gettext("TYPE"));
- cb.cb_max_namelen = strlen(gettext("NAME"));
- cb.cb_max_usedlen = strlen(gettext("USED"));
- cb.cb_max_quotalen = strlen(gettext("QUOTA"));
+ (void) printf("PROP TYPE NAME VALUE\n");
for (p = 0; p < ZFS_NUM_USERQUOTA_PROPS; p++) {
- if (!usprop_check(p, types, props))
- continue;
-
- cb.cb_prop = p;
- error = zfs_userspace(zhp, p, userspace_cb, &cb);
+ error = zfs_userspace(zhp, p, userspace_cb, &p);
if (error)
break;
}
-
-
- if (resort_avl) {
- us_node_t *node;
- us_node_t *rmnode;
- uu_list_pool_t *listpool;
- uu_list_t *list;
- uu_avl_index_t idx = 0;
- uu_list_index_t idx2 = 0;
- listpool = uu_list_pool_create("tmplist", sizeof (us_node_t),
- offsetof(us_node_t, usn_listnode), NULL,
- UU_DEFAULT);
- list = uu_list_create(listpool, NULL, UU_DEFAULT);
-
- node = uu_avl_first(avl_tree);
- uu_list_node_init(node, &node->usn_listnode, listpool);
- while (node != NULL) {
- rmnode = node;
- node = uu_avl_next(avl_tree, node);
- uu_avl_remove(avl_tree, rmnode);
- if (uu_list_find(list, rmnode, NULL, &idx2) == NULL) {
- uu_list_insert(list, rmnode, idx2);
- }
- }
-
- for (node = uu_list_first(list); node != NULL;
- node = uu_list_next(list, node)) {
- us_sort_info_t sortinfo = { sortcol, cb.cb_numname };
- if (uu_avl_find(avl_tree, node, &sortinfo, &idx) ==
- NULL)
- uu_avl_insert(avl_tree, node, idx);
- }
-
- uu_list_destroy(list);
- }
-
- /* print & free node`s nvlist memory */
- print_us(scripted, parseable, fields, cb.cb_max_typelen,
- cb.cb_max_namelen, cb.cb_max_usedlen,
- cb.cb_max_quotalen, B_TRUE, cb.cb_avl);
-
- if (sortcol)
- zfs_free_sort_columns(sortcol);
- zfs_free_sort_columns(default_sortcol);
-
- /*
- * Finally, clean up the AVL tree.
- */
- if ((walk = uu_avl_walk_start(cb.cb_avl, UU_WALK_ROBUST)) == NULL)
- nomem();
-
- while ((node = uu_avl_walk_next(walk)) != NULL) {
- uu_avl_remove(cb.cb_avl, node);
- free(node);
- }
-
- uu_avl_walk_end(walk);
- uu_avl_destroy(avl_tree);
- uu_avl_pool_destroy(avl_pool);
-
return (error);
}
@@ -2868,13 +2005,6 @@ print_dataset(zfs_handle_t *zhp, zprop_list_t *pl, boolean_t scripted)
else
propstr = property;
right_justify = B_TRUE;
- } else if (zfs_prop_written(pl->pl_user_prop)) {
- if (zfs_prop_get_written(zhp, pl->pl_user_prop,
- property, sizeof (property), B_FALSE) != 0)
- propstr = "-";
- else
- propstr = property;
- right_justify = B_TRUE;
} else {
if (nvlist_lookup_nvlist(userprops,
pl->pl_user_prop, &propval) != 0)
@@ -2935,7 +2065,7 @@ zfs_do_list(int argc, char **argv)
list_cbdata_t cb = { 0 };
char *value;
int limit = 0;
- int ret = 0;
+ int ret;
zfs_sort_column_t *sortcol = NULL;
int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS;
@@ -3050,8 +2180,8 @@ zfs_do_list(int argc, char **argv)
}
/*
- * zfs rename [-f] <fs | snap | vol> <fs | snap | vol>
- * zfs rename [-f] -p <fs | vol> <fs | vol>
+ * zfs rename <fs | snap | vol> <fs | snap | vol>
+ * zfs rename -p <fs | vol> <fs | vol>
* zfs rename -r <snap> <snap>
*
* Renames the given dataset to another of the same type.
@@ -3064,13 +2194,12 @@ zfs_do_rename(int argc, char **argv)
{
zfs_handle_t *zhp;
int c;
- int ret = 0;
+ int ret;
boolean_t recurse = B_FALSE;
boolean_t parents = B_FALSE;
- boolean_t force_unmount = B_FALSE;
/* check options */
- while ((c = getopt(argc, argv, "prf")) != -1) {
+ while ((c = getopt(argc, argv, "pr")) != -1) {
switch (c) {
case 'p':
parents = B_TRUE;
@@ -3078,9 +2207,6 @@ zfs_do_rename(int argc, char **argv)
case 'r':
recurse = B_TRUE;
break;
- case 'f':
- force_unmount = B_TRUE;
- break;
case '?':
default:
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
@@ -3131,7 +2257,7 @@ zfs_do_rename(int argc, char **argv)
return (1);
}
- ret = (zfs_rename(zhp, argv[1], recurse, force_unmount) != 0);
+ ret = (zfs_rename(zhp, argv[1], recurse) != 0);
zfs_close(zhp);
return (ret);
@@ -3147,7 +2273,7 @@ static int
zfs_do_promote(int argc, char **argv)
{
zfs_handle_t *zhp;
- int ret = 0;
+ int ret;
/* check options */
if (argc > 1 && argv[1][0] == '-') {
@@ -3268,7 +2394,7 @@ rollback_check(zfs_handle_t *zhp, void *data)
static int
zfs_do_rollback(int argc, char **argv)
{
- int ret = 0;
+ int ret;
int c;
boolean_t force = B_FALSE;
rollback_cbdata_t cb = { 0 };
@@ -3386,7 +2512,7 @@ static int
zfs_do_set(int argc, char **argv)
{
set_cbdata_t cb;
- int ret = 0;
+ int ret;
/* check for options */
if (argc > 1 && argv[1][0] == '-') {
@@ -3430,32 +2556,6 @@ zfs_do_set(int argc, char **argv)
return (ret);
}
-typedef struct snap_cbdata {
- nvlist_t *sd_nvl;
- boolean_t sd_recursive;
- const char *sd_snapname;
-} snap_cbdata_t;
-
-static int
-zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
-{
- snap_cbdata_t *sd = arg;
- char *name;
- int rv = 0;
- int error;
-
- error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname);
- if (error == -1)
- nomem();
- fnvlist_add_boolean(sd->sd_nvl, name);
- free(name);
-
- if (sd->sd_recursive)
- rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd);
- zfs_close(zhp);
- return (rv);
-}
-
/*
* zfs snapshot [-r] [-o prop=value] ... <fs@snap>
*
@@ -3465,16 +2565,13 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
static int
zfs_do_snapshot(int argc, char **argv)
{
- int ret = 0;
+ boolean_t recursive = B_FALSE;
+ int ret;
char c;
nvlist_t *props;
- snap_cbdata_t sd = { 0 };
- boolean_t multiple_snaps = B_FALSE;
if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
nomem();
- if (nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) != 0)
- nomem();
/* check options */
while ((c = getopt(argc, argv, "ro:")) != -1) {
@@ -3484,8 +2581,7 @@ zfs_do_snapshot(int argc, char **argv)
return (1);
break;
case 'r':
- sd.sd_recursive = B_TRUE;
- multiple_snaps = B_TRUE;
+ recursive = B_TRUE;
break;
case '?':
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
@@ -3502,41 +2598,27 @@ zfs_do_snapshot(int argc, char **argv)
(void) fprintf(stderr, gettext("missing snapshot argument\n"));
goto usage;
}
-
- if (argc > 1)
- multiple_snaps = B_TRUE;
- for (; argc > 0; argc--, argv++) {
- char *atp;
- zfs_handle_t *zhp;
-
- atp = strchr(argv[0], '@');
- if (atp == NULL)
- goto usage;
- *atp = '\0';
- sd.sd_snapname = atp + 1;
- zhp = zfs_open(g_zfs, argv[0],
- ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
- if (zhp == NULL)
- goto usage;
- if (zfs_snapshot_cb(zhp, &sd) != 0)
- goto usage;
+ if (argc > 1) {
+ (void) fprintf(stderr, gettext("too many arguments\n"));
+ goto usage;
}
- ret = zfs_snapshot_nvl(g_zfs, sd.sd_nvl, props);
- nvlist_free(sd.sd_nvl);
+ ret = zfs_snapshot(g_zfs, argv[0], recursive, props);
nvlist_free(props);
- if (ret != 0 && multiple_snaps)
+ if (ret && recursive)
(void) fprintf(stderr, gettext("no snapshots were created\n"));
return (ret != 0);
usage:
- nvlist_free(sd.sd_nvl);
nvlist_free(props);
usage(B_FALSE);
return (-1);
}
/*
+ * zfs send [-vDp] -R [-i|-I <@snap>] <fs@snap>
+ * zfs send [-vDp] [-i|-I <@snap>] <fs@snap>
+ *
* Send a backup stream to stdout.
*/
static int
@@ -3548,11 +2630,11 @@ zfs_do_send(int argc, char **argv)
zfs_handle_t *zhp;
sendflags_t flags = { 0 };
int c, err;
- nvlist_t *dbgnv = NULL;
+ nvlist_t *dbgnv;
boolean_t extraverbose = B_FALSE;
/* check options */
- while ((c = getopt(argc, argv, ":i:I:RDpvnP")) != -1) {
+ while ((c = getopt(argc, argv, ":i:I:RDpv")) != -1) {
switch (c) {
case 'i':
if (fromname)
@@ -3571,22 +2653,14 @@ zfs_do_send(int argc, char **argv)
case 'p':
flags.props = B_TRUE;
break;
- case 'P':
- flags.parsable = B_TRUE;
- flags.verbose = B_TRUE;
- break;
case 'v':
if (flags.verbose)
extraverbose = B_TRUE;
flags.verbose = B_TRUE;
- flags.progress = B_TRUE;
break;
case 'D':
flags.dedup = B_TRUE;
break;
- case 'n':
- flags.dryrun = B_TRUE;
- break;
case ':':
(void) fprintf(stderr, gettext("missing argument for "
"'%c' option\n"), optopt);
@@ -3612,7 +2686,7 @@ zfs_do_send(int argc, char **argv)
usage(B_FALSE);
}
- if (!flags.dryrun && isatty(STDOUT_FILENO)) {
+ if (isatty(STDOUT_FILENO)) {
(void) fprintf(stderr,
gettext("Error: Stream can not be written to a terminal.\n"
"You must redirect standard output.\n"));
@@ -3666,10 +2740,10 @@ zfs_do_send(int argc, char **argv)
if (flags.replicate && fromname == NULL)
flags.doall = B_TRUE;
- err = zfs_send(zhp, fromname, toname, &flags, STDOUT_FILENO, NULL, 0,
+ err = zfs_send(zhp, fromname, toname, flags, STDOUT_FILENO, NULL, 0,
extraverbose ? &dbgnv : NULL);
- if (extraverbose && dbgnv != NULL) {
+ if (extraverbose) {
/*
* dump_nvlist prints to stdout, but that's been
* redirected to a file. Make it print to stderr
@@ -3750,1357 +2824,11 @@ zfs_do_receive(int argc, char **argv)
return (1);
}
- err = zfs_receive(g_zfs, argv[0], &flags, STDIN_FILENO, NULL);
+ err = zfs_receive(g_zfs, argv[0], flags, STDIN_FILENO, NULL);
return (err != 0);
}
-/*
- * allow/unallow stuff
- */
-/* copied from zfs/sys/dsl_deleg.h */
-#define ZFS_DELEG_PERM_CREATE "create"
-#define ZFS_DELEG_PERM_DESTROY "destroy"
-#define ZFS_DELEG_PERM_SNAPSHOT "snapshot"
-#define ZFS_DELEG_PERM_ROLLBACK "rollback"
-#define ZFS_DELEG_PERM_CLONE "clone"
-#define ZFS_DELEG_PERM_PROMOTE "promote"
-#define ZFS_DELEG_PERM_RENAME "rename"
-#define ZFS_DELEG_PERM_MOUNT "mount"
-#define ZFS_DELEG_PERM_SHARE "share"
-#define ZFS_DELEG_PERM_SEND "send"
-#define ZFS_DELEG_PERM_RECEIVE "receive"
-#define ZFS_DELEG_PERM_ALLOW "allow"
-#define ZFS_DELEG_PERM_USERPROP "userprop"
-#define ZFS_DELEG_PERM_VSCAN "vscan" /* ??? */
-#define ZFS_DELEG_PERM_USERQUOTA "userquota"
-#define ZFS_DELEG_PERM_GROUPQUOTA "groupquota"
-#define ZFS_DELEG_PERM_USERUSED "userused"
-#define ZFS_DELEG_PERM_GROUPUSED "groupused"
-#define ZFS_DELEG_PERM_HOLD "hold"
-#define ZFS_DELEG_PERM_RELEASE "release"
-#define ZFS_DELEG_PERM_DIFF "diff"
-
-#define ZFS_NUM_DELEG_NOTES ZFS_DELEG_NOTE_NONE
-
-static zfs_deleg_perm_tab_t zfs_deleg_perm_tbl[] = {
- { ZFS_DELEG_PERM_ALLOW, ZFS_DELEG_NOTE_ALLOW },
- { ZFS_DELEG_PERM_CLONE, ZFS_DELEG_NOTE_CLONE },
- { ZFS_DELEG_PERM_CREATE, ZFS_DELEG_NOTE_CREATE },
- { ZFS_DELEG_PERM_DESTROY, ZFS_DELEG_NOTE_DESTROY },
- { ZFS_DELEG_PERM_DIFF, ZFS_DELEG_NOTE_DIFF},
- { ZFS_DELEG_PERM_HOLD, ZFS_DELEG_NOTE_HOLD },
- { ZFS_DELEG_PERM_MOUNT, ZFS_DELEG_NOTE_MOUNT },
- { ZFS_DELEG_PERM_PROMOTE, ZFS_DELEG_NOTE_PROMOTE },
- { ZFS_DELEG_PERM_RECEIVE, ZFS_DELEG_NOTE_RECEIVE },
- { ZFS_DELEG_PERM_RELEASE, ZFS_DELEG_NOTE_RELEASE },
- { ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
- { ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
- { ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
- { ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE },
- { ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
-
- { ZFS_DELEG_PERM_GROUPQUOTA, ZFS_DELEG_NOTE_GROUPQUOTA },
- { ZFS_DELEG_PERM_GROUPUSED, ZFS_DELEG_NOTE_GROUPUSED },
- { ZFS_DELEG_PERM_USERPROP, ZFS_DELEG_NOTE_USERPROP },
- { ZFS_DELEG_PERM_USERQUOTA, ZFS_DELEG_NOTE_USERQUOTA },
- { ZFS_DELEG_PERM_USERUSED, ZFS_DELEG_NOTE_USERUSED },
- { NULL, ZFS_DELEG_NOTE_NONE }
-};
-
-/* permission structure */
-typedef struct deleg_perm {
- zfs_deleg_who_type_t dp_who_type;
- const char *dp_name;
- boolean_t dp_local;
- boolean_t dp_descend;
-} deleg_perm_t;
-
-/* */
-typedef struct deleg_perm_node {
- deleg_perm_t dpn_perm;
-
- uu_avl_node_t dpn_avl_node;
-} deleg_perm_node_t;
-
-typedef struct fs_perm fs_perm_t;
-
-/* permissions set */
-typedef struct who_perm {
- zfs_deleg_who_type_t who_type;
- const char *who_name; /* id */
- char who_ug_name[256]; /* user/group name */
- fs_perm_t *who_fsperm; /* uplink */
-
- uu_avl_t *who_deleg_perm_avl; /* permissions */
-} who_perm_t;
-
-/* */
-typedef struct who_perm_node {
- who_perm_t who_perm;
- uu_avl_node_t who_avl_node;
-} who_perm_node_t;
-
-typedef struct fs_perm_set fs_perm_set_t;
-/* fs permissions */
-struct fs_perm {
- const char *fsp_name;
-
- uu_avl_t *fsp_sc_avl; /* sets,create */
- uu_avl_t *fsp_uge_avl; /* user,group,everyone */
-
- fs_perm_set_t *fsp_set; /* uplink */
-};
-
-/* */
-typedef struct fs_perm_node {
- fs_perm_t fspn_fsperm;
- uu_avl_t *fspn_avl;
-
- uu_list_node_t fspn_list_node;
-} fs_perm_node_t;
-
-/* top level structure */
-struct fs_perm_set {
- uu_list_pool_t *fsps_list_pool;
- uu_list_t *fsps_list; /* list of fs_perms */
-
- uu_avl_pool_t *fsps_named_set_avl_pool;
- uu_avl_pool_t *fsps_who_perm_avl_pool;
- uu_avl_pool_t *fsps_deleg_perm_avl_pool;
-};
-
-static inline const char *
-deleg_perm_type(zfs_deleg_note_t note)
-{
- /* subcommands */
- switch (note) {
- /* SUBCOMMANDS */
- /* OTHER */
- case ZFS_DELEG_NOTE_GROUPQUOTA:
- case ZFS_DELEG_NOTE_GROUPUSED:
- case ZFS_DELEG_NOTE_USERPROP:
- case ZFS_DELEG_NOTE_USERQUOTA:
- case ZFS_DELEG_NOTE_USERUSED:
- /* other */
- return (gettext("other"));
- default:
- return (gettext("subcommand"));
- }
-}
-
-static int inline
-who_type2weight(zfs_deleg_who_type_t who_type)
-{
- int res;
- switch (who_type) {
- case ZFS_DELEG_NAMED_SET_SETS:
- case ZFS_DELEG_NAMED_SET:
- res = 0;
- break;
- case ZFS_DELEG_CREATE_SETS:
- case ZFS_DELEG_CREATE:
- res = 1;
- break;
- case ZFS_DELEG_USER_SETS:
- case ZFS_DELEG_USER:
- res = 2;
- break;
- case ZFS_DELEG_GROUP_SETS:
- case ZFS_DELEG_GROUP:
- res = 3;
- break;
- case ZFS_DELEG_EVERYONE_SETS:
- case ZFS_DELEG_EVERYONE:
- res = 4;
- break;
- default:
- res = -1;
- }
-
- return (res);
-}
-
-/* ARGSUSED */
-static int
-who_perm_compare(const void *larg, const void *rarg, void *unused)
-{
- const who_perm_node_t *l = larg;
- const who_perm_node_t *r = rarg;
- zfs_deleg_who_type_t ltype = l->who_perm.who_type;
- zfs_deleg_who_type_t rtype = r->who_perm.who_type;
- int lweight = who_type2weight(ltype);
- int rweight = who_type2weight(rtype);
- int res = lweight - rweight;
- if (res == 0)
- res = strncmp(l->who_perm.who_name, r->who_perm.who_name,
- ZFS_MAX_DELEG_NAME-1);
-
- if (res == 0)
- return (0);
- if (res > 0)
- return (1);
- else
- return (-1);
-}
-
-/* ARGSUSED */
-static int
-deleg_perm_compare(const void *larg, const void *rarg, void *unused)
-{
- const deleg_perm_node_t *l = larg;
- const deleg_perm_node_t *r = rarg;
- int res = strncmp(l->dpn_perm.dp_name, r->dpn_perm.dp_name,
- ZFS_MAX_DELEG_NAME-1);
-
- if (res == 0)
- return (0);
-
- if (res > 0)
- return (1);
- else
- return (-1);
-}
-
-static inline void
-fs_perm_set_init(fs_perm_set_t *fspset)
-{
- bzero(fspset, sizeof (fs_perm_set_t));
-
- if ((fspset->fsps_list_pool = uu_list_pool_create("fsps_list_pool",
- sizeof (fs_perm_node_t), offsetof(fs_perm_node_t, fspn_list_node),
- NULL, UU_DEFAULT)) == NULL)
- nomem();
- if ((fspset->fsps_list = uu_list_create(fspset->fsps_list_pool, NULL,
- UU_DEFAULT)) == NULL)
- nomem();
-
- if ((fspset->fsps_named_set_avl_pool = uu_avl_pool_create(
- "named_set_avl_pool", sizeof (who_perm_node_t), offsetof(
- who_perm_node_t, who_avl_node), who_perm_compare,
- UU_DEFAULT)) == NULL)
- nomem();
-
- if ((fspset->fsps_who_perm_avl_pool = uu_avl_pool_create(
- "who_perm_avl_pool", sizeof (who_perm_node_t), offsetof(
- who_perm_node_t, who_avl_node), who_perm_compare,
- UU_DEFAULT)) == NULL)
- nomem();
-
- if ((fspset->fsps_deleg_perm_avl_pool = uu_avl_pool_create(
- "deleg_perm_avl_pool", sizeof (deleg_perm_node_t), offsetof(
- deleg_perm_node_t, dpn_avl_node), deleg_perm_compare, UU_DEFAULT))
- == NULL)
- nomem();
-}
-
-static inline void fs_perm_fini(fs_perm_t *);
-static inline void who_perm_fini(who_perm_t *);
-
-static inline void
-fs_perm_set_fini(fs_perm_set_t *fspset)
-{
- fs_perm_node_t *node = uu_list_first(fspset->fsps_list);
-
- while (node != NULL) {
- fs_perm_node_t *next_node =
- uu_list_next(fspset->fsps_list, node);
- fs_perm_t *fsperm = &node->fspn_fsperm;
- fs_perm_fini(fsperm);
- uu_list_remove(fspset->fsps_list, node);
- free(node);
- node = next_node;
- }
-
- uu_avl_pool_destroy(fspset->fsps_named_set_avl_pool);
- uu_avl_pool_destroy(fspset->fsps_who_perm_avl_pool);
- uu_avl_pool_destroy(fspset->fsps_deleg_perm_avl_pool);
-}
-
-static inline void
-deleg_perm_init(deleg_perm_t *deleg_perm, zfs_deleg_who_type_t type,
- const char *name)
-{
- deleg_perm->dp_who_type = type;
- deleg_perm->dp_name = name;
-}
-
-static inline void
-who_perm_init(who_perm_t *who_perm, fs_perm_t *fsperm,
- zfs_deleg_who_type_t type, const char *name)
-{
- uu_avl_pool_t *pool;
- pool = fsperm->fsp_set->fsps_deleg_perm_avl_pool;
-
- bzero(who_perm, sizeof (who_perm_t));
-
- if ((who_perm->who_deleg_perm_avl = uu_avl_create(pool, NULL,
- UU_DEFAULT)) == NULL)
- nomem();
-
- who_perm->who_type = type;
- who_perm->who_name = name;
- who_perm->who_fsperm = fsperm;
-}
-
-static inline void
-who_perm_fini(who_perm_t *who_perm)
-{
- deleg_perm_node_t *node = uu_avl_first(who_perm->who_deleg_perm_avl);
-
- while (node != NULL) {
- deleg_perm_node_t *next_node =
- uu_avl_next(who_perm->who_deleg_perm_avl, node);
-
- uu_avl_remove(who_perm->who_deleg_perm_avl, node);
- free(node);
- node = next_node;
- }
-
- uu_avl_destroy(who_perm->who_deleg_perm_avl);
-}
-
-static inline void
-fs_perm_init(fs_perm_t *fsperm, fs_perm_set_t *fspset, const char *fsname)
-{
- uu_avl_pool_t *nset_pool = fspset->fsps_named_set_avl_pool;
- uu_avl_pool_t *who_pool = fspset->fsps_who_perm_avl_pool;
-
- bzero(fsperm, sizeof (fs_perm_t));
-
- if ((fsperm->fsp_sc_avl = uu_avl_create(nset_pool, NULL, UU_DEFAULT))
- == NULL)
- nomem();
-
- if ((fsperm->fsp_uge_avl = uu_avl_create(who_pool, NULL, UU_DEFAULT))
- == NULL)
- nomem();
-
- fsperm->fsp_set = fspset;
- fsperm->fsp_name = fsname;
-}
-
-static inline void
-fs_perm_fini(fs_perm_t *fsperm)
-{
- who_perm_node_t *node = uu_avl_first(fsperm->fsp_sc_avl);
- while (node != NULL) {
- who_perm_node_t *next_node = uu_avl_next(fsperm->fsp_sc_avl,
- node);
- who_perm_t *who_perm = &node->who_perm;
- who_perm_fini(who_perm);
- uu_avl_remove(fsperm->fsp_sc_avl, node);
- free(node);
- node = next_node;
- }
-
- node = uu_avl_first(fsperm->fsp_uge_avl);
- while (node != NULL) {
- who_perm_node_t *next_node = uu_avl_next(fsperm->fsp_uge_avl,
- node);
- who_perm_t *who_perm = &node->who_perm;
- who_perm_fini(who_perm);
- uu_avl_remove(fsperm->fsp_uge_avl, node);
- free(node);
- node = next_node;
- }
-
- uu_avl_destroy(fsperm->fsp_sc_avl);
- uu_avl_destroy(fsperm->fsp_uge_avl);
-}
-
-static void inline
-set_deleg_perm_node(uu_avl_t *avl, deleg_perm_node_t *node,
- zfs_deleg_who_type_t who_type, const char *name, char locality)
-{
- uu_avl_index_t idx = 0;
-
- deleg_perm_node_t *found_node = NULL;
- deleg_perm_t *deleg_perm = &node->dpn_perm;
-
- deleg_perm_init(deleg_perm, who_type, name);
-
- if ((found_node = uu_avl_find(avl, node, NULL, &idx))
- == NULL)
- uu_avl_insert(avl, node, idx);
- else {
- node = found_node;
- deleg_perm = &node->dpn_perm;
- }
-
-
- switch (locality) {
- case ZFS_DELEG_LOCAL:
- deleg_perm->dp_local = B_TRUE;
- break;
- case ZFS_DELEG_DESCENDENT:
- deleg_perm->dp_descend = B_TRUE;
- break;
- case ZFS_DELEG_NA:
- break;
- default:
- assert(B_FALSE); /* invalid locality */
- }
-}
-
-static inline int
-parse_who_perm(who_perm_t *who_perm, nvlist_t *nvl, char locality)
-{
- nvpair_t *nvp = NULL;
- fs_perm_set_t *fspset = who_perm->who_fsperm->fsp_set;
- uu_avl_t *avl = who_perm->who_deleg_perm_avl;
- zfs_deleg_who_type_t who_type = who_perm->who_type;
-
- while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
- const char *name = nvpair_name(nvp);
- data_type_t type = nvpair_type(nvp);
- uu_avl_pool_t *avl_pool = fspset->fsps_deleg_perm_avl_pool;
- deleg_perm_node_t *node =
- safe_malloc(sizeof (deleg_perm_node_t));
-
- assert(type == DATA_TYPE_BOOLEAN);
-
- uu_avl_node_init(node, &node->dpn_avl_node, avl_pool);
- set_deleg_perm_node(avl, node, who_type, name, locality);
- }
-
- return (0);
-}
-
-static inline int
-parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl)
-{
- nvpair_t *nvp = NULL;
- fs_perm_set_t *fspset = fsperm->fsp_set;
-
- while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
- nvlist_t *nvl2 = NULL;
- const char *name = nvpair_name(nvp);
- uu_avl_t *avl = NULL;
- uu_avl_pool_t *avl_pool;
- zfs_deleg_who_type_t perm_type = name[0];
- char perm_locality = name[1];
- const char *perm_name = name + 3;
- boolean_t is_set = B_TRUE;
- who_perm_t *who_perm = NULL;
-
- assert('$' == name[2]);
-
- if (nvpair_value_nvlist(nvp, &nvl2) != 0)
- return (-1);
-
- switch (perm_type) {
- case ZFS_DELEG_CREATE:
- case ZFS_DELEG_CREATE_SETS:
- case ZFS_DELEG_NAMED_SET:
- case ZFS_DELEG_NAMED_SET_SETS:
- avl_pool = fspset->fsps_named_set_avl_pool;
- avl = fsperm->fsp_sc_avl;
- break;
- case ZFS_DELEG_USER:
- case ZFS_DELEG_USER_SETS:
- case ZFS_DELEG_GROUP:
- case ZFS_DELEG_GROUP_SETS:
- case ZFS_DELEG_EVERYONE:
- case ZFS_DELEG_EVERYONE_SETS:
- avl_pool = fspset->fsps_who_perm_avl_pool;
- avl = fsperm->fsp_uge_avl;
- break;
- }
-
- if (is_set) {
- who_perm_node_t *found_node = NULL;
- who_perm_node_t *node = safe_malloc(
- sizeof (who_perm_node_t));
- who_perm = &node->who_perm;
- uu_avl_index_t idx = 0;
-
- uu_avl_node_init(node, &node->who_avl_node, avl_pool);
- who_perm_init(who_perm, fsperm, perm_type, perm_name);
-
- if ((found_node = uu_avl_find(avl, node, NULL, &idx))
- == NULL) {
- if (avl == fsperm->fsp_uge_avl) {
- uid_t rid = 0;
- struct passwd *p = NULL;
- struct group *g = NULL;
- const char *nice_name = NULL;
-
- switch (perm_type) {
- case ZFS_DELEG_USER_SETS:
- case ZFS_DELEG_USER:
- rid = atoi(perm_name);
- p = getpwuid(rid);
- if (p)
- nice_name = p->pw_name;
- break;
- case ZFS_DELEG_GROUP_SETS:
- case ZFS_DELEG_GROUP:
- rid = atoi(perm_name);
- g = getgrgid(rid);
- if (g)
- nice_name = g->gr_name;
- break;
- }
-
- if (nice_name != NULL)
- (void) strlcpy(
- node->who_perm.who_ug_name,
- nice_name, 256);
- }
-
- uu_avl_insert(avl, node, idx);
- } else {
- node = found_node;
- who_perm = &node->who_perm;
- }
- }
-
- (void) parse_who_perm(who_perm, nvl2, perm_locality);
- }
-
- return (0);
-}
-
-static inline int
-parse_fs_perm_set(fs_perm_set_t *fspset, nvlist_t *nvl)
-{
- nvpair_t *nvp = NULL;
- uu_avl_index_t idx = 0;
-
- while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
- nvlist_t *nvl2 = NULL;
- const char *fsname = nvpair_name(nvp);
- data_type_t type = nvpair_type(nvp);
- fs_perm_t *fsperm = NULL;
- fs_perm_node_t *node = safe_malloc(sizeof (fs_perm_node_t));
- if (node == NULL)
- nomem();
-
- fsperm = &node->fspn_fsperm;
-
- assert(DATA_TYPE_NVLIST == type);
-
- uu_list_node_init(node, &node->fspn_list_node,
- fspset->fsps_list_pool);
-
- idx = uu_list_numnodes(fspset->fsps_list);
- fs_perm_init(fsperm, fspset, fsname);
-
- if (nvpair_value_nvlist(nvp, &nvl2) != 0)
- return (-1);
-
- (void) parse_fs_perm(fsperm, nvl2);
-
- uu_list_insert(fspset->fsps_list, node, idx);
- }
-
- return (0);
-}
-
-static inline const char *
-deleg_perm_comment(zfs_deleg_note_t note)
-{
- const char *str = "";
-
- /* subcommands */
- switch (note) {
- /* SUBCOMMANDS */
- case ZFS_DELEG_NOTE_ALLOW:
- str = gettext("Must also have the permission that is being"
- "\n\t\t\t\tallowed");
- break;
- case ZFS_DELEG_NOTE_CLONE:
- str = gettext("Must also have the 'create' ability and 'mount'"
- "\n\t\t\t\tability in the origin file system");
- break;
- case ZFS_DELEG_NOTE_CREATE:
- str = gettext("Must also have the 'mount' ability");
- break;
- case ZFS_DELEG_NOTE_DESTROY:
- str = gettext("Must also have the 'mount' ability");
- break;
- case ZFS_DELEG_NOTE_DIFF:
- str = gettext("Allows lookup of paths within a dataset;"
- "\n\t\t\t\tgiven an object number. Ordinary users need this"
- "\n\t\t\t\tin order to use zfs diff");
- break;
- case ZFS_DELEG_NOTE_HOLD:
- str = gettext("Allows adding a user hold to a snapshot");
- break;
- case ZFS_DELEG_NOTE_MOUNT:
- str = gettext("Allows mount/umount of ZFS datasets");
- break;
- case ZFS_DELEG_NOTE_PROMOTE:
- str = gettext("Must also have the 'mount'\n\t\t\t\tand"
- " 'promote' ability in the origin file system");
- break;
- case ZFS_DELEG_NOTE_RECEIVE:
- str = gettext("Must also have the 'mount' and 'create'"
- " ability");
- break;
- case ZFS_DELEG_NOTE_RELEASE:
- str = gettext("Allows releasing a user hold which\n\t\t\t\t"
- "might destroy the snapshot");
- break;
- case ZFS_DELEG_NOTE_RENAME:
- str = gettext("Must also have the 'mount' and 'create'"
- "\n\t\t\t\tability in the new parent");
- break;
- case ZFS_DELEG_NOTE_ROLLBACK:
- str = gettext("");
- break;
- case ZFS_DELEG_NOTE_SEND:
- str = gettext("");
- break;
- case ZFS_DELEG_NOTE_SHARE:
- str = gettext("Allows sharing file systems over NFS or SMB"
- "\n\t\t\t\tprotocols");
- break;
- case ZFS_DELEG_NOTE_SNAPSHOT:
- str = gettext("");
- break;
-/*
- * case ZFS_DELEG_NOTE_VSCAN:
- * str = gettext("");
- * break;
- */
- /* OTHER */
- case ZFS_DELEG_NOTE_GROUPQUOTA:
- str = gettext("Allows accessing any groupquota@... property");
- break;
- case ZFS_DELEG_NOTE_GROUPUSED:
- str = gettext("Allows reading any groupused@... property");
- break;
- case ZFS_DELEG_NOTE_USERPROP:
- str = gettext("Allows changing any user property");
- break;
- case ZFS_DELEG_NOTE_USERQUOTA:
- str = gettext("Allows accessing any userquota@... property");
- break;
- case ZFS_DELEG_NOTE_USERUSED:
- str = gettext("Allows reading any userused@... property");
- break;
- /* other */
- default:
- str = "";
- }
-
- return (str);
-}
-
-struct allow_opts {
- boolean_t local;
- boolean_t descend;
- boolean_t user;
- boolean_t group;
- boolean_t everyone;
- boolean_t create;
- boolean_t set;
- boolean_t recursive; /* unallow only */
- boolean_t prt_usage;
-
- boolean_t prt_perms;
- char *who;
- char *perms;
- const char *dataset;
-};
-
-static inline int
-prop_cmp(const void *a, const void *b)
-{
- const char *str1 = *(const char **)a;
- const char *str2 = *(const char **)b;
- return (strcmp(str1, str2));
-}
-
-static void
-allow_usage(boolean_t un, boolean_t requested, const char *msg)
-{
- const char *opt_desc[] = {
- "-h", gettext("show this help message and exit"),
- "-l", gettext("set permission locally"),
- "-d", gettext("set permission for descents"),
- "-u", gettext("set permission for user"),
- "-g", gettext("set permission for group"),
- "-e", gettext("set permission for everyone"),
- "-c", gettext("set create time permission"),
- "-s", gettext("define permission set"),
- /* unallow only */
- "-r", gettext("remove permissions recursively"),
- };
- size_t unallow_size = sizeof (opt_desc) / sizeof (char *);
- size_t allow_size = unallow_size - 2;
- const char *props[ZFS_NUM_PROPS];
- int i;
- size_t count = 0;
- FILE *fp = requested ? stdout : stderr;
- zprop_desc_t *pdtbl = zfs_prop_get_table();
- const char *fmt = gettext("%-16s %-14s\t%s\n");
-
- (void) fprintf(fp, gettext("Usage: %s\n"), get_usage(un ? HELP_UNALLOW :
- HELP_ALLOW));
- (void) fprintf(fp, gettext("Options:\n"));
- for (int i = 0; i < (un ? unallow_size : allow_size); i++) {
- const char *opt = opt_desc[i++];
- const char *optdsc = opt_desc[i];
- (void) fprintf(fp, gettext(" %-10s %s\n"), opt, optdsc);
- }
-
- (void) fprintf(fp, gettext("\nThe following permissions are "
- "supported:\n\n"));
- (void) fprintf(fp, fmt, gettext("NAME"), gettext("TYPE"),
- gettext("NOTES"));
- for (i = 0; i < ZFS_NUM_DELEG_NOTES; i++) {
- const char *perm_name = zfs_deleg_perm_tbl[i].z_perm;
- zfs_deleg_note_t perm_note = zfs_deleg_perm_tbl[i].z_note;
- const char *perm_type = deleg_perm_type(perm_note);
- const char *perm_comment = deleg_perm_comment(perm_note);
- (void) fprintf(fp, fmt, perm_name, perm_type, perm_comment);
- }
-
- for (i = 0; i < ZFS_NUM_PROPS; i++) {
- zprop_desc_t *pd = &pdtbl[i];
- if (pd->pd_visible != B_TRUE)
- continue;
-
- if (pd->pd_attr == PROP_READONLY)
- continue;
-
- props[count++] = pd->pd_name;
- }
- props[count] = NULL;
-
- qsort(props, count, sizeof (char *), prop_cmp);
-
- for (i = 0; i < count; i++)
- (void) fprintf(fp, fmt, props[i], gettext("property"), "");
-
- if (msg != NULL)
- (void) fprintf(fp, gettext("\nzfs: error: %s"), msg);
-
- exit(requested ? 0 : 2);
-}
-
-static inline const char *
-munge_args(int argc, char **argv, boolean_t un, size_t expected_argc,
- char **permsp)
-{
- if (un && argc == expected_argc - 1)
- *permsp = NULL;
- else if (argc == expected_argc)
- *permsp = argv[argc - 2];
- else
- allow_usage(un, B_FALSE,
- gettext("wrong number of parameters\n"));
-
- return (argv[argc - 1]);
-}
-
-static void
-parse_allow_args(int argc, char **argv, boolean_t un, struct allow_opts *opts)
-{
- int uge_sum = opts->user + opts->group + opts->everyone;
- int csuge_sum = opts->create + opts->set + uge_sum;
- int ldcsuge_sum = csuge_sum + opts->local + opts->descend;
- int all_sum = un ? ldcsuge_sum + opts->recursive : ldcsuge_sum;
-
- if (uge_sum > 1)
- allow_usage(un, B_FALSE,
- gettext("-u, -g, and -e are mutually exclusive\n"));
-
- if (opts->prt_usage)
- if (argc == 0 && all_sum == 0)
- allow_usage(un, B_TRUE, NULL);
- else
- usage(B_FALSE);
-
- if (opts->set) {
- if (csuge_sum > 1)
- allow_usage(un, B_FALSE,
- gettext("invalid options combined with -s\n"));
-
- opts->dataset = munge_args(argc, argv, un, 3, &opts->perms);
- if (argv[0][0] != '@')
- allow_usage(un, B_FALSE,
- gettext("invalid set name: missing '@' prefix\n"));
- opts->who = argv[0];
- } else if (opts->create) {
- if (ldcsuge_sum > 1)
- allow_usage(un, B_FALSE,
- gettext("invalid options combined with -c\n"));
- opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
- } else if (opts->everyone) {
- if (csuge_sum > 1)
- allow_usage(un, B_FALSE,
- gettext("invalid options combined with -e\n"));
- opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
- } else if (uge_sum == 0 && argc > 0 && strcmp(argv[0], "everyone")
- == 0) {
- opts->everyone = B_TRUE;
- argc--;
- argv++;
- opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
- } else if (argc == 1 && !un) {
- opts->prt_perms = B_TRUE;
- opts->dataset = argv[argc-1];
- } else {
- opts->dataset = munge_args(argc, argv, un, 3, &opts->perms);
- opts->who = argv[0];
- }
-
- if (!opts->local && !opts->descend) {
- opts->local = B_TRUE;
- opts->descend = B_TRUE;
- }
-}
-
-static void
-store_allow_perm(zfs_deleg_who_type_t type, boolean_t local, boolean_t descend,
- const char *who, char *perms, nvlist_t *top_nvl)
-{
- int i;
- char ld[2] = { '\0', '\0' };
- char who_buf[ZFS_MAXNAMELEN+32];
- char base_type;
- char set_type;
- nvlist_t *base_nvl = NULL;
- nvlist_t *set_nvl = NULL;
- nvlist_t *nvl;
-
- if (nvlist_alloc(&base_nvl, NV_UNIQUE_NAME, 0) != 0)
- nomem();
- if (nvlist_alloc(&set_nvl, NV_UNIQUE_NAME, 0) != 0)
- nomem();
-
- switch (type) {
- case ZFS_DELEG_NAMED_SET_SETS:
- case ZFS_DELEG_NAMED_SET:
- set_type = ZFS_DELEG_NAMED_SET_SETS;
- base_type = ZFS_DELEG_NAMED_SET;
- ld[0] = ZFS_DELEG_NA;
- break;
- case ZFS_DELEG_CREATE_SETS:
- case ZFS_DELEG_CREATE:
- set_type = ZFS_DELEG_CREATE_SETS;
- base_type = ZFS_DELEG_CREATE;
- ld[0] = ZFS_DELEG_NA;
- break;
- case ZFS_DELEG_USER_SETS:
- case ZFS_DELEG_USER:
- set_type = ZFS_DELEG_USER_SETS;
- base_type = ZFS_DELEG_USER;
- if (local)
- ld[0] = ZFS_DELEG_LOCAL;
- if (descend)
- ld[1] = ZFS_DELEG_DESCENDENT;
- break;
- case ZFS_DELEG_GROUP_SETS:
- case ZFS_DELEG_GROUP:
- set_type = ZFS_DELEG_GROUP_SETS;
- base_type = ZFS_DELEG_GROUP;
- if (local)
- ld[0] = ZFS_DELEG_LOCAL;
- if (descend)
- ld[1] = ZFS_DELEG_DESCENDENT;
- break;
- case ZFS_DELEG_EVERYONE_SETS:
- case ZFS_DELEG_EVERYONE:
- set_type = ZFS_DELEG_EVERYONE_SETS;
- base_type = ZFS_DELEG_EVERYONE;
- if (local)
- ld[0] = ZFS_DELEG_LOCAL;
- if (descend)
- ld[1] = ZFS_DELEG_DESCENDENT;
- }
-
- if (perms != NULL) {
- char *curr = perms;
- char *end = curr + strlen(perms);
-
- while (curr < end) {
- char *delim = strchr(curr, ',');
- if (delim == NULL)
- delim = end;
- else
- *delim = '\0';
-
- if (curr[0] == '@')
- nvl = set_nvl;
- else
- nvl = base_nvl;
-
- (void) nvlist_add_boolean(nvl, curr);
- if (delim != end)
- *delim = ',';
- curr = delim + 1;
- }
-
- for (i = 0; i < 2; i++) {
- char locality = ld[i];
- if (locality == 0)
- continue;
-
- if (!nvlist_empty(base_nvl)) {
- if (who != NULL)
- (void) snprintf(who_buf,
- sizeof (who_buf), "%c%c$%s",
- base_type, locality, who);
- else
- (void) snprintf(who_buf,
- sizeof (who_buf), "%c%c$",
- base_type, locality);
-
- (void) nvlist_add_nvlist(top_nvl, who_buf,
- base_nvl);
- }
-
-
- if (!nvlist_empty(set_nvl)) {
- if (who != NULL)
- (void) snprintf(who_buf,
- sizeof (who_buf), "%c%c$%s",
- set_type, locality, who);
- else
- (void) snprintf(who_buf,
- sizeof (who_buf), "%c%c$",
- set_type, locality);
-
- (void) nvlist_add_nvlist(top_nvl, who_buf,
- set_nvl);
- }
- }
- } else {
- for (i = 0; i < 2; i++) {
- char locality = ld[i];
- if (locality == 0)
- continue;
-
- if (who != NULL)
- (void) snprintf(who_buf, sizeof (who_buf),
- "%c%c$%s", base_type, locality, who);
- else
- (void) snprintf(who_buf, sizeof (who_buf),
- "%c%c$", base_type, locality);
- (void) nvlist_add_boolean(top_nvl, who_buf);
-
- if (who != NULL)
- (void) snprintf(who_buf, sizeof (who_buf),
- "%c%c$%s", set_type, locality, who);
- else
- (void) snprintf(who_buf, sizeof (who_buf),
- "%c%c$", set_type, locality);
- (void) nvlist_add_boolean(top_nvl, who_buf);
- }
- }
-}
-
-static int
-construct_fsacl_list(boolean_t un, struct allow_opts *opts, nvlist_t **nvlp)
-{
- if (nvlist_alloc(nvlp, NV_UNIQUE_NAME, 0) != 0)
- nomem();
-
- if (opts->set) {
- store_allow_perm(ZFS_DELEG_NAMED_SET, opts->local,
- opts->descend, opts->who, opts->perms, *nvlp);
- } else if (opts->create) {
- store_allow_perm(ZFS_DELEG_CREATE, opts->local,
- opts->descend, NULL, opts->perms, *nvlp);
- } else if (opts->everyone) {
- store_allow_perm(ZFS_DELEG_EVERYONE, opts->local,
- opts->descend, NULL, opts->perms, *nvlp);
- } else {
- char *curr = opts->who;
- char *end = curr + strlen(curr);
-
- while (curr < end) {
- const char *who;
- zfs_deleg_who_type_t who_type;
- char *endch;
- char *delim = strchr(curr, ',');
- char errbuf[256];
- char id[64];
- struct passwd *p = NULL;
- struct group *g = NULL;
-
- uid_t rid;
- if (delim == NULL)
- delim = end;
- else
- *delim = '\0';
-
- rid = (uid_t)strtol(curr, &endch, 0);
- if (opts->user) {
- who_type = ZFS_DELEG_USER;
- if (*endch != '\0')
- p = getpwnam(curr);
- else
- p = getpwuid(rid);
-
- if (p != NULL)
- rid = p->pw_uid;
- else {
- (void) snprintf(errbuf, 256, gettext(
- "invalid user %s"), curr);
- allow_usage(un, B_TRUE, errbuf);
- }
- } else if (opts->group) {
- who_type = ZFS_DELEG_GROUP;
- if (*endch != '\0')
- g = getgrnam(curr);
- else
- g = getgrgid(rid);
-
- if (g != NULL)
- rid = g->gr_gid;
- else {
- (void) snprintf(errbuf, 256, gettext(
- "invalid group %s"), curr);
- allow_usage(un, B_TRUE, errbuf);
- }
- } else {
- if (*endch != '\0') {
- p = getpwnam(curr);
- } else {
- p = getpwuid(rid);
- }
-
- if (p == NULL)
- if (*endch != '\0') {
- g = getgrnam(curr);
- } else {
- g = getgrgid(rid);
- }
-
- if (p != NULL) {
- who_type = ZFS_DELEG_USER;
- rid = p->pw_uid;
- } else if (g != NULL) {
- who_type = ZFS_DELEG_GROUP;
- rid = g->gr_gid;
- } else {
- (void) snprintf(errbuf, 256, gettext(
- "invalid user/group %s"), curr);
- allow_usage(un, B_TRUE, errbuf);
- }
- }
-
- (void) sprintf(id, "%u", rid);
- who = id;
-
- store_allow_perm(who_type, opts->local,
- opts->descend, who, opts->perms, *nvlp);
- curr = delim + 1;
- }
- }
-
- return (0);
-}
-
-static void
-print_set_creat_perms(uu_avl_t *who_avl)
-{
- const char *sc_title[] = {
- gettext("Permission sets:\n"),
- gettext("Create time permissions:\n"),
- NULL
- };
- const char **title_ptr = sc_title;
- who_perm_node_t *who_node = NULL;
- int prev_weight = -1;
-
- for (who_node = uu_avl_first(who_avl); who_node != NULL;
- who_node = uu_avl_next(who_avl, who_node)) {
- uu_avl_t *avl = who_node->who_perm.who_deleg_perm_avl;
- zfs_deleg_who_type_t who_type = who_node->who_perm.who_type;
- const char *who_name = who_node->who_perm.who_name;
- int weight = who_type2weight(who_type);
- boolean_t first = B_TRUE;
- deleg_perm_node_t *deleg_node;
-
- if (prev_weight != weight) {
- (void) printf(*title_ptr++);
- prev_weight = weight;
- }
-
- if (who_name == NULL || strnlen(who_name, 1) == 0)
- (void) printf("\t");
- else
- (void) printf("\t%s ", who_name);
-
- for (deleg_node = uu_avl_first(avl); deleg_node != NULL;
- deleg_node = uu_avl_next(avl, deleg_node)) {
- if (first) {
- (void) printf("%s",
- deleg_node->dpn_perm.dp_name);
- first = B_FALSE;
- } else
- (void) printf(",%s",
- deleg_node->dpn_perm.dp_name);
- }
-
- (void) printf("\n");
- }
-}
-
-static void inline
-print_uge_deleg_perms(uu_avl_t *who_avl, boolean_t local, boolean_t descend,
- const char *title)
-{
- who_perm_node_t *who_node = NULL;
- boolean_t prt_title = B_TRUE;
- uu_avl_walk_t *walk;
-
- if ((walk = uu_avl_walk_start(who_avl, UU_WALK_ROBUST)) == NULL)
- nomem();
-
- while ((who_node = uu_avl_walk_next(walk)) != NULL) {
- const char *who_name = who_node->who_perm.who_name;
- const char *nice_who_name = who_node->who_perm.who_ug_name;
- uu_avl_t *avl = who_node->who_perm.who_deleg_perm_avl;
- zfs_deleg_who_type_t who_type = who_node->who_perm.who_type;
- char delim = ' ';
- deleg_perm_node_t *deleg_node;
- boolean_t prt_who = B_TRUE;
-
- for (deleg_node = uu_avl_first(avl);
- deleg_node != NULL;
- deleg_node = uu_avl_next(avl, deleg_node)) {
- if (local != deleg_node->dpn_perm.dp_local ||
- descend != deleg_node->dpn_perm.dp_descend)
- continue;
-
- if (prt_who) {
- const char *who = NULL;
- if (prt_title) {
- prt_title = B_FALSE;
- (void) printf(title);
- }
-
- switch (who_type) {
- case ZFS_DELEG_USER_SETS:
- case ZFS_DELEG_USER:
- who = gettext("user");
- if (nice_who_name)
- who_name = nice_who_name;
- break;
- case ZFS_DELEG_GROUP_SETS:
- case ZFS_DELEG_GROUP:
- who = gettext("group");
- if (nice_who_name)
- who_name = nice_who_name;
- break;
- case ZFS_DELEG_EVERYONE_SETS:
- case ZFS_DELEG_EVERYONE:
- who = gettext("everyone");
- who_name = NULL;
- }
-
- prt_who = B_FALSE;
- if (who_name == NULL)
- (void) printf("\t%s", who);
- else
- (void) printf("\t%s %s", who, who_name);
- }
-
- (void) printf("%c%s", delim,
- deleg_node->dpn_perm.dp_name);
- delim = ',';
- }
-
- if (!prt_who)
- (void) printf("\n");
- }
-
- uu_avl_walk_end(walk);
-}
-
-static void
-print_fs_perms(fs_perm_set_t *fspset)
-{
- fs_perm_node_t *node = NULL;
- char buf[ZFS_MAXNAMELEN+32];
- const char *dsname = buf;
-
- for (node = uu_list_first(fspset->fsps_list); node != NULL;
- node = uu_list_next(fspset->fsps_list, node)) {
- uu_avl_t *sc_avl = node->fspn_fsperm.fsp_sc_avl;
- uu_avl_t *uge_avl = node->fspn_fsperm.fsp_uge_avl;
- int left = 0;
-
- (void) snprintf(buf, ZFS_MAXNAMELEN+32,
- gettext("---- Permissions on %s "),
- node->fspn_fsperm.fsp_name);
- (void) printf(dsname);
- left = 70 - strlen(buf);
- while (left-- > 0)
- (void) printf("-");
- (void) printf("\n");
-
- print_set_creat_perms(sc_avl);
- print_uge_deleg_perms(uge_avl, B_TRUE, B_FALSE,
- gettext("Local permissions:\n"));
- print_uge_deleg_perms(uge_avl, B_FALSE, B_TRUE,
- gettext("Descendent permissions:\n"));
- print_uge_deleg_perms(uge_avl, B_TRUE, B_TRUE,
- gettext("Local+Descendent permissions:\n"));
- }
-}
-
-static fs_perm_set_t fs_perm_set = { NULL, NULL, NULL, NULL };
-
-struct deleg_perms {
- boolean_t un;
- nvlist_t *nvl;
-};
-
-static int
-set_deleg_perms(zfs_handle_t *zhp, void *data)
-{
- struct deleg_perms *perms = (struct deleg_perms *)data;
- zfs_type_t zfs_type = zfs_get_type(zhp);
-
- if (zfs_type != ZFS_TYPE_FILESYSTEM && zfs_type != ZFS_TYPE_VOLUME)
- return (0);
-
- return (zfs_set_fsacl(zhp, perms->un, perms->nvl));
-}
-
-static int
-zfs_do_allow_unallow_impl(int argc, char **argv, boolean_t un)
-{
- zfs_handle_t *zhp;
- nvlist_t *perm_nvl = NULL;
- nvlist_t *update_perm_nvl = NULL;
- int error = 1;
- int c;
- struct allow_opts opts = { 0 };
-
- const char *optstr = un ? "ldugecsrh" : "ldugecsh";
-
- /* check opts */
- while ((c = getopt(argc, argv, optstr)) != -1) {
- switch (c) {
- case 'l':
- opts.local = B_TRUE;
- break;
- case 'd':
- opts.descend = B_TRUE;
- break;
- case 'u':
- opts.user = B_TRUE;
- break;
- case 'g':
- opts.group = B_TRUE;
- break;
- case 'e':
- opts.everyone = B_TRUE;
- break;
- case 's':
- opts.set = B_TRUE;
- break;
- case 'c':
- opts.create = B_TRUE;
- break;
- case 'r':
- opts.recursive = B_TRUE;
- break;
- case ':':
- (void) fprintf(stderr, gettext("missing argument for "
- "'%c' option\n"), optopt);
- usage(B_FALSE);
- break;
- case 'h':
- opts.prt_usage = B_TRUE;
- break;
- case '?':
- (void) fprintf(stderr, gettext("invalid option '%c'\n"),
- optopt);
- usage(B_FALSE);
- }
- }
-
- argc -= optind;
- argv += optind;
-
- /* check arguments */
- parse_allow_args(argc, argv, un, &opts);
-
- /* try to open the dataset */
- if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM |
- ZFS_TYPE_VOLUME)) == NULL) {
- (void) fprintf(stderr, "Failed to open dataset: %s\n",
- opts.dataset);
- return (-1);
- }
-
- if (zfs_get_fsacl(zhp, &perm_nvl) != 0)
- goto cleanup2;
-
- fs_perm_set_init(&fs_perm_set);
- if (parse_fs_perm_set(&fs_perm_set, perm_nvl) != 0) {
- (void) fprintf(stderr, "Failed to parse fsacl permissions\n");
- goto cleanup1;
- }
-
- if (opts.prt_perms)
- print_fs_perms(&fs_perm_set);
- else {
- (void) construct_fsacl_list(un, &opts, &update_perm_nvl);
- if (zfs_set_fsacl(zhp, un, update_perm_nvl) != 0)
- goto cleanup0;
-
- if (un && opts.recursive) {
- struct deleg_perms data = { un, update_perm_nvl };
- if (zfs_iter_filesystems(zhp, set_deleg_perms,
- &data) != 0)
- goto cleanup0;
- }
- }
-
- error = 0;
-
-cleanup0:
- nvlist_free(perm_nvl);
- if (update_perm_nvl != NULL)
- nvlist_free(update_perm_nvl);
-cleanup1:
- fs_perm_set_fini(&fs_perm_set);
-cleanup2:
- zfs_close(zhp);
-
- return (error);
-}
-
-/*
- * zfs allow [-r] [-t] <tag> <snap> ...
- *
- * -r Recursively hold
- * -t Temporary hold (hidden option)
- *
- * Apply a user-hold with the given tag to the list of snapshots.
- */
-static int
-zfs_do_allow(int argc, char **argv)
-{
- return (zfs_do_allow_unallow_impl(argc, argv, B_FALSE));
-}
-
-/*
- * zfs unallow [-r] [-t] <tag> <snap> ...
- *
- * -r Recursively hold
- * -t Temporary hold (hidden option)
- *
- * Apply a user-hold with the given tag to the list of snapshots.
- */
-static int
-zfs_do_unallow(int argc, char **argv)
-{
- return (zfs_do_allow_unallow_impl(argc, argv, B_TRUE));
-}
-
static int
zfs_do_hold_rele_impl(int argc, char **argv, boolean_t holding)
{
@@ -5208,200 +2936,6 @@ zfs_do_release(int argc, char **argv)
return (zfs_do_hold_rele_impl(argc, argv, B_FALSE));
}
-typedef struct holds_cbdata {
- boolean_t cb_recursive;
- const char *cb_snapname;
- nvlist_t **cb_nvlp;
- size_t cb_max_namelen;
- size_t cb_max_taglen;
-} holds_cbdata_t;
-
-#define STRFTIME_FMT_STR "%a %b %e %k:%M %Y"
-#define DATETIME_BUF_LEN (32)
-/*
- *
- */
-static void
-print_holds(boolean_t scripted, size_t nwidth, size_t tagwidth, nvlist_t *nvl)
-{
- int i;
- nvpair_t *nvp = NULL;
- char *hdr_cols[] = { "NAME", "TAG", "TIMESTAMP" };
- const char *col;
-
- if (!scripted) {
- for (i = 0; i < 3; i++) {
- col = gettext(hdr_cols[i]);
- if (i < 2)
- (void) printf("%-*s ", i ? tagwidth : nwidth,
- col);
- else
- (void) printf("%s\n", col);
- }
- }
-
- while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
- char *zname = nvpair_name(nvp);
- nvlist_t *nvl2;
- nvpair_t *nvp2 = NULL;
- (void) nvpair_value_nvlist(nvp, &nvl2);
- while ((nvp2 = nvlist_next_nvpair(nvl2, nvp2)) != NULL) {
- char tsbuf[DATETIME_BUF_LEN];
- char *tagname = nvpair_name(nvp2);
- uint64_t val = 0;
- time_t time;
- struct tm t;
- char sep = scripted ? '\t' : ' ';
- size_t sepnum = scripted ? 1 : 2;
-
- (void) nvpair_value_uint64(nvp2, &val);
- time = (time_t)val;
- (void) localtime_r(&time, &t);
- (void) strftime(tsbuf, DATETIME_BUF_LEN,
- gettext(STRFTIME_FMT_STR), &t);
-
- (void) printf("%-*s%*c%-*s%*c%s\n", nwidth, zname,
- sepnum, sep, tagwidth, tagname, sepnum, sep, tsbuf);
- }
- }
-}
-
-/*
- * Generic callback function to list a dataset or snapshot.
- */
-static int
-holds_callback(zfs_handle_t *zhp, void *data)
-{
- holds_cbdata_t *cbp = data;
- nvlist_t *top_nvl = *cbp->cb_nvlp;
- nvlist_t *nvl = NULL;
- nvpair_t *nvp = NULL;
- const char *zname = zfs_get_name(zhp);
- size_t znamelen = strnlen(zname, ZFS_MAXNAMELEN);
-
- if (cbp->cb_recursive) {
- const char *snapname;
- char *delim = strchr(zname, '@');
- if (delim == NULL)
- return (0);
-
- snapname = delim + 1;
- if (strcmp(cbp->cb_snapname, snapname))
- return (0);
- }
-
- if (zfs_get_holds(zhp, &nvl) != 0)
- return (-1);
-
- if (znamelen > cbp->cb_max_namelen)
- cbp->cb_max_namelen = znamelen;
-
- while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
- const char *tag = nvpair_name(nvp);
- size_t taglen = strnlen(tag, MAXNAMELEN);
- if (taglen > cbp->cb_max_taglen)
- cbp->cb_max_taglen = taglen;
- }
-
- return (nvlist_add_nvlist(top_nvl, zname, nvl));
-}
-
-/*
- * zfs holds [-r] <snap> ...
- *
- * -r Recursively hold
- */
-static int
-zfs_do_holds(int argc, char **argv)
-{
- int errors = 0;
- int c;
- int i;
- boolean_t scripted = B_FALSE;
- boolean_t recursive = B_FALSE;
- const char *opts = "rH";
- nvlist_t *nvl;
-
- int types = ZFS_TYPE_SNAPSHOT;
- holds_cbdata_t cb = { 0 };
-
- int limit = 0;
- int ret = 0;
- int flags = 0;
-
- /* check options */
- while ((c = getopt(argc, argv, opts)) != -1) {
- switch (c) {
- case 'r':
- recursive = B_TRUE;
- break;
- case 'H':
- scripted = B_TRUE;
- break;
- case '?':
- (void) fprintf(stderr, gettext("invalid option '%c'\n"),
- optopt);
- usage(B_FALSE);
- }
- }
-
- if (recursive) {
- types |= ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME;
- flags |= ZFS_ITER_RECURSE;
- }
-
- argc -= optind;
- argv += optind;
-
- /* check number of arguments */
- if (argc < 1)
- usage(B_FALSE);
-
- if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0)
- nomem();
-
- for (i = 0; i < argc; ++i) {
- char *snapshot = argv[i];
- const char *delim;
- const char *snapname;
-
- delim = strchr(snapshot, '@');
- if (delim == NULL) {
- (void) fprintf(stderr,
- gettext("'%s' is not a snapshot\n"), snapshot);
- ++errors;
- continue;
- }
- snapname = delim + 1;
- if (recursive)
- snapshot[delim - snapshot] = '\0';
-
- cb.cb_recursive = recursive;
- cb.cb_snapname = snapname;
- cb.cb_nvlp = &nvl;
-
- /*
- * 1. collect holds data, set format options
- */
- ret = zfs_for_each(argc, argv, flags, types, NULL, NULL, limit,
- holds_callback, &cb);
- if (ret != 0)
- ++errors;
- }
-
- /*
- * 2. print holds data
- */
- print_holds(scripted, cb.cb_max_namelen, cb.cb_max_taglen, nvl);
-
- if (nvlist_empty(nvl))
- (void) printf(gettext("no datasets available\n"));
-
- nvlist_free(nvl);
-
- return (0 != errors);
-}
-
#define CHECK_SPINNER 30
#define SPINNER_TIME 3 /* seconds */
#define MOUNT_TIME 5 /* seconds */
@@ -5903,7 +3437,7 @@ static int
unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
{
zfs_handle_t *zhp;
- int ret = 0;
+ int ret;
struct stat64 statbuf;
struct extmnttab entry;
const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
@@ -6286,6 +3820,15 @@ zfs_do_unshare(int argc, char **argv)
return (unshare_unmount(OP_SHARE, argc, argv));
}
+/* ARGSUSED */
+static int
+zfs_do_python(int argc, char **argv)
+{
+ (void) execv(pypath, argv-1);
+ (void) printf("internal error: %s not found\n", pypath);
+ return (-1);
+}
+
/*
* Called when invoked as /etc/fs/zfs/mount. Do the mount if the mountpoint is
* 'legacy'. Otherwise, complain that use should be using 'zfs mount'.
@@ -6296,7 +3839,7 @@ manual_mount(int argc, char **argv)
zfs_handle_t *zhp;
char mountpoint[ZFS_MAXPROPLEN];
char mntopts[MNT_LINE_MAX] = { '\0' };
- int ret = 0;
+ int ret;
int c;
int flags = 0;
char *dataset, *path;
@@ -6446,7 +3989,7 @@ zfs_do_diff(int argc, char **argv)
char *tosnap = NULL;
char *fromsnap = NULL;
char *atp, *copy;
- int err = 0;
+ int err;
int c;
while ((c = getopt(argc, argv, "FHt")) != -1) {
@@ -6516,7 +4059,7 @@ zfs_do_diff(int argc, char **argv)
int
main(int argc, char **argv)
{
- int ret = 0;
+ int ret;
int i;
char *progname;
char *cmdname;
@@ -6532,7 +4075,8 @@ main(int argc, char **argv)
return (1);
}
- zfs_save_arguments(argc, argv, history_str, sizeof (history_str));
+ zpool_set_history_str("zfs", argc, argv, history_str);
+ verify(zpool_stage_history(g_zfs, history_str) == 0);
libzfs_print_on_error(g_zfs, B_TRUE);
@@ -6601,9 +4145,6 @@ main(int argc, char **argv)
(void) fclose(mnttab_file);
- if (ret == 0 && log_history)
- (void) zpool_log_history(g_zfs, history_str);
-
libzfs_fini(g_zfs);
/*
diff --git a/cmd/zhack/zhack.c b/cmd/zhack/zhack.c
deleted file mode 100644
index f4be0b2a55fb..000000000000
--- a/cmd/zhack/zhack.c
+++ /dev/null
@@ -1,540 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-/*
- * zhack is a debugging tool that can write changes to ZFS pool using libzpool
- * for testing purposes. Altering pools with zhack is unsupported and may
- * result in corrupted pools.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/zfs_context.h>
-#include <sys/spa.h>
-#include <sys/spa_impl.h>
-#include <sys/dmu.h>
-#include <sys/zap.h>
-#include <sys/zfs_znode.h>
-#include <sys/dsl_synctask.h>
-#include <sys/vdev.h>
-#include <sys/fs/zfs.h>
-#include <sys/dmu_objset.h>
-#include <sys/dsl_pool.h>
-#include <sys/zio_checksum.h>
-#include <sys/zio_compress.h>
-#include <sys/zfeature.h>
-#undef ZFS_MAXNAMELEN
-#undef verify
-#include <libzfs.h>
-
-extern boolean_t zfeature_checks_disable;
-
-const char cmdname[] = "zhack";
-libzfs_handle_t *g_zfs;
-static importargs_t g_importargs;
-static char *g_pool;
-static boolean_t g_readonly;
-
-static void
-usage(void)
-{
- (void) fprintf(stderr,
- "Usage: %s [-c cachefile] [-d dir] <subcommand> <args> ...\n"
- "where <subcommand> <args> is one of the following:\n"
- "\n", cmdname);
-
- (void) fprintf(stderr,
- " feature stat <pool>\n"
- " print information about enabled features\n"
- " feature enable [-d desc] <pool> <feature>\n"
- " add a new enabled feature to the pool\n"
- " -d <desc> sets the feature's description\n"
- " feature ref [-md] <pool> <feature>\n"
- " change the refcount on the given feature\n"
- " -d decrease instead of increase the refcount\n"
- " -m add the feature to the label if increasing refcount\n"
- "\n"
- " <feature> : should be a feature guid\n");
- exit(1);
-}
-
-
-static void
-fatal(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- (void) fprintf(stderr, "%s: ", cmdname);
- (void) vfprintf(stderr, fmt, ap);
- va_end(ap);
- (void) fprintf(stderr, "\n");
-
- exit(1);
-}
-
-/* ARGSUSED */
-static int
-space_delta_cb(dmu_object_type_t bonustype, void *data,
- uint64_t *userp, uint64_t *groupp)
-{
- /*
- * Is it a valid type of object to track?
- */
- if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA)
- return (ENOENT);
- (void) fprintf(stderr, "modifying object that needs user accounting");
- abort();
- /* NOTREACHED */
-}
-
-/*
- * Target is the dataset whose pool we want to open.
- */
-static void
-import_pool(const char *target, boolean_t readonly)
-{
- nvlist_t *config;
- nvlist_t *pools;
- int error;
- char *sepp;
- spa_t *spa;
- nvpair_t *elem;
- nvlist_t *props;
- const char *name;
-
- kernel_init(readonly ? FREAD : (FREAD | FWRITE));
- g_zfs = libzfs_init();
- ASSERT(g_zfs != NULL);
-
- dmu_objset_register_type(DMU_OST_ZFS, space_delta_cb);
-
- g_readonly = readonly;
-
- /*
- * If we only want readonly access, it's OK if we find
- * a potentially-active (ie, imported into the kernel) pool from the
- * default cachefile.
- */
- if (readonly && spa_open(target, &spa, FTAG) == 0) {
- spa_close(spa, FTAG);
- return;
- }
-
- g_importargs.unique = B_TRUE;
- g_importargs.can_be_active = readonly;
- g_pool = strdup(target);
- if ((sepp = strpbrk(g_pool, "/@")) != NULL)
- *sepp = '\0';
- g_importargs.poolname = g_pool;
- pools = zpool_search_import(g_zfs, &g_importargs);
-
- if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) {
- if (!g_importargs.can_be_active) {
- g_importargs.can_be_active = B_TRUE;
- if (zpool_search_import(g_zfs, &g_importargs) != NULL ||
- spa_open(target, &spa, FTAG) == 0) {
- fatal("cannot import '%s': pool is active; run "
- "\"zpool export %s\" first\n",
- g_pool, g_pool);
- }
- }
-
- fatal("cannot import '%s': no such pool available\n", g_pool);
- }
-
- elem = nvlist_next_nvpair(pools, NULL);
- name = nvpair_name(elem);
- verify(nvpair_value_nvlist(elem, &config) == 0);
-
- props = NULL;
- if (readonly) {
- verify(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
- verify(nvlist_add_uint64(props,
- zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0);
- }
-
- zfeature_checks_disable = B_TRUE;
- error = spa_import(name, config, props, ZFS_IMPORT_NORMAL);
- zfeature_checks_disable = B_FALSE;
- if (error == EEXIST)
- error = 0;
-
- if (error)
- fatal("can't import '%s': %s", name, strerror(error));
-}
-
-static void
-zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa)
-{
- int err;
-
- import_pool(target, readonly);
-
- zfeature_checks_disable = B_TRUE;
- err = spa_open(target, spa, tag);
- zfeature_checks_disable = B_FALSE;
-
- if (err != 0)
- fatal("cannot open '%s': %s", target, strerror(err));
- if (spa_version(*spa) < SPA_VERSION_FEATURES) {
- fatal("'%s' has version %d, features not enabled", target,
- (int)spa_version(*spa));
- }
-}
-
-static void
-dump_obj(objset_t *os, uint64_t obj, const char *name)
-{
- zap_cursor_t zc;
- zap_attribute_t za;
-
- (void) printf("%s_obj:\n", name);
-
- for (zap_cursor_init(&zc, os, obj);
- zap_cursor_retrieve(&zc, &za) == 0;
- zap_cursor_advance(&zc)) {
- if (za.za_integer_length == 8) {
- ASSERT(za.za_num_integers == 1);
- (void) printf("\t%s = %llu\n",
- za.za_name, (u_longlong_t)za.za_first_integer);
- } else {
- ASSERT(za.za_integer_length == 1);
- char val[1024];
- VERIFY(zap_lookup(os, obj, za.za_name,
- 1, sizeof (val), val) == 0);
- (void) printf("\t%s = %s\n", za.za_name, val);
- }
- }
- zap_cursor_fini(&zc);
-}
-
-static void
-dump_mos(spa_t *spa)
-{
- nvlist_t *nv = spa->spa_label_features;
-
- (void) printf("label config:\n");
- for (nvpair_t *pair = nvlist_next_nvpair(nv, NULL);
- pair != NULL;
- pair = nvlist_next_nvpair(nv, pair)) {
- (void) printf("\t%s\n", nvpair_name(pair));
- }
-}
-
-static void
-zhack_do_feature_stat(int argc, char **argv)
-{
- spa_t *spa;
- objset_t *os;
- char *target;
-
- argc--;
- argv++;
-
- if (argc < 1) {
- (void) fprintf(stderr, "error: missing pool name\n");
- usage();
- }
- target = argv[0];
-
- zhack_spa_open(target, B_TRUE, FTAG, &spa);
- os = spa->spa_meta_objset;
-
- dump_obj(os, spa->spa_feat_for_read_obj, "for_read");
- dump_obj(os, spa->spa_feat_for_write_obj, "for_write");
- dump_obj(os, spa->spa_feat_desc_obj, "descriptions");
- dump_mos(spa);
-
- spa_close(spa, FTAG);
-}
-
-static void
-feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx)
-{
- spa_t *spa = arg1;
- zfeature_info_t *feature = arg2;
-
- spa_feature_enable(spa, feature, tx);
- spa_history_log_internal(spa, "zhack enable feature", tx,
- "name=%s can_readonly=%u",
- feature->fi_guid, feature->fi_can_readonly);
-}
-
-static void
-zhack_do_feature_enable(int argc, char **argv)
-{
- char c;
- char *desc, *target;
- spa_t *spa;
- objset_t *mos;
- zfeature_info_t feature;
- zfeature_info_t *nodeps[] = { NULL };
-
- /*
- * Features are not added to the pool's label until their refcounts
- * are incremented, so fi_mos can just be left as false for now.
- */
- desc = NULL;
- feature.fi_uname = "zhack";
- feature.fi_mos = B_FALSE;
- feature.fi_can_readonly = B_FALSE;
- feature.fi_depends = nodeps;
-
- optind = 1;
- while ((c = getopt(argc, argv, "rmd:")) != -1) {
- switch (c) {
- case 'r':
- feature.fi_can_readonly = B_TRUE;
- break;
- case 'd':
- desc = strdup(optarg);
- break;
- default:
- usage();
- break;
- }
- }
-
- if (desc == NULL)
- desc = strdup("zhack injected");
- feature.fi_desc = desc;
-
- argc -= optind;
- argv += optind;
-
- if (argc < 2) {
- (void) fprintf(stderr, "error: missing feature or pool name\n");
- usage();
- }
- target = argv[0];
- feature.fi_guid = argv[1];
-
- if (!zfeature_is_valid_guid(feature.fi_guid))
- fatal("invalid feature guid: %s", feature.fi_guid);
-
- zhack_spa_open(target, B_FALSE, FTAG, &spa);
- mos = spa->spa_meta_objset;
-
- if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
- fatal("'%s' is a real feature, will not enable");
- if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
- fatal("feature already enabled: %s", feature.fi_guid);
-
- VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
- feature_enable_sync, spa, &feature, 5));
-
- spa_close(spa, FTAG);
-
- free(desc);
-}
-
-static void
-feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
-{
- spa_t *spa = arg1;
- zfeature_info_t *feature = arg2;
-
- spa_feature_incr(spa, feature, tx);
- spa_history_log_internal(spa, "zhack feature incr", tx,
- "name=%s", feature->fi_guid);
-}
-
-static void
-feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
-{
- spa_t *spa = arg1;
- zfeature_info_t *feature = arg2;
-
- spa_feature_decr(spa, feature, tx);
- spa_history_log_internal(spa, "zhack feature decr", tx,
- "name=%s", feature->fi_guid);
-}
-
-static void
-zhack_do_feature_ref(int argc, char **argv)
-{
- char c;
- char *target;
- boolean_t decr = B_FALSE;
- spa_t *spa;
- objset_t *mos;
- zfeature_info_t feature;
- zfeature_info_t *nodeps[] = { NULL };
-
- /*
- * fi_desc does not matter here because it was written to disk
- * when the feature was enabled, but we need to properly set the
- * feature for read or write based on the information we read off
- * disk later.
- */
- feature.fi_uname = "zhack";
- feature.fi_mos = B_FALSE;
- feature.fi_desc = NULL;
- feature.fi_depends = nodeps;
-
- optind = 1;
- while ((c = getopt(argc, argv, "md")) != -1) {
- switch (c) {
- case 'm':
- feature.fi_mos = B_TRUE;
- break;
- case 'd':
- decr = B_TRUE;
- break;
- default:
- usage();
- break;
- }
- }
- argc -= optind;
- argv += optind;
-
- if (argc < 2) {
- (void) fprintf(stderr, "error: missing feature or pool name\n");
- usage();
- }
- target = argv[0];
- feature.fi_guid = argv[1];
-
- if (!zfeature_is_valid_guid(feature.fi_guid))
- fatal("invalid feature guid: %s", feature.fi_guid);
-
- zhack_spa_open(target, B_FALSE, FTAG, &spa);
- mos = spa->spa_meta_objset;
-
- if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
- fatal("'%s' is a real feature, will not change refcount");
-
- if (0 == zap_contains(mos, spa->spa_feat_for_read_obj,
- feature.fi_guid)) {
- feature.fi_can_readonly = B_FALSE;
- } else if (0 == zap_contains(mos, spa->spa_feat_for_write_obj,
- feature.fi_guid)) {
- feature.fi_can_readonly = B_TRUE;
- } else {
- fatal("feature is not enabled: %s", feature.fi_guid);
- }
-
- if (decr && !spa_feature_is_active(spa, &feature))
- fatal("feature refcount already 0: %s", feature.fi_guid);
-
- VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
- decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5));
-
- spa_close(spa, FTAG);
-}
-
-static int
-zhack_do_feature(int argc, char **argv)
-{
- char *subcommand;
-
- argc--;
- argv++;
- if (argc == 0) {
- (void) fprintf(stderr,
- "error: no feature operation specified\n");
- usage();
- }
-
- subcommand = argv[0];
- if (strcmp(subcommand, "stat") == 0) {
- zhack_do_feature_stat(argc, argv);
- } else if (strcmp(subcommand, "enable") == 0) {
- zhack_do_feature_enable(argc, argv);
- } else if (strcmp(subcommand, "ref") == 0) {
- zhack_do_feature_ref(argc, argv);
- } else {
- (void) fprintf(stderr, "error: unknown subcommand: %s\n",
- subcommand);
- usage();
- }
-
- return (0);
-}
-
-#define MAX_NUM_PATHS 1024
-
-int
-main(int argc, char **argv)
-{
- extern void zfs_prop_init(void);
-
- char *path[MAX_NUM_PATHS];
- const char *subcommand;
- int rv = 0;
- char c;
-
- g_importargs.path = path;
-
- dprintf_setup(&argc, argv);
- zfs_prop_init();
-
- while ((c = getopt(argc, argv, "c:d:")) != -1) {
- switch (c) {
- case 'c':
- g_importargs.cachefile = optarg;
- break;
- case 'd':
- assert(g_importargs.paths < MAX_NUM_PATHS);
- g_importargs.path[g_importargs.paths++] = optarg;
- break;
- default:
- usage();
- break;
- }
- }
-
- argc -= optind;
- argv += optind;
- optind = 1;
-
- if (argc == 0) {
- (void) fprintf(stderr, "error: no command specified\n");
- usage();
- }
-
- subcommand = argv[0];
-
- if (strcmp(subcommand, "feature") == 0) {
- rv = zhack_do_feature(argc, argv);
- } else {
- (void) fprintf(stderr, "error: unknown subcommand: %s\n",
- subcommand);
- usage();
- }
-
- if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) {
- fatal("pool export failed; "
- "changes may not be committed to disk\n");
- }
-
- libzfs_fini(g_zfs);
- kernel_fini();
-
- return (rv);
-}
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 3ecdbec9684d..8aa985b1a552 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -21,9 +21,6 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2012 by Frederik Wessels. All rights reserved.
*/
#include <assert.h>
@@ -43,7 +40,6 @@
#include <priv.h>
#include <pwd.h>
#include <zone.h>
-#include <zfs_prop.h>
#include <sys/fs/zfs.h>
#include <sys/stat.h>
@@ -51,7 +47,6 @@
#include "zpool_util.h"
#include "zfs_comutil.h"
-#include "zfeature_common.h"
#include "statcommon.h"
@@ -68,9 +63,6 @@ static int zpool_do_status(int, char **);
static int zpool_do_online(int, char **);
static int zpool_do_offline(int, char **);
static int zpool_do_clear(int, char **);
-static int zpool_do_reopen(int, char **);
-
-static int zpool_do_reguid(int, char **);
static int zpool_do_attach(int, char **);
static int zpool_do_detach(int, char **);
@@ -129,9 +121,7 @@ typedef enum {
HELP_UPGRADE,
HELP_GET,
HELP_SET,
- HELP_SPLIT,
- HELP_REGUID,
- HELP_REOPEN
+ HELP_SPLIT
} zpool_help_t;
@@ -164,7 +154,6 @@ static zpool_command_t command_table[] = {
{ "online", zpool_do_online, HELP_ONLINE },
{ "offline", zpool_do_offline, HELP_OFFLINE },
{ "clear", zpool_do_clear, HELP_CLEAR },
- { "reopen", zpool_do_reopen, HELP_REOPEN },
{ NULL },
{ "attach", zpool_do_attach, HELP_ATTACH },
{ "detach", zpool_do_detach, HELP_DETACH },
@@ -176,7 +165,6 @@ static zpool_command_t command_table[] = {
{ "import", zpool_do_import, HELP_IMPORT },
{ "export", zpool_do_export, HELP_EXPORT },
{ "upgrade", zpool_do_upgrade, HELP_UPGRADE },
- { "reguid", zpool_do_reguid, HELP_REGUID },
{ NULL },
{ "history", zpool_do_history, HELP_HISTORY },
{ "get", zpool_do_get, HELP_GET },
@@ -185,9 +173,9 @@ static zpool_command_t command_table[] = {
#define NCOMMAND (sizeof (command_table) / sizeof (command_table[0]))
-static zpool_command_t *current_command;
+zpool_command_t *current_command;
static char history_str[HIS_MAX_RECORD_LEN];
-static boolean_t log_history = B_TRUE;
+
static uint_t timestamp_fmt = NODATE;
static const char *
@@ -201,7 +189,7 @@ get_usage(zpool_help_t idx) {
case HELP_CLEAR:
return (gettext("\tclear [-nF] <pool> [device]\n"));
case HELP_CREATE:
- return (gettext("\tcreate [-fnd] [-o property=value] ... \n"
+ return (gettext("\tcreate [-fn] [-o property=value] ... \n"
"\t [-O file-system-property=value] ... \n"
"\t [-m mountpoint] [-R root] <pool> <vdev> ...\n"));
case HELP_DESTROY:
@@ -237,8 +225,6 @@ get_usage(zpool_help_t idx) {
"[new-device]\n"));
case HELP_REMOVE:
return (gettext("\tremove <pool> <device> ...\n"));
- case HELP_REOPEN:
- return (""); /* Undocumented command */
case HELP_SCRUB:
return (gettext("\tscrub [-s] <pool> ...\n"));
case HELP_STATUS:
@@ -257,8 +243,6 @@ get_usage(zpool_help_t idx) {
return (gettext("\tsplit [-n] [-R altroot] [-o mntopts]\n"
"\t [-o property=value] <pool> <newpool> "
"[<device> ...]\n"));
- case HELP_REGUID:
- return (gettext("\treguid <pool>\n"));
}
abort();
@@ -332,12 +316,6 @@ usage(boolean_t requested)
/* Iterate over all properties */
(void) zprop_iter(print_prop_cb, fp, B_FALSE, B_TRUE,
ZFS_TYPE_POOL);
-
- (void) fprintf(fp, "\t%-15s ", "feature@...");
- (void) fprintf(fp, "YES disabled | enabled | active\n");
-
- (void) fprintf(fp, gettext("\nThe feature@ properties must be "
- "appended with a feature name.\nSee zpool-features(5).\n"));
}
/*
@@ -404,16 +382,12 @@ add_prop_list(const char *propname, char *propval, nvlist_t **props,
proplist = *props;
if (poolprop) {
- if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL &&
- !zpool_prop_feature(propname)) {
+ if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL) {
(void) fprintf(stderr, gettext("property '%s' is "
"not a valid pool property\n"), propname);
return (2);
}
- if (zpool_prop_feature(propname))
- normnm = propname;
- else
- normnm = zpool_prop_to_name(prop);
+ normnm = zpool_prop_to_name(prop);
} else {
if ((fprop = zfs_name_to_prop(propname)) != ZPROP_INVAL) {
normnm = zfs_prop_to_name(fprop);
@@ -585,7 +559,7 @@ zpool_do_remove(int argc, char **argv)
}
/*
- * zpool create [-fnd] [-o property=value] ...
+ * zpool create [-fn] [-o property=value] ...
* [-O file-system-property=value] ...
* [-R root] [-m mountpoint] <pool> <dev> ...
*
@@ -594,10 +568,8 @@ zpool_do_remove(int argc, char **argv)
* were to be created.
* -R Create a pool under an alternate root
* -m Set default mountpoint for the root dataset. By default it's
- * '/<pool>'
+ * '/<pool>'
* -o Set property=value.
- * -d Don't automatically enable all supported pool features
- * (individual features can be enabled with -o).
* -O Set fsproperty=value in the pool's root file system
*
* Creates the named pool according to the given vdev specification. The
@@ -610,7 +582,6 @@ zpool_do_create(int argc, char **argv)
{
boolean_t force = B_FALSE;
boolean_t dryrun = B_FALSE;
- boolean_t enable_all_pool_feat = B_TRUE;
int c;
nvlist_t *nvroot = NULL;
char *poolname;
@@ -622,7 +593,7 @@ zpool_do_create(int argc, char **argv)
char *propval;
/* check options */
- while ((c = getopt(argc, argv, ":fndR:m:o:O:")) != -1) {
+ while ((c = getopt(argc, argv, ":fnR:m:o:O:")) != -1) {
switch (c) {
case 'f':
force = B_TRUE;
@@ -630,9 +601,6 @@ zpool_do_create(int argc, char **argv)
case 'n':
dryrun = B_TRUE;
break;
- case 'd':
- enable_all_pool_feat = B_FALSE;
- break;
case 'R':
altroot = optarg;
if (add_prop_list(zpool_prop_to_name(
@@ -660,21 +628,6 @@ zpool_do_create(int argc, char **argv)
if (add_prop_list(optarg, propval, &props, B_TRUE))
goto errout;
-
- /*
- * If the user is creating a pool that doesn't support
- * feature flags, don't enable any features.
- */
- if (zpool_name_to_prop(optarg) == ZPOOL_PROP_VERSION) {
- char *end;
- u_longlong_t ver;
-
- ver = strtoull(propval, &end, 10);
- if (*end == '\0' &&
- ver < SPA_VERSION_FEATURES) {
- enable_all_pool_feat = B_FALSE;
- }
- }
break;
case 'O':
if ((propval = strchr(optarg, '=')) == NULL) {
@@ -740,6 +693,7 @@ zpool_do_create(int argc, char **argv)
goto errout;
}
+
if (altroot != NULL && altroot[0] != '/') {
(void) fprintf(stderr, gettext("invalid alternate root '%s': "
"must be an absolute path\n"), altroot);
@@ -821,27 +775,6 @@ zpool_do_create(int argc, char **argv)
/*
* Hand off to libzfs.
*/
- if (enable_all_pool_feat) {
- int i;
- for (i = 0; i < SPA_FEATURES; i++) {
- char propname[MAXPATHLEN];
- zfeature_info_t *feat = &spa_feature_table[i];
-
- (void) snprintf(propname, sizeof (propname),
- "feature@%s", feat->fi_uname);
-
- /*
- * Skip feature if user specified it manually
- * on the command line.
- */
- if (nvlist_exists(props, propname))
- continue;
-
- if (add_prop_list(propname, ZFS_FEATURE_ENABLED,
- &props, B_TRUE) != 0)
- goto errout;
- }
- }
if (zpool_create(g_zfs, poolname,
nvroot, props, fsprops) == 0) {
zfs_handle_t *pool = zfs_open(g_zfs, poolname,
@@ -935,10 +868,7 @@ zpool_do_destroy(int argc, char **argv)
return (1);
}
- /* The history must be logged as part of the export */
- log_history = B_FALSE;
-
- ret = (zpool_destroy(zhp, history_str) != 0);
+ ret = (zpool_destroy(zhp) != 0);
zpool_close(zhp);
@@ -1002,13 +932,10 @@ zpool_do_export(int argc, char **argv)
continue;
}
- /* The history must be logged as part of the export */
- log_history = B_FALSE;
-
if (hardforce) {
- if (zpool_export_force(zhp, history_str) != 0)
+ if (zpool_export_force(zhp) != 0)
ret = 1;
- } else if (zpool_export(zhp, force, history_str) != 0) {
+ } else if (zpool_export(zhp, force) != 0) {
ret = 1;
}
@@ -1179,10 +1106,6 @@ print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
(void) printf(gettext("newer version"));
break;
- case VDEV_AUX_UNSUP_FEAT:
- (void) printf(gettext("unsupported feature(s)"));
- break;
-
case VDEV_AUX_SPARED:
verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
&cb.cb_guid) == 0);
@@ -1300,10 +1223,6 @@ print_import_config(const char *name, nvlist_t *nv, int namewidth, int depth)
(void) printf(gettext("newer version"));
break;
- case VDEV_AUX_UNSUP_FEAT:
- (void) printf(gettext("unsupported feature(s)"));
- break;
-
case VDEV_AUX_ERR_EXCEEDED:
(void) printf(gettext("too many errors"));
break;
@@ -1407,7 +1326,6 @@ show_import(nvlist_t *config)
const char *health;
uint_t vsc;
int namewidth;
- char *comment;
verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
&name) == 0);
@@ -1424,9 +1342,9 @@ show_import(nvlist_t *config)
reason = zpool_import_status(config, &msgid);
- (void) printf(gettext(" pool: %s\n"), name);
- (void) printf(gettext(" id: %llu\n"), (u_longlong_t)guid);
- (void) printf(gettext(" state: %s"), health);
+ (void) printf(gettext(" pool: %s\n"), name);
+ (void) printf(gettext(" id: %llu\n"), (u_longlong_t)guid);
+ (void) printf(gettext(" state: %s"), health);
if (pool_state == POOL_STATE_DESTROYED)
(void) printf(gettext(" (DESTROYED)"));
(void) printf("\n");
@@ -1435,73 +1353,58 @@ show_import(nvlist_t *config)
case ZPOOL_STATUS_MISSING_DEV_R:
case ZPOOL_STATUS_MISSING_DEV_NR:
case ZPOOL_STATUS_BAD_GUID_SUM:
- (void) printf(gettext(" status: One or more devices are "
- "missing from the system.\n"));
+ (void) printf(gettext("status: One or more devices are missing "
+ "from the system.\n"));
break;
case ZPOOL_STATUS_CORRUPT_LABEL_R:
case ZPOOL_STATUS_CORRUPT_LABEL_NR:
- (void) printf(gettext(" status: One or more devices contains "
+ (void) printf(gettext("status: One or more devices contains "
"corrupted data.\n"));
break;
case ZPOOL_STATUS_CORRUPT_DATA:
- (void) printf(
- gettext(" status: The pool data is corrupted.\n"));
+ (void) printf(gettext("status: The pool data is corrupted.\n"));
break;
case ZPOOL_STATUS_OFFLINE_DEV:
- (void) printf(gettext(" status: One or more devices "
+ (void) printf(gettext("status: One or more devices "
"are offlined.\n"));
break;
case ZPOOL_STATUS_CORRUPT_POOL:
- (void) printf(gettext(" status: The pool metadata is "
+ (void) printf(gettext("status: The pool metadata is "
"corrupted.\n"));
break;
case ZPOOL_STATUS_VERSION_OLDER:
- (void) printf(gettext(" status: The pool is formatted using an "
+ (void) printf(gettext("status: The pool is formatted using an "
"older on-disk version.\n"));
break;
case ZPOOL_STATUS_VERSION_NEWER:
- (void) printf(gettext(" status: The pool is formatted using an "
+ (void) printf(gettext("status: The pool is formatted using an "
"incompatible version.\n"));
break;
- case ZPOOL_STATUS_UNSUP_FEAT_READ:
- (void) printf(gettext("status: The pool uses the following "
- "feature(s) not supported on this sytem:\n"));
- zpool_print_unsup_feat(config);
- break;
-
- case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
- (void) printf(gettext("status: The pool can only be accessed "
- "in read-only mode on this system. It\n\tcannot be "
- "accessed in read-write mode because it uses the "
- "following\n\tfeature(s) not supported on this system:\n"));
- zpool_print_unsup_feat(config);
- break;
-
case ZPOOL_STATUS_HOSTID_MISMATCH:
- (void) printf(gettext(" status: The pool was last accessed by "
+ (void) printf(gettext("status: The pool was last accessed by "
"another system.\n"));
break;
case ZPOOL_STATUS_FAULTED_DEV_R:
case ZPOOL_STATUS_FAULTED_DEV_NR:
- (void) printf(gettext(" status: One or more devices are "
+ (void) printf(gettext("status: One or more devices are "
"faulted.\n"));
break;
case ZPOOL_STATUS_BAD_LOG:
- (void) printf(gettext(" status: An intent log record cannot be "
+ (void) printf(gettext("status: An intent log record cannot be "
"read.\n"));
break;
case ZPOOL_STATUS_RESILVERING:
- (void) printf(gettext(" status: One or more devices were being "
+ (void) printf(gettext("status: One or more devices were being "
"resilvered.\n"));
break;
@@ -1517,61 +1420,43 @@ show_import(nvlist_t *config)
*/
if (vs->vs_state == VDEV_STATE_HEALTHY) {
if (reason == ZPOOL_STATUS_VERSION_OLDER)
- (void) printf(gettext(" action: The pool can be "
+ (void) printf(gettext("action: The pool can be "
"imported using its name or numeric identifier, "
"though\n\tsome features will not be available "
"without an explicit 'zpool upgrade'.\n"));
else if (reason == ZPOOL_STATUS_HOSTID_MISMATCH)
- (void) printf(gettext(" action: The pool can be "
+ (void) printf(gettext("action: The pool can be "
"imported using its name or numeric "
"identifier and\n\tthe '-f' flag.\n"));
else
- (void) printf(gettext(" action: The pool can be "
+ (void) printf(gettext("action: The pool can be "
"imported using its name or numeric "
"identifier.\n"));
} else if (vs->vs_state == VDEV_STATE_DEGRADED) {
- (void) printf(gettext(" action: The pool can be imported "
+ (void) printf(gettext("action: The pool can be imported "
"despite missing or damaged devices. The\n\tfault "
"tolerance of the pool may be compromised if imported.\n"));
} else {
switch (reason) {
case ZPOOL_STATUS_VERSION_NEWER:
- (void) printf(gettext(" action: The pool cannot be "
+ (void) printf(gettext("action: The pool cannot be "
"imported. Access the pool on a system running "
"newer\n\tsoftware, or recreate the pool from "
"backup.\n"));
break;
- case ZPOOL_STATUS_UNSUP_FEAT_READ:
- (void) printf(gettext("action: The pool cannot be "
- "imported. Access the pool on a system that "
- "supports\n\tthe required feature(s), or recreate "
- "the pool from backup.\n"));
- break;
- case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
- (void) printf(gettext("action: The pool cannot be "
- "imported in read-write mode. Import the pool "
- "with\n"
- "\t\"-o readonly=on\", access the pool on a system "
- "that supports the\n\trequired feature(s), or "
- "recreate the pool from backup.\n"));
- break;
case ZPOOL_STATUS_MISSING_DEV_R:
case ZPOOL_STATUS_MISSING_DEV_NR:
case ZPOOL_STATUS_BAD_GUID_SUM:
- (void) printf(gettext(" action: The pool cannot be "
+ (void) printf(gettext("action: The pool cannot be "
"imported. Attach the missing\n\tdevices and try "
"again.\n"));
break;
default:
- (void) printf(gettext(" action: The pool cannot be "
+ (void) printf(gettext("action: The pool cannot be "
"imported due to damaged devices or data.\n"));
}
}
- /* Print the comment attached to the pool. */
- if (nvlist_lookup_string(config, ZPOOL_CONFIG_COMMENT, &comment) == 0)
- (void) printf(gettext("comment: %s\n"), comment);
-
/*
* If the state is "closed" or "can't open", and the aux state
* is "corrupt data":
@@ -1589,10 +1474,10 @@ show_import(nvlist_t *config)
}
if (msgid != NULL)
- (void) printf(gettext(" see: http://illumos.org/msg/%s\n"),
+ (void) printf(gettext(" see: http://www.sun.com/msg/%s\n"),
msgid);
- (void) printf(gettext(" config:\n\n"));
+ (void) printf(gettext("config:\n\n"));
namewidth = max_width(NULL, nvroot, 0, 0);
if (namewidth < 10)
@@ -1630,9 +1515,9 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,
ZPOOL_CONFIG_POOL_STATE, &state) == 0);
verify(nvlist_lookup_uint64(config,
ZPOOL_CONFIG_VERSION, &version) == 0);
- if (!SPA_VERSION_IS_SUPPORTED(version)) {
+ if (version > SPA_VERSION) {
(void) fprintf(stderr, gettext("cannot import '%s': pool "
- "is formatted using an unsupported ZFS version\n"), name);
+ "is formatted using a newer ZFS version\n"), name);
return (1);
} else if (state != POOL_STATE_EXPORTED &&
!(flags & ZFS_IMPORT_ANY_HOST)) {
@@ -2081,10 +1966,10 @@ error:
}
typedef struct iostat_cbdata {
- boolean_t cb_verbose;
- int cb_namewidth;
- int cb_iteration;
zpool_list_t *cb_list;
+ int cb_verbose;
+ int cb_iteration;
+ int cb_namewidth;
} iostat_cbdata_t;
static void
@@ -2193,15 +2078,10 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
return;
for (c = 0; c < children; c++) {
- uint64_t ishole = B_FALSE, islog = B_FALSE;
-
- (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_HOLE,
- &ishole);
-
- (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_LOG,
- &islog);
+ uint64_t ishole = B_FALSE;
- if (ishole || islog)
+ if (nvlist_lookup_uint64(newchild[c],
+ ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole)
continue;
vname = zpool_vdev_name(g_zfs, zhp, newchild[c], B_FALSE);
@@ -2211,31 +2091,6 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
}
/*
- * Log device section
- */
-
- if (num_logs(newnv) > 0) {
- (void) printf("%-*s - - - - - "
- "-\n", cb->cb_namewidth, "logs");
-
- for (c = 0; c < children; c++) {
- uint64_t islog = B_FALSE;
- (void) nvlist_lookup_uint64(newchild[c],
- ZPOOL_CONFIG_IS_LOG, &islog);
-
- if (islog) {
- vname = zpool_vdev_name(g_zfs, zhp, newchild[c],
- B_FALSE);
- print_vdev_stats(zhp, vname, oldnv ?
- oldchild[c] : NULL, newchild[c],
- cb, depth + 2);
- free(vname);
- }
- }
-
- }
-
- /*
* Include level 2 ARC devices in iostat output
*/
if (nvlist_lookup_nvlist_array(newnv, ZPOOL_CONFIG_L2CACHE,
@@ -2324,8 +2179,7 @@ get_namewidth(zpool_handle_t *zhp, void *data)
if (!cb->cb_verbose)
cb->cb_namewidth = strlen(zpool_get_name(zhp));
else
- cb->cb_namewidth = max_width(zhp, nvroot, 0,
- cb->cb_namewidth);
+ cb->cb_namewidth = max_width(zhp, nvroot, 0, 0);
}
/*
@@ -2554,9 +2408,8 @@ zpool_do_iostat(int argc, char **argv)
}
typedef struct list_cbdata {
- boolean_t cb_verbose;
- int cb_namewidth;
boolean_t cb_scripted;
+ boolean_t cb_first;
zprop_list_t *cb_proplist;
} list_cbdata_t;
@@ -2564,50 +2417,30 @@ typedef struct list_cbdata {
* Given a list of columns to display, output appropriate headers for each one.
*/
static void
-print_header(list_cbdata_t *cb)
+print_header(zprop_list_t *pl)
{
- zprop_list_t *pl = cb->cb_proplist;
- char headerbuf[ZPOOL_MAXPROPLEN];
const char *header;
boolean_t first = B_TRUE;
boolean_t right_justify;
- size_t width = 0;
for (; pl != NULL; pl = pl->pl_next) {
- width = pl->pl_width;
- if (first && cb->cb_verbose) {
- /*
- * Reset the width to accommodate the verbose listing
- * of devices.
- */
- width = cb->cb_namewidth;
- }
+ if (pl->pl_prop == ZPROP_INVAL)
+ continue;
if (!first)
(void) printf(" ");
else
first = B_FALSE;
- right_justify = B_FALSE;
- if (pl->pl_prop != ZPROP_INVAL) {
- header = zpool_prop_column_name(pl->pl_prop);
- right_justify = zpool_prop_align_right(pl->pl_prop);
- } else {
- int i;
-
- for (i = 0; pl->pl_user_prop[i] != '\0'; i++)
- headerbuf[i] = toupper(pl->pl_user_prop[i]);
- headerbuf[i] = '\0';
- header = headerbuf;
- }
+ header = zpool_prop_column_name(pl->pl_prop);
+ right_justify = zpool_prop_align_right(pl->pl_prop);
if (pl->pl_next == NULL && !right_justify)
(void) printf("%s", header);
else if (right_justify)
- (void) printf("%*s", width, header);
+ (void) printf("%*s", pl->pl_width, header);
else
- (void) printf("%-*s", width, header);
-
+ (void) printf("%-*s", pl->pl_width, header);
}
(void) printf("\n");
@@ -2618,28 +2451,17 @@ print_header(list_cbdata_t *cb)
* to the described layout.
*/
static void
-print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
+print_pool(zpool_handle_t *zhp, zprop_list_t *pl, int scripted)
{
- zprop_list_t *pl = cb->cb_proplist;
boolean_t first = B_TRUE;
char property[ZPOOL_MAXPROPLEN];
char *propstr;
boolean_t right_justify;
- size_t width;
+ int width;
for (; pl != NULL; pl = pl->pl_next) {
-
- width = pl->pl_width;
- if (first && cb->cb_verbose) {
- /*
- * Reset the width to accommodate the verbose listing
- * of devices.
- */
- width = cb->cb_namewidth;
- }
-
if (!first) {
- if (cb->cb_scripted)
+ if (scripted)
(void) printf("\t");
else
(void) printf(" ");
@@ -2649,32 +2471,25 @@ print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
right_justify = B_FALSE;
if (pl->pl_prop != ZPROP_INVAL) {
- if (pl->pl_prop == ZPOOL_PROP_EXPANDSZ &&
- zpool_get_prop_int(zhp, pl->pl_prop, NULL) == 0)
- propstr = "-";
- else if (zpool_get_prop(zhp, pl->pl_prop, property,
+ if (zpool_get_prop(zhp, pl->pl_prop, property,
sizeof (property), NULL) != 0)
propstr = "-";
else
propstr = property;
right_justify = zpool_prop_align_right(pl->pl_prop);
- } else if ((zpool_prop_feature(pl->pl_user_prop) ||
- zpool_prop_unsupported(pl->pl_user_prop)) &&
- zpool_prop_get_feature(zhp, pl->pl_user_prop, property,
- sizeof (property)) == 0) {
- propstr = property;
} else {
propstr = "-";
}
+ width = pl->pl_width;
/*
* If this is being called in scripted mode, or if this is the
* last column and it is left-justified, don't include a width
* format specifier.
*/
- if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify))
+ if (scripted || (pl->pl_next == NULL && !right_justify))
(void) printf("%s", propstr);
else if (right_justify)
(void) printf("%*s", width, propstr);
@@ -2685,101 +2500,6 @@ print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
(void) printf("\n");
}
-static void
-print_one_column(zpool_prop_t prop, uint64_t value, boolean_t scripted)
-{
- char propval[64];
- 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));
-
- if (scripted)
- (void) printf("\t%s", propval);
- else
- (void) printf(" %*s", width, propval);
-}
-
-void
-print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
- list_cbdata_t *cb, int depth)
-{
- nvlist_t **child;
- vdev_stat_t *vs;
- uint_t c, children;
- char *vname;
- boolean_t scripted = cb->cb_scripted;
-
- verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
- (uint64_t **)&vs, &c) == 0);
-
- if (name != NULL) {
- if (scripted)
- (void) printf("\t%s", name);
- else if (strlen(name) + depth > cb->cb_namewidth)
- (void) printf("%*s%s", depth, "", name);
- else
- (void) printf("%*s%s%*s", depth, "", name,
- (int)(cb->cb_namewidth - strlen(name) - depth), "");
-
- /* only toplevel vdevs have capacity stats */
- if (vs->vs_space == 0) {
- if (scripted)
- (void) printf("\t-\t-\t-");
- else
- (void) printf(" - - -");
- } else {
- print_one_column(ZPOOL_PROP_SIZE, vs->vs_space,
- scripted);
- print_one_column(ZPOOL_PROP_CAPACITY, vs->vs_alloc,
- scripted);
- print_one_column(ZPOOL_PROP_FREE,
- vs->vs_space - vs->vs_alloc, scripted);
- }
- print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize,
- scripted);
- (void) printf("\n");
- }
-
- if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
- &child, &children) != 0)
- return;
-
- for (c = 0; c < children; c++) {
- uint64_t ishole = B_FALSE;
-
- if (nvlist_lookup_uint64(child[c],
- ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole)
- continue;
-
- vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE);
- print_list_stats(zhp, vname, child[c], cb, depth + 2);
- free(vname);
- }
-
- /*
- * Include level 2 ARC devices in iostat output
- */
- if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
- &child, &children) != 0)
- return;
-
- if (children > 0) {
- (void) printf("%-*s - - - - - "
- "-\n", cb->cb_namewidth, "cache");
- for (c = 0; c < children; c++) {
- vname = zpool_vdev_name(g_zfs, zhp, child[c],
- B_FALSE);
- print_list_stats(zhp, vname, child[c], cb, depth + 2);
- free(vname);
- }
- }
-}
-
-
/*
* Generic callback function to list a pool.
*/
@@ -2787,18 +2507,14 @@ int
list_callback(zpool_handle_t *zhp, void *data)
{
list_cbdata_t *cbp = data;
- nvlist_t *config;
- nvlist_t *nvroot;
- config = zpool_get_config(zhp, NULL);
-
- print_pool(zhp, cbp);
- if (!cbp->cb_verbose)
- return (0);
+ if (cbp->cb_first) {
+ if (!cbp->cb_scripted)
+ print_header(cbp->cb_proplist);
+ cbp->cb_first = B_FALSE;
+ }
- verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
- &nvroot) == 0);
- print_list_stats(zhp, NULL, nvroot, cbp, 0);
+ print_pool(zhp, cbp->cb_proplist, cbp->cb_scripted);
return (0);
}
@@ -2822,15 +2538,12 @@ 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,capacity,dedupratio,health,altroot";
char *props = default_props;
unsigned long interval = 0, count = 0;
- zpool_list_t *list;
- boolean_t first = B_TRUE;
/* check options */
- while ((c = getopt(argc, argv, ":Ho:T:v")) != -1) {
+ while ((c = getopt(argc, argv, ":Ho:T:")) != -1) {
switch (c) {
case 'H':
cb.cb_scripted = B_TRUE;
@@ -2841,9 +2554,6 @@ zpool_do_list(int argc, char **argv)
case 'T':
get_timestamp_arg(*optarg);
break;
- case 'v':
- cb.cb_verbose = B_TRUE;
- break;
case ':':
(void) fprintf(stderr, gettext("missing argument for "
"'%c' option\n"), optopt);
@@ -2864,32 +2574,21 @@ 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);
- }
+ cb.cb_first = B_TRUE;
for (;;) {
- pool_list_update(list);
-
- if (pool_list_count(list) == 0)
- break;
-
- cb.cb_namewidth = 0;
- (void) pool_list_iter(list, B_FALSE, get_namewidth, &cb);
if (timestamp_fmt != NODATE)
print_timestamp(timestamp_fmt);
- if (!cb.cb_scripted && (first || cb.cb_verbose)) {
- print_header(&cb);
- first = B_FALSE;
+ ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist,
+ list_callback, &cb);
+
+ if (argc == 0 && cb.cb_first && !cb.cb_scripted) {
+ (void) printf(gettext("no pools available\n"));
+ zprop_free_list(cb.cb_proplist);
+ return (0);
}
- ret = pool_list_iter(list, B_TRUE, list_callback, &cb);
if (interval == 0)
break;
@@ -3463,82 +3162,6 @@ zpool_do_clear(int argc, char **argv)
return (ret);
}
-/*
- * zpool reguid <pool>
- */
-int
-zpool_do_reguid(int argc, char **argv)
-{
- int c;
- char *poolname;
- zpool_handle_t *zhp;
- int ret = 0;
-
- /* check options */
- while ((c = getopt(argc, argv, "")) != -1) {
- switch (c) {
- case '?':
- (void) fprintf(stderr, gettext("invalid option '%c'\n"),
- optopt);
- usage(B_FALSE);
- }
- }
-
- argc -= optind;
- argv += optind;
-
- /* get pool name and check number of arguments */
- if (argc < 1) {
- (void) fprintf(stderr, gettext("missing pool name\n"));
- usage(B_FALSE);
- }
-
- if (argc > 1) {
- (void) fprintf(stderr, gettext("too many arguments\n"));
- usage(B_FALSE);
- }
-
- poolname = argv[0];
- if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
- return (1);
-
- ret = zpool_reguid(zhp);
-
- zpool_close(zhp);
- return (ret);
-}
-
-
-/*
- * zpool reopen <pool>
- *
- * Reopen the pool so that the kernel can update the sizes of all vdevs.
- *
- * NOTE: This command is currently undocumented. If the command is ever
- * exposed then the appropriate usage() messages will need to be made.
- */
-int
-zpool_do_reopen(int argc, char **argv)
-{
- int ret = 0;
- zpool_handle_t *zhp;
- char *pool;
-
- argc--;
- argv++;
-
- if (argc != 1)
- return (2);
-
- pool = argv[0];
- if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL)
- return (1);
-
- ret = zpool_reopen(zhp);
- zpool_close(zhp);
- return (ret);
-}
-
typedef struct scrub_cbdata {
int cb_type;
int cb_argc;
@@ -3626,7 +3249,7 @@ print_scan_status(pool_scan_stat_t *ps)
double fraction_done;
char processed_buf[7], examined_buf[7], total_buf[7], rate_buf[7];
- (void) printf(gettext(" scan: "));
+ (void) printf(gettext(" scan: "));
/* If there's never been a scan, there's not much to say. */
if (ps == NULL || ps->pss_func == POOL_SCAN_NONE ||
@@ -3810,20 +3433,14 @@ print_dedup_stats(nvlist_t *config)
/*
* If the pool was faulted then we may not have been able to
- * obtain the config. Otherwise, if we have anything in the dedup
+ * obtain the config. Otherwise, if have anything in the dedup
* table continue processing the stats.
*/
if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS,
- (uint64_t **)&ddo, &c) != 0)
+ (uint64_t **)&ddo, &c) != 0 || ddo->ddo_count == 0)
return;
(void) printf("\n");
- (void) printf(gettext(" dedup: "));
- if (ddo->ddo_count == 0) {
- (void) printf(gettext("no DDT entries\n"));
- return;
- }
-
(void) printf("DDT entries %llu, size %llu on disk, %llu in core\n",
(u_longlong_t)ddo->ddo_count,
(u_longlong_t)ddo->ddo_dspace,
@@ -3842,7 +3459,7 @@ print_dedup_stats(nvlist_t *config)
* pool: tank
* status: DEGRADED
* reason: One or more devices ...
- * see: http://illumos.org/msg/ZFS-xxxx-01
+ * see: http://www.sun.com/msg/ZFS-xxxx-01
* config:
* mirror DEGRADED
* c1t0d0 OK
@@ -4003,31 +3620,6 @@ status_callback(zpool_handle_t *zhp, void *data)
"backup.\n"));
break;
- case ZPOOL_STATUS_UNSUP_FEAT_READ:
- (void) printf(gettext("status: The pool cannot be accessed on "
- "this system because it uses the\n\tfollowing feature(s) "
- "not supported on this system:\n"));
- zpool_print_unsup_feat(config);
- (void) printf("\n");
- (void) printf(gettext("action: Access the pool from a system "
- "that supports the required feature(s),\n\tor restore the "
- "pool from backup.\n"));
- break;
-
- case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
- (void) printf(gettext("status: The pool can only be accessed "
- "in read-only mode on this system. It\n\tcannot be "
- "accessed in read-write mode because it uses the "
- "following\n\tfeature(s) not supported on this system:\n"));
- zpool_print_unsup_feat(config);
- (void) printf("\n");
- (void) printf(gettext("action: The pool cannot be accessed in "
- "read-write mode. Import the pool with\n"
- "\t\"-o readonly=on\", access the pool from a system that "
- "supports the\n\trequired feature(s), or restore the "
- "pool from backup.\n"));
- break;
-
case ZPOOL_STATUS_FAULTED_DEV_R:
(void) printf(gettext("status: One or more devices are "
"faulted in response to persistent errors.\n\tSufficient "
@@ -4075,7 +3667,7 @@ status_callback(zpool_handle_t *zhp, void *data)
}
if (msgid != NULL)
- (void) printf(gettext(" see: http://illumos.org/msg/%s\n"),
+ (void) printf(gettext(" see: http://www.sun.com/msg/%s\n"),
msgid);
if (config != NULL) {
@@ -4252,8 +3844,7 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
&version) == 0);
- if (!cbp->cb_newer && SPA_VERSION_IS_SUPPORTED(version) &&
- version != SPA_VERSION) {
+ if (!cbp->cb_newer && version < SPA_VERSION) {
if (!cbp->cb_all) {
if (cbp->cb_first) {
(void) printf(gettext("The following pools are "
@@ -4275,23 +3866,14 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
(void) printf(gettext("Successfully upgraded "
"'%s'\n\n"), zpool_get_name(zhp));
}
- /*
- * If they did "zpool upgrade -a", then we could
- * be doing ioctls to different pools. We need
- * to log this history once to each pool, and bypass
- * the normal history logging that happens in main().
- */
- (void) zpool_log_history(g_zfs, history_str);
- log_history = B_FALSE;
}
- } else if (cbp->cb_newer && !SPA_VERSION_IS_SUPPORTED(version)) {
+ } else if (cbp->cb_newer && version > SPA_VERSION) {
assert(!cbp->cb_all);
if (cbp->cb_first) {
(void) printf(gettext("The following pools are "
- "formatted using an unsupported software version "
- "and\ncannot be accessed on the current "
- "system.\n\n"));
+ "formatted using a newer software version and\n"
+ "cannot be accessed on the current system.\n\n"));
(void) printf(gettext("VER POOL\n"));
(void) printf(gettext("--- ------------\n"));
cbp->cb_first = B_FALSE;
@@ -4375,8 +3957,8 @@ zpool_do_upgrade(int argc, char **argv)
break;
case 'V':
cb.cb_version = strtoll(optarg, &end, 10);
- if (*end != '\0' ||
- !SPA_VERSION_IS_SUPPORTED(cb.cb_version)) {
+ if (*end != '\0' || cb.cb_version > SPA_VERSION ||
+ cb.cb_version < SPA_VERSION_1) {
(void) fprintf(stderr,
gettext("invalid version '%s'\n"), optarg);
usage(B_FALSE);
@@ -4421,8 +4003,8 @@ zpool_do_upgrade(int argc, char **argv)
}
}
- (void) printf(gettext("This system supports ZFS pool feature "
- "flags.\n\n"));
+ (void) printf(gettext("This system is currently running "
+ "ZFS pool version %llu.\n\n"), SPA_VERSION);
cb.cb_first = B_TRUE;
if (showversions) {
(void) printf(gettext("The following versions are "
@@ -4505,8 +4087,8 @@ zpool_do_upgrade(int argc, char **argv)
typedef struct hist_cbdata {
boolean_t first;
- boolean_t longfmt;
- boolean_t internal;
+ int longfmt;
+ int internal;
} hist_cbdata_t;
/*
@@ -4518,8 +4100,21 @@ get_history_one(zpool_handle_t *zhp, void *data)
nvlist_t *nvhis;
nvlist_t **records;
uint_t numrecords;
+ char *cmdstr;
+ char *pathstr;
+ uint64_t dst_time;
+ time_t tsec;
+ struct tm t;
+ char tbuf[30];
int ret, i;
+ uint64_t who;
+ struct passwd *pwd;
+ char *hostname;
+ char *zonename;
+ char internalstr[MAXPATHLEN];
hist_cbdata_t *cb = (hist_cbdata_t *)data;
+ uint64_t txg;
+ uint64_t ievent;
cb->first = B_FALSE;
@@ -4531,94 +4126,64 @@ get_history_one(zpool_handle_t *zhp, void *data)
verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD,
&records, &numrecords) == 0);
for (i = 0; i < numrecords; i++) {
- nvlist_t *rec = records[i];
- char tbuf[30] = "";
-
- if (nvlist_exists(rec, ZPOOL_HIST_TIME)) {
- time_t tsec;
- struct tm t;
-
- tsec = fnvlist_lookup_uint64(records[i],
- ZPOOL_HIST_TIME);
- (void) localtime_r(&tsec, &t);
- (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t);
- }
+ if (nvlist_lookup_uint64(records[i], ZPOOL_HIST_TIME,
+ &dst_time) != 0)
+ continue;
- if (nvlist_exists(rec, ZPOOL_HIST_CMD)) {
- (void) printf("%s %s", tbuf,
- fnvlist_lookup_string(rec, ZPOOL_HIST_CMD));
- } else if (nvlist_exists(rec, ZPOOL_HIST_INT_EVENT)) {
- int ievent =
- fnvlist_lookup_uint64(rec, ZPOOL_HIST_INT_EVENT);
- if (!cb->internal)
- continue;
- if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) {
- (void) printf("%s unrecognized record:\n",
- tbuf);
- dump_nvlist(rec, 4);
- continue;
- }
- (void) printf("%s [internal %s txg:%lld] %s", tbuf,
- zfs_history_event_names[ievent],
- fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG),
- fnvlist_lookup_string(rec, ZPOOL_HIST_INT_STR));
- } else if (nvlist_exists(rec, ZPOOL_HIST_INT_NAME)) {
- if (!cb->internal)
+ /* is it an internal event or a standard event? */
+ if (nvlist_lookup_string(records[i], ZPOOL_HIST_CMD,
+ &cmdstr) != 0) {
+ if (cb->internal == 0)
continue;
- (void) printf("%s [txg:%lld] %s", tbuf,
- fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG),
- fnvlist_lookup_string(rec, ZPOOL_HIST_INT_NAME));
- if (nvlist_exists(rec, ZPOOL_HIST_DSNAME)) {
- (void) printf(" %s (%llu)",
- fnvlist_lookup_string(rec,
- ZPOOL_HIST_DSNAME),
- fnvlist_lookup_uint64(rec,
- ZPOOL_HIST_DSID));
- }
- (void) printf(" %s", fnvlist_lookup_string(rec,
- ZPOOL_HIST_INT_STR));
- } else if (nvlist_exists(rec, ZPOOL_HIST_IOCTL)) {
- if (!cb->internal)
+
+ if (nvlist_lookup_uint64(records[i],
+ ZPOOL_HIST_INT_EVENT, &ievent) != 0)
continue;
- (void) printf("%s ioctl %s\n", tbuf,
- fnvlist_lookup_string(rec, ZPOOL_HIST_IOCTL));
- if (nvlist_exists(rec, ZPOOL_HIST_INPUT_NVL)) {
- (void) printf(" input:\n");
- dump_nvlist(fnvlist_lookup_nvlist(rec,
- ZPOOL_HIST_INPUT_NVL), 8);
- }
- if (nvlist_exists(rec, ZPOOL_HIST_OUTPUT_NVL)) {
- (void) printf(" output:\n");
- dump_nvlist(fnvlist_lookup_nvlist(rec,
- ZPOOL_HIST_OUTPUT_NVL), 8);
- }
- } else {
- if (!cb->internal)
+ verify(nvlist_lookup_uint64(records[i],
+ ZPOOL_HIST_TXG, &txg) == 0);
+ verify(nvlist_lookup_string(records[i],
+ ZPOOL_HIST_INT_STR, &pathstr) == 0);
+ if (ievent >= LOG_END)
continue;
- (void) printf("%s unrecognized record:\n", tbuf);
- dump_nvlist(rec, 4);
+ (void) snprintf(internalstr,
+ sizeof (internalstr),
+ "[internal %s txg:%lld] %s",
+ zfs_history_event_names[ievent], txg,
+ pathstr);
+ cmdstr = internalstr;
}
+ tsec = dst_time;
+ (void) localtime_r(&tsec, &t);
+ (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t);
+ (void) printf("%s %s", tbuf, cmdstr);
if (!cb->longfmt) {
(void) printf("\n");
continue;
}
(void) printf(" [");
- if (nvlist_exists(rec, ZPOOL_HIST_WHO)) {
- uid_t who = fnvlist_lookup_uint64(rec, ZPOOL_HIST_WHO);
- struct passwd *pwd = getpwuid(who);
- (void) printf("user %d ", (int)who);
- if (pwd != NULL)
- (void) printf("(%s) ", pwd->pw_name);
+ if (nvlist_lookup_uint64(records[i],
+ ZPOOL_HIST_WHO, &who) == 0) {
+ pwd = getpwuid((uid_t)who);
+ if (pwd)
+ (void) printf("user %s on",
+ pwd->pw_name);
+ else
+ (void) printf("user %d on",
+ (int)who);
+ } else {
+ (void) printf(gettext("no info]\n"));
+ continue;
}
- if (nvlist_exists(rec, ZPOOL_HIST_HOST)) {
- (void) printf("on %s",
- fnvlist_lookup_string(rec, ZPOOL_HIST_HOST));
+ if (nvlist_lookup_string(records[i],
+ ZPOOL_HIST_HOST, &hostname) == 0) {
+ (void) printf(" %s", hostname);
}
- if (nvlist_exists(rec, ZPOOL_HIST_ZONE)) {
- (void) printf(":%s",
- fnvlist_lookup_string(rec, ZPOOL_HIST_ZONE));
+ if (nvlist_lookup_string(records[i],
+ ZPOOL_HIST_ZONE, &zonename) == 0) {
+ (void) printf(":%s", zonename);
}
+
(void) printf("]");
(void) printf("\n");
}
@@ -4633,6 +4198,8 @@ get_history_one(zpool_handle_t *zhp, void *data)
*
* Displays the history of commands that modified pools.
*/
+
+
int
zpool_do_history(int argc, char **argv)
{
@@ -4645,10 +4212,10 @@ zpool_do_history(int argc, char **argv)
while ((c = getopt(argc, argv, "li")) != -1) {
switch (c) {
case 'l':
- cbdata.longfmt = B_TRUE;
+ cbdata.longfmt = 1;
break;
case 'i':
- cbdata.internal = B_TRUE;
+ cbdata.internal = 1;
break;
case '?':
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
@@ -4688,26 +4255,13 @@ get_callback(zpool_handle_t *zhp, void *data)
pl == cbp->cb_proplist)
continue;
- if (pl->pl_prop == ZPROP_INVAL &&
- (zpool_prop_feature(pl->pl_user_prop) ||
- zpool_prop_unsupported(pl->pl_user_prop))) {
- srctype = ZPROP_SRC_LOCAL;
-
- if (zpool_prop_get_feature(zhp, pl->pl_user_prop,
- value, sizeof (value)) == 0) {
- zprop_print_one_property(zpool_get_name(zhp),
- cbp, pl->pl_user_prop, value, srctype,
- NULL, NULL);
- }
- } else {
- if (zpool_get_prop(zhp, pl->pl_prop, value,
- sizeof (value), &srctype) != 0)
- continue;
+ if (zpool_get_prop(zhp, pl->pl_prop,
+ value, sizeof (value), &srctype) != 0)
+ continue;
- zprop_print_one_property(zpool_get_name(zhp), cbp,
- zpool_prop_to_name(pl->pl_prop), value, srctype,
- NULL, NULL);
- }
+ zprop_print_one_property(zpool_get_name(zhp), cbp,
+ zpool_prop_to_name(pl->pl_prop), value, srctype, NULL,
+ NULL);
}
return (0);
}
@@ -4719,11 +4273,8 @@ zpool_do_get(int argc, char **argv)
zprop_list_t fake_name = { 0 };
int ret;
- if (argc < 2) {
- (void) fprintf(stderr, gettext("missing property "
- "argument\n"));
+ if (argc < 3)
usage(B_FALSE);
- }
cb.cb_first = B_TRUE;
cb.cb_sources = ZPROP_SRC_ALL;
@@ -4733,7 +4284,7 @@ zpool_do_get(int argc, char **argv)
cb.cb_columns[3] = GET_COL_SOURCE;
cb.cb_type = ZFS_TYPE_POOL;
- if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist,
+ if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist,
ZFS_TYPE_POOL) != 0)
usage(B_FALSE);
@@ -4873,7 +4424,8 @@ main(int argc, char **argv)
if (strcmp(cmdname, "-?") == 0)
usage(B_TRUE);
- zfs_save_arguments(argc, argv, history_str, sizeof (history_str));
+ zpool_set_history_str("zpool", argc, argv, history_str);
+ verify(zpool_stage_history(g_zfs, history_str) == 0);
/*
* Run the appropriate command.
@@ -4900,9 +4452,6 @@ main(int argc, char **argv)
usage(B_FALSE);
}
- if (ret == 0 && log_history)
- (void) zpool_log_history(g_zfs, history_str);
-
libzfs_fini(g_zfs);
/*
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 63acd0c3aab8..b2d81b558882 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -20,8 +20,6 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -51,9 +49,7 @@
* At random times, the child self-immolates with a SIGKILL.
* This is the software equivalent of pulling the power cord.
* The parent then runs the test again, using the existing
- * storage pool, as many times as desired. If backwards compatability
- * testing is enabled ztest will sometimes run the "older" version
- * of ztest after a SIGKILL.
+ * storage pool, as many times as desired.
*
* (6) To verify that we don't have future leaks or temporal incursions,
* many of the functional tests record the transaction group number
@@ -70,15 +66,9 @@
* You can ask more more vdevs [-v], datasets [-d], or threads [-t]
* to increase the pool capacity, fanout, and overall stress level.
*
- * Use the -k option to set the desired frequency of kills.
- *
- * When ztest invokes itself it passes all relevant information through a
- * temporary file which is mmap-ed in the child process. This allows shared
- * memory to survive the exec syscall. The ztest_shared_hdr_t struct is always
- * stored at offset 0 of this file and contains information on the size and
- * number of shared structures in the file. The information stored in this file
- * must remain backwards compatible with older versions of ztest so that
- * ztest can invoke them during backwards compatibility testing (-B).
+ * The -N(okill) option will suppress kills, so each child runs to completion.
+ * This can be useful when you're trying to distinguish temporal incursions
+ * from plain old race conditions.
*/
#include <sys/zfs_context.h>
@@ -106,7 +96,6 @@
#include <sys/dsl_scan.h>
#include <sys/zio_checksum.h>
#include <sys/refcount.h>
-#include <sys/zfeature.h>
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
@@ -119,82 +108,28 @@
#include <sys/fs/zfs.h>
#include <libnvpair.h>
-#define ZTEST_FD_DATA 3
-#define ZTEST_FD_RAND 4
-
-typedef struct ztest_shared_hdr {
- uint64_t zh_hdr_size;
- uint64_t zh_opts_size;
- uint64_t zh_size;
- uint64_t zh_stats_size;
- uint64_t zh_stats_count;
- uint64_t zh_ds_size;
- uint64_t zh_ds_count;
-} ztest_shared_hdr_t;
-
-static ztest_shared_hdr_t *ztest_shared_hdr;
-
-typedef struct ztest_shared_opts {
- char zo_pool[MAXNAMELEN];
- char zo_dir[MAXNAMELEN];
- char zo_alt_ztest[MAXNAMELEN];
- char zo_alt_libpath[MAXNAMELEN];
- uint64_t zo_vdevs;
- uint64_t zo_vdevtime;
- size_t zo_vdev_size;
- int zo_ashift;
- int zo_mirrors;
- int zo_raidz;
- int zo_raidz_parity;
- int zo_datasets;
- int zo_threads;
- uint64_t zo_passtime;
- uint64_t zo_killrate;
- int zo_verbose;
- int zo_init;
- uint64_t zo_time;
- uint64_t zo_maxloops;
- uint64_t zo_metaslab_gang_bang;
-} ztest_shared_opts_t;
-
-static const ztest_shared_opts_t ztest_opts_defaults = {
- .zo_pool = { 'z', 't', 'e', 's', 't', '\0' },
- .zo_dir = { '/', 't', 'm', 'p', '\0' },
- .zo_alt_ztest = { '\0' },
- .zo_alt_libpath = { '\0' },
- .zo_vdevs = 5,
- .zo_ashift = SPA_MINBLOCKSHIFT,
- .zo_mirrors = 2,
- .zo_raidz = 4,
- .zo_raidz_parity = 1,
- .zo_vdev_size = SPA_MINDEVSIZE,
- .zo_datasets = 7,
- .zo_threads = 23,
- .zo_passtime = 60, /* 60 seconds */
- .zo_killrate = 70, /* 70% kill rate */
- .zo_verbose = 0,
- .zo_init = 1,
- .zo_time = 300, /* 5 minutes */
- .zo_maxloops = 50, /* max loops during spa_freeze() */
- .zo_metaslab_gang_bang = 32 << 10
-};
-
-extern uint64_t metaslab_gang_bang;
-extern uint64_t metaslab_df_alloc_threshold;
-
-static ztest_shared_opts_t *ztest_shared_opts;
-static ztest_shared_opts_t ztest_opts;
-
-typedef struct ztest_shared_ds {
- uint64_t zd_seq;
-} ztest_shared_ds_t;
-
-static ztest_shared_ds_t *ztest_shared_ds;
-#define ZTEST_GET_SHARED_DS(d) (&ztest_shared_ds[d])
+static char cmdname[] = "ztest";
+static char *zopt_pool = cmdname;
+
+static uint64_t zopt_vdevs = 5;
+static uint64_t zopt_vdevtime;
+static int zopt_ashift = SPA_MINBLOCKSHIFT;
+static int zopt_mirrors = 2;
+static int zopt_raidz = 4;
+static int zopt_raidz_parity = 1;
+static size_t zopt_vdev_size = SPA_MINDEVSIZE;
+static int zopt_datasets = 7;
+static int zopt_threads = 23;
+static uint64_t zopt_passtime = 60; /* 60 seconds */
+static uint64_t zopt_killrate = 70; /* 70% kill rate */
+static int zopt_verbose = 0;
+static int zopt_init = 1;
+static char *zopt_dir = "/tmp";
+static uint64_t zopt_time = 300; /* 5 minutes */
+static uint64_t zopt_maxloops = 50; /* max loops during spa_freeze() */
#define BT_MAGIC 0x123456789abcdefULL
-#define MAXFAULTS() \
- (MAX(zs->zs_mirrors, 1) * (ztest_opts.zo_raidz_parity + 1) - 1)
+#define MAXFAULTS() (MAX(zs->zs_mirrors, 1) * (zopt_raidz_parity + 1) - 1)
enum ztest_io_type {
ZTEST_IO_WRITE_TAG,
@@ -266,10 +201,9 @@ typedef struct ztest_od {
* Per-dataset state.
*/
typedef struct ztest_ds {
- ztest_shared_ds_t *zd_shared;
objset_t *zd_os;
- rwlock_t zd_zilog_lock;
zilog_t *zd_zilog;
+ uint64_t zd_seq;
ztest_od_t *zd_od; /* debugging aid */
char zd_name[MAXNAMELEN];
mutex_t zd_dirobj_lock;
@@ -286,17 +220,11 @@ typedef struct ztest_info {
ztest_func_t *zi_func; /* test function */
uint64_t zi_iters; /* iterations per execution */
uint64_t *zi_interval; /* execute every <interval> seconds */
+ uint64_t zi_call_count; /* per-pass count */
+ uint64_t zi_call_time; /* per-pass time */
+ uint64_t zi_call_next; /* next time to call this function */
} ztest_info_t;
-typedef struct ztest_shared_callstate {
- uint64_t zc_count; /* per-pass count */
- uint64_t zc_time; /* per-pass time */
- uint64_t zc_next; /* next time to call this function */
-} ztest_shared_callstate_t;
-
-static ztest_shared_callstate_t *ztest_shared_callstate;
-#define ZTEST_GET_SHARED_CALLSTATE(c) (&ztest_shared_callstate[c])
-
/*
* Note: these aren't static because we want dladdr() to work.
*/
@@ -307,7 +235,6 @@ ztest_func_t ztest_dmu_commit_callbacks;
ztest_func_t ztest_zap;
ztest_func_t ztest_zap_parallel;
ztest_func_t ztest_zil_commit;
-ztest_func_t ztest_zil_remount;
ztest_func_t ztest_dmu_read_write_zcopy;
ztest_func_t ztest_dmu_objset_create_destroy;
ztest_func_t ztest_dmu_prealloc;
@@ -327,7 +254,6 @@ ztest_func_t ztest_vdev_LUN_growth;
ztest_func_t ztest_vdev_add_remove;
ztest_func_t ztest_vdev_aux_add_remove;
ztest_func_t ztest_split_pool;
-ztest_func_t ztest_reguid;
uint64_t zopt_always = 0ULL * NANOSEC; /* all the time */
uint64_t zopt_incessant = 1ULL * NANOSEC / 10; /* every 1/10 second */
@@ -344,7 +270,6 @@ ztest_info_t ztest_info[] = {
{ ztest_zap_parallel, 100, &zopt_always },
{ ztest_split_pool, 1, &zopt_always },
{ ztest_zil_commit, 1, &zopt_incessant },
- { ztest_zil_remount, 1, &zopt_sometimes },
{ ztest_dmu_read_write_zcopy, 1, &zopt_often },
{ ztest_dmu_objset_create_destroy, 1, &zopt_often },
{ ztest_dsl_prop_get_set, 1, &zopt_often },
@@ -358,16 +283,13 @@ ztest_info_t ztest_info[] = {
{ ztest_fault_inject, 1, &zopt_sometimes },
{ ztest_ddt_repair, 1, &zopt_sometimes },
{ ztest_dmu_snapshot_hold, 1, &zopt_sometimes },
- { ztest_reguid, 1, &zopt_sometimes },
{ ztest_spa_rename, 1, &zopt_rarely },
{ ztest_scrub, 1, &zopt_rarely },
{ ztest_dsl_dataset_promote_busy, 1, &zopt_rarely },
{ ztest_vdev_attach_detach, 1, &zopt_rarely },
{ ztest_vdev_LUN_growth, 1, &zopt_rarely },
- { ztest_vdev_add_remove, 1,
- &ztest_opts.zo_vdevtime },
- { ztest_vdev_aux_add_remove, 1,
- &ztest_opts.zo_vdevtime },
+ { ztest_vdev_add_remove, 1, &zopt_vdevtime },
+ { ztest_vdev_aux_add_remove, 1, &zopt_vdevtime },
};
#define ZTEST_FUNCS (sizeof (ztest_info) / sizeof (ztest_info_t))
@@ -385,7 +307,8 @@ typedef struct ztest_cb_list {
* Stuff we need to share writably between parent and child.
*/
typedef struct ztest_shared {
- boolean_t zs_do_init;
+ char *zs_pool;
+ spa_t *zs_spa;
hrtime_t zs_proc_start;
hrtime_t zs_proc_stop;
hrtime_t zs_thread_start;
@@ -396,11 +319,12 @@ typedef struct ztest_shared {
uint64_t zs_vdev_aux;
uint64_t zs_alloc;
uint64_t zs_space;
+ mutex_t zs_vdev_lock;
+ rwlock_t zs_name_lock;
+ ztest_info_t zs_info[ZTEST_FUNCS];
uint64_t zs_splits;
uint64_t zs_mirrors;
- uint64_t zs_metaslab_sz;
- uint64_t zs_metaslab_df_alloc_threshold;
- uint64_t zs_guid;
+ ztest_ds_t zs_zd[];
} ztest_shared_t;
#define ID_PARALLEL -1ULL
@@ -408,19 +332,20 @@ typedef struct ztest_shared {
static char ztest_dev_template[] = "%s/%s.%llua";
static char ztest_aux_template[] = "%s/%s.%s.%llu";
ztest_shared_t *ztest_shared;
+uint64_t *ztest_seq;
-static spa_t *ztest_spa = NULL;
-static ztest_ds_t *ztest_ds;
+static int ztest_random_fd;
+static int ztest_dump_core = 1;
-static mutex_t ztest_vdev_lock;
-static rwlock_t ztest_name_lock;
-
-static boolean_t ztest_dump_core = B_TRUE;
static boolean_t ztest_exiting;
/* Global commit callback list */
static ztest_cb_list_t zcl;
+extern uint64_t metaslab_gang_bang;
+extern uint64_t metaslab_df_alloc_threshold;
+static uint64_t metaslab_sz;
+
enum ztest_object {
ZTEST_META_DNODE = 0,
ZTEST_DIROBJ,
@@ -533,14 +458,12 @@ nicenumtoull(const char *buf)
static void
usage(boolean_t requested)
{
- const ztest_shared_opts_t *zo = &ztest_opts_defaults;
-
char nice_vdev_size[10];
char nice_gang_bang[10];
FILE *fp = requested ? stdout : stderr;
- nicenum(zo->zo_vdev_size, nice_vdev_size);
- nicenum(zo->zo_metaslab_gang_bang, nice_gang_bang);
+ nicenum(zopt_vdev_size, nice_vdev_size);
+ nicenum(metaslab_gang_bang, nice_gang_bang);
(void) fprintf(fp, "Usage: %s\n"
"\t[-v vdevs (default: %llu)]\n"
@@ -561,43 +484,39 @@ usage(boolean_t requested)
"\t[-T time (default: %llu sec)] total run time\n"
"\t[-F freezeloops (default: %llu)] max loops in spa_freeze()\n"
"\t[-P passtime (default: %llu sec)] time per pass\n"
- "\t[-B alt_ztest (default: <none>)] alternate ztest path\n"
"\t[-h] (print help)\n"
"",
- zo->zo_pool,
- (u_longlong_t)zo->zo_vdevs, /* -v */
+ cmdname,
+ (u_longlong_t)zopt_vdevs, /* -v */
nice_vdev_size, /* -s */
- zo->zo_ashift, /* -a */
- zo->zo_mirrors, /* -m */
- zo->zo_raidz, /* -r */
- zo->zo_raidz_parity, /* -R */
- zo->zo_datasets, /* -d */
- zo->zo_threads, /* -t */
+ zopt_ashift, /* -a */
+ zopt_mirrors, /* -m */
+ zopt_raidz, /* -r */
+ zopt_raidz_parity, /* -R */
+ zopt_datasets, /* -d */
+ zopt_threads, /* -t */
nice_gang_bang, /* -g */
- zo->zo_init, /* -i */
- (u_longlong_t)zo->zo_killrate, /* -k */
- zo->zo_pool, /* -p */
- zo->zo_dir, /* -f */
- (u_longlong_t)zo->zo_time, /* -T */
- (u_longlong_t)zo->zo_maxloops, /* -F */
- (u_longlong_t)zo->zo_passtime);
+ zopt_init, /* -i */
+ (u_longlong_t)zopt_killrate, /* -k */
+ zopt_pool, /* -p */
+ zopt_dir, /* -f */
+ (u_longlong_t)zopt_time, /* -T */
+ (u_longlong_t)zopt_maxloops, /* -F */
+ (u_longlong_t)zopt_passtime); /* -P */
exit(requested ? 0 : 1);
}
static void
process_options(int argc, char **argv)
{
- char *path;
- ztest_shared_opts_t *zo = &ztest_opts;
-
int opt;
uint64_t value;
- char altdir[MAXNAMELEN] = { 0 };
- bcopy(&ztest_opts_defaults, zo, sizeof (*zo));
+ /* By default, test gang blocks for blocks 32K and greater */
+ metaslab_gang_bang = 32 << 10;
while ((opt = getopt(argc, argv,
- "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:B:")) != EOF) {
+ "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:")) != EOF) {
value = 0;
switch (opt) {
case 'v':
@@ -618,71 +537,58 @@ process_options(int argc, char **argv)
}
switch (opt) {
case 'v':
- zo->zo_vdevs = value;
+ zopt_vdevs = value;
break;
case 's':
- zo->zo_vdev_size = MAX(SPA_MINDEVSIZE, value);
+ zopt_vdev_size = MAX(SPA_MINDEVSIZE, value);
break;
case 'a':
- zo->zo_ashift = value;
+ zopt_ashift = value;
break;
case 'm':
- zo->zo_mirrors = value;
+ zopt_mirrors = value;
break;
case 'r':
- zo->zo_raidz = MAX(1, value);
+ zopt_raidz = MAX(1, value);
break;
case 'R':
- zo->zo_raidz_parity = MIN(MAX(value, 1), 3);
+ zopt_raidz_parity = MIN(MAX(value, 1), 3);
break;
case 'd':
- zo->zo_datasets = MAX(1, value);
+ zopt_datasets = MAX(1, value);
break;
case 't':
- zo->zo_threads = MAX(1, value);
+ zopt_threads = MAX(1, value);
break;
case 'g':
- zo->zo_metaslab_gang_bang = MAX(SPA_MINBLOCKSIZE << 1,
- value);
+ metaslab_gang_bang = MAX(SPA_MINBLOCKSIZE << 1, value);
break;
case 'i':
- zo->zo_init = value;
+ zopt_init = value;
break;
case 'k':
- zo->zo_killrate = value;
+ zopt_killrate = value;
break;
case 'p':
- (void) strlcpy(zo->zo_pool, optarg,
- sizeof (zo->zo_pool));
+ zopt_pool = strdup(optarg);
break;
case 'f':
- path = realpath(optarg, NULL);
- if (path == NULL) {
- (void) fprintf(stderr, "error: %s: %s\n",
- optarg, strerror(errno));
- usage(B_FALSE);
- } else {
- (void) strlcpy(zo->zo_dir, path,
- sizeof (zo->zo_dir));
- }
+ zopt_dir = strdup(optarg);
break;
case 'V':
- zo->zo_verbose++;
+ zopt_verbose++;
break;
case 'E':
- zo->zo_init = 0;
+ zopt_init = 0;
break;
case 'T':
- zo->zo_time = value;
+ zopt_time = value;
break;
case 'P':
- zo->zo_passtime = MAX(1, value);
+ zopt_passtime = MAX(1, value);
break;
case 'F':
- zo->zo_maxloops = MAX(1, value);
- break;
- case 'B':
- (void) strlcpy(altdir, optarg, sizeof (altdir));
+ zopt_maxloops = MAX(1, value);
break;
case 'h':
usage(B_TRUE);
@@ -694,59 +600,17 @@ process_options(int argc, char **argv)
}
}
- zo->zo_raidz_parity = MIN(zo->zo_raidz_parity, zo->zo_raidz - 1);
+ zopt_raidz_parity = MIN(zopt_raidz_parity, zopt_raidz - 1);
- zo->zo_vdevtime =
- (zo->zo_vdevs > 0 ? zo->zo_time * NANOSEC / zo->zo_vdevs :
+ zopt_vdevtime = (zopt_vdevs > 0 ? zopt_time * NANOSEC / zopt_vdevs :
UINT64_MAX >> 2);
-
- if (strlen(altdir) > 0) {
- char cmd[MAXNAMELEN];
- char realaltdir[MAXNAMELEN];
- char *bin;
- char *ztest;
- char *isa;
- int isalen;
-
- (void) realpath(getexecname(), cmd);
- if (0 != access(altdir, F_OK)) {
- ztest_dump_core = B_FALSE;
- fatal(B_TRUE, "invalid alternate ztest path: %s",
- altdir);
- }
- VERIFY(NULL != realpath(altdir, realaltdir));
-
- /*
- * 'cmd' should be of the form "<anything>/usr/bin/<isa>/ztest".
- * We want to extract <isa> to determine if we should use
- * 32 or 64 bit binaries.
- */
- bin = strstr(cmd, "/usr/bin/");
- ztest = strstr(bin, "/ztest");
- isa = bin + 9;
- isalen = ztest - isa;
- (void) snprintf(zo->zo_alt_ztest, sizeof (zo->zo_alt_ztest),
- "%s/usr/bin/%.*s/ztest", realaltdir, isalen, isa);
- (void) snprintf(zo->zo_alt_libpath, sizeof (zo->zo_alt_libpath),
- "%s/usr/lib/%.*s", realaltdir, isalen, isa);
-
- if (0 != access(zo->zo_alt_ztest, X_OK)) {
- ztest_dump_core = B_FALSE;
- fatal(B_TRUE, "invalid alternate ztest: %s",
- zo->zo_alt_ztest);
- } else if (0 != access(zo->zo_alt_libpath, X_OK)) {
- ztest_dump_core = B_FALSE;
- fatal(B_TRUE, "invalid alternate lib directory %s",
- zo->zo_alt_libpath);
- }
- }
}
static void
ztest_kill(ztest_shared_t *zs)
{
- zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa));
- zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa));
+ zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(zs->zs_spa));
+ zs->zs_space = metaslab_class_get_space(spa_normal_class(zs->zs_spa));
(void) kill(getpid(), SIGKILL);
}
@@ -758,7 +622,7 @@ ztest_random(uint64_t range)
if (range == 0)
return (0);
- if (read(ZTEST_FD_RAND, &r, sizeof (r)) != sizeof (r))
+ if (read(ztest_random_fd, &r, sizeof (r)) != sizeof (r))
fatal(1, "short read from /dev/urandom");
return (r % range);
@@ -774,9 +638,9 @@ ztest_record_enospc(const char *s)
static uint64_t
ztest_get_ashift(void)
{
- if (ztest_opts.zo_ashift == 0)
+ if (zopt_ashift == 0)
return (SPA_MINBLOCKSHIFT + ztest_random(3));
- return (ztest_opts.zo_ashift);
+ return (zopt_ashift);
}
static nvlist_t *
@@ -794,14 +658,12 @@ make_vdev_file(char *path, char *aux, size_t size, uint64_t ashift)
if (aux != NULL) {
vdev = ztest_shared->zs_vdev_aux;
- (void) snprintf(path, sizeof (pathbuf),
- ztest_aux_template, ztest_opts.zo_dir,
- ztest_opts.zo_pool, aux, vdev);
+ (void) sprintf(path, ztest_aux_template,
+ zopt_dir, zopt_pool, aux, vdev);
} else {
vdev = ztest_shared->zs_vdev_next_leaf++;
- (void) snprintf(path, sizeof (pathbuf),
- ztest_dev_template, ztest_opts.zo_dir,
- ztest_opts.zo_pool, vdev);
+ (void) sprintf(path, ztest_dev_template,
+ zopt_dir, zopt_pool, vdev);
}
}
@@ -839,7 +701,7 @@ make_vdev_raidz(char *path, char *aux, size_t size, uint64_t ashift, int r)
VERIFY(nvlist_add_string(raidz, ZPOOL_CONFIG_TYPE,
VDEV_TYPE_RAIDZ) == 0);
VERIFY(nvlist_add_uint64(raidz, ZPOOL_CONFIG_NPARITY,
- ztest_opts.zo_raidz_parity) == 0);
+ zopt_raidz_parity) == 0);
VERIFY(nvlist_add_nvlist_array(raidz, ZPOOL_CONFIG_CHILDREN,
child, r) == 0);
@@ -977,7 +839,7 @@ ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
VERIFY3U(dsl_prop_get(osname, propname, sizeof (curval),
1, &curval, setpoint), ==, 0);
- if (ztest_opts.zo_verbose >= 6) {
+ if (zopt_verbose >= 6) {
VERIFY(zfs_prop_index_to_string(prop, curval, &valname) == 0);
(void) printf("%s %s = %s at '%s'\n",
osname, propname, valname, setpoint);
@@ -987,9 +849,9 @@ ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
}
static int
-ztest_spa_prop_set_uint64(zpool_prop_t prop, uint64_t value)
+ztest_spa_prop_set_uint64(ztest_shared_t *zs, zpool_prop_t prop, uint64_t value)
{
- spa_t *spa = ztest_spa;
+ spa_t *spa = zs->zs_spa;
nvlist_t *props = NULL;
int error;
@@ -1111,17 +973,13 @@ ztest_range_unlock(rl_t *rl)
}
static void
-ztest_zd_init(ztest_ds_t *zd, ztest_shared_ds_t *szd, objset_t *os)
+ztest_zd_init(ztest_ds_t *zd, objset_t *os)
{
zd->zd_os = os;
zd->zd_zilog = dmu_objset_zil(os);
- zd->zd_shared = szd;
+ zd->zd_seq = 0;
dmu_objset_name(os, zd->zd_name);
- if (zd->zd_shared != NULL)
- zd->zd_shared->zd_seq = 0;
-
- VERIFY(rwlock_init(&zd->zd_zilog_lock, USYNC_THREAD, NULL) == 0);
VERIFY(_mutex_init(&zd->zd_dirobj_lock, USYNC_THREAD, NULL) == 0);
for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++)
@@ -2101,8 +1959,6 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)
if (ztest_random(2) == 0)
io_type = ZTEST_IO_WRITE_TAG;
- (void) rw_rdlock(&zd->zd_zilog_lock);
-
switch (io_type) {
case ZTEST_IO_WRITE_TAG:
@@ -2138,8 +1994,6 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)
break;
}
- (void) rw_unlock(&zd->zd_zilog_lock);
-
umem_free(data, blocksize);
}
@@ -2194,8 +2048,6 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
{
zilog_t *zilog = zd->zd_zilog;
- (void) rw_rdlock(&zd->zd_zilog_lock);
-
zil_commit(zilog, ztest_random(ZTEST_OBJECTS));
/*
@@ -2204,35 +2056,9 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
* will verify that the log really does contain this record.
*/
mutex_enter(&zilog->zl_lock);
- ASSERT(zd->zd_shared != NULL);
- ASSERT3U(zd->zd_shared->zd_seq, <=, zilog->zl_commit_lr_seq);
- zd->zd_shared->zd_seq = zilog->zl_commit_lr_seq;
+ ASSERT(zd->zd_seq <= zilog->zl_commit_lr_seq);
+ zd->zd_seq = zilog->zl_commit_lr_seq;
mutex_exit(&zilog->zl_lock);
-
- (void) rw_unlock(&zd->zd_zilog_lock);
-}
-
-/*
- * This function is designed to simulate the operations that occur during a
- * mount/unmount operation. We hold the dataset across these operations in an
- * attempt to expose any implicit assumptions about ZIL management.
- */
-/* ARGSUSED */
-void
-ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
-{
- objset_t *os = zd->zd_os;
-
- (void) rw_wrlock(&zd->zd_zilog_lock);
-
- /* zfsvfs_teardown() */
- zil_close(zd->zd_zilog);
-
- /* zfsvfs_setup() */
- VERIFY(zil_open(os, ztest_get_data) == zd->zd_zilog);
- zil_replay(os, zd, ztest_replay_vector);
-
- (void) rw_unlock(&zd->zd_zilog_lock);
}
/*
@@ -2243,7 +2069,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
void
ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
{
- ztest_shared_opts_t *zo = &ztest_opts;
+ ztest_shared_t *zs = ztest_shared;
spa_t *spa;
nvlist_t *nvroot;
@@ -2252,7 +2078,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
*/
nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 0, 1);
VERIFY3U(ENOENT, ==,
- spa_create("ztest_bad_file", nvroot, NULL, NULL));
+ spa_create("ztest_bad_file", nvroot, NULL, NULL, NULL));
nvlist_free(nvroot);
/*
@@ -2260,22 +2086,22 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
*/
nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 2, 1);
VERIFY3U(ENOENT, ==,
- spa_create("ztest_bad_mirror", nvroot, NULL, NULL));
+ spa_create("ztest_bad_mirror", nvroot, NULL, NULL, NULL));
nvlist_free(nvroot);
/*
* Attempt to create an existing pool. It shouldn't matter
* what's in the nvroot; we should fail with EEXIST.
*/
- (void) rw_rdlock(&ztest_name_lock);
+ (void) rw_rdlock(&zs->zs_name_lock);
nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 0, 1);
- VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL));
+ VERIFY3U(EEXIST, ==, spa_create(zs->zs_pool, nvroot, NULL, NULL, NULL));
nvlist_free(nvroot);
- VERIFY3U(0, ==, spa_open(zo->zo_pool, &spa, FTAG));
- VERIFY3U(EBUSY, ==, spa_destroy(zo->zo_pool));
+ VERIFY3U(0, ==, spa_open(zs->zs_pool, &spa, FTAG));
+ VERIFY3U(EBUSY, ==, spa_destroy(zs->zs_pool));
spa_close(spa, FTAG);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
static vdev_t *
@@ -2322,15 +2148,14 @@ void
ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
{
ztest_shared_t *zs = ztest_shared;
- spa_t *spa = ztest_spa;
+ spa_t *spa = zs->zs_spa;
uint64_t leaves;
uint64_t guid;
nvlist_t *nvroot;
int error;
- VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
- leaves =
- MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz;
+ VERIFY(mutex_lock(&zs->zs_vdev_lock) == 0);
+ leaves = MAX(zs->zs_mirrors + zs->zs_splits, 1) * zopt_raidz;
spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
@@ -2355,9 +2180,9 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
* dmu_objset_destroy() to fail with EBUSY thus
* leaving the dataset in an inconsistent state.
*/
- VERIFY(rw_wrlock(&ztest_name_lock) == 0);
+ VERIFY(rw_wrlock(&ztest_shared->zs_name_lock) == 0);
error = spa_vdev_remove(spa, guid, B_FALSE);
- VERIFY(rw_unlock(&ztest_name_lock) == 0);
+ VERIFY(rw_unlock(&ztest_shared->zs_name_lock) == 0);
if (error && error != EEXIST)
fatal(0, "spa_vdev_remove() = %d", error);
@@ -2367,10 +2192,8 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
/*
* Make 1/4 of the devices be log devices.
*/
- nvroot = make_vdev_root(NULL, NULL,
- ztest_opts.zo_vdev_size, 0,
- ztest_random(4) == 0, ztest_opts.zo_raidz,
- zs->zs_mirrors, 1);
+ nvroot = make_vdev_root(NULL, NULL, zopt_vdev_size, 0,
+ ztest_random(4) == 0, zopt_raidz, zs->zs_mirrors, 1);
error = spa_vdev_add(spa, nvroot);
nvlist_free(nvroot);
@@ -2381,7 +2204,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
fatal(0, "spa_vdev_add() = %d", error);
}
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&ztest_shared->zs_vdev_lock) == 0);
}
/*
@@ -2392,7 +2215,7 @@ void
ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
{
ztest_shared_t *zs = ztest_shared;
- spa_t *spa = ztest_spa;
+ spa_t *spa = zs->zs_spa;
vdev_t *rvd = spa->spa_root_vdev;
spa_aux_vdev_t *sav;
char *aux;
@@ -2407,7 +2230,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
aux = ZPOOL_CONFIG_L2CACHE;
}
- VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_lock(&zs->zs_vdev_lock) == 0);
spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
@@ -2424,9 +2247,8 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
for (;;) {
char path[MAXPATHLEN];
int c;
- (void) snprintf(path, sizeof (path), ztest_aux_template,
- ztest_opts.zo_dir, ztest_opts.zo_pool, aux,
- zs->zs_vdev_aux);
+ (void) sprintf(path, ztest_aux_template, zopt_dir,
+ zopt_pool, aux, zs->zs_vdev_aux);
for (c = 0; c < sav->sav_count; c++)
if (strcmp(sav->sav_vdevs[c]->vdev_path,
path) == 0)
@@ -2445,7 +2267,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
* Add a new device.
*/
nvlist_t *nvroot = make_vdev_root(NULL, aux,
- (ztest_opts.zo_vdev_size * 5) / 4, 0, 0, 0, 0, 1);
+ (zopt_vdev_size * 5) / 4, 0, 0, 0, 0, 1);
error = spa_vdev_add(spa, nvroot);
if (error != 0)
fatal(0, "spa_vdev_add(%p) = %d", nvroot, error);
@@ -2464,7 +2286,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
fatal(0, "spa_vdev_remove(%llu) = %d", guid, error);
}
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
}
/*
@@ -2475,17 +2297,17 @@ void
ztest_split_pool(ztest_ds_t *zd, uint64_t id)
{
ztest_shared_t *zs = ztest_shared;
- spa_t *spa = ztest_spa;
+ spa_t *spa = zs->zs_spa;
vdev_t *rvd = spa->spa_root_vdev;
nvlist_t *tree, **child, *config, *split, **schild;
uint_t c, children, schildren = 0, lastlogid = 0;
int error = 0;
- VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_lock(&zs->zs_vdev_lock) == 0);
/* ensure we have a useable config; mirrors of raidz aren't supported */
- if (zs->zs_mirrors < 3 || ztest_opts.zo_raidz > 1) {
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ if (zs->zs_mirrors < 3 || zopt_raidz > 1) {
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
return;
}
@@ -2544,9 +2366,9 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id)
spa_config_exit(spa, SCL_VDEV, FTAG);
- (void) rw_wrlock(&ztest_name_lock);
+ (void) rw_wrlock(&zs->zs_name_lock);
error = spa_vdev_split_mirror(spa, "splitp", config, NULL, B_FALSE);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
nvlist_free(config);
@@ -2559,7 +2381,7 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id)
++zs->zs_splits;
--zs->zs_mirrors;
}
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
}
@@ -2571,7 +2393,7 @@ void
ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
{
ztest_shared_t *zs = ztest_shared;
- spa_t *spa = ztest_spa;
+ spa_t *spa = zs->zs_spa;
spa_aux_vdev_t *sav = &spa->spa_spares;
vdev_t *rvd = spa->spa_root_vdev;
vdev_t *oldvd, *newvd, *pvd;
@@ -2588,8 +2410,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
int oldvd_is_log;
int error, expected_error;
- VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
- leaves = MAX(zs->zs_mirrors, 1) * ztest_opts.zo_raidz;
+ VERIFY(mutex_lock(&zs->zs_vdev_lock) == 0);
+ leaves = MAX(zs->zs_mirrors, 1) * zopt_raidz;
spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
@@ -2615,12 +2437,12 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
if (zs->zs_mirrors >= 1) {
ASSERT(oldvd->vdev_ops == &vdev_mirror_ops);
ASSERT(oldvd->vdev_children >= zs->zs_mirrors);
- oldvd = oldvd->vdev_child[leaf / ztest_opts.zo_raidz];
+ oldvd = oldvd->vdev_child[leaf / zopt_raidz];
}
- if (ztest_opts.zo_raidz > 1) {
+ if (zopt_raidz > 1) {
ASSERT(oldvd->vdev_ops == &vdev_raidz_ops);
- ASSERT(oldvd->vdev_children == ztest_opts.zo_raidz);
- oldvd = oldvd->vdev_child[leaf % ztest_opts.zo_raidz];
+ ASSERT(oldvd->vdev_children == zopt_raidz);
+ oldvd = oldvd->vdev_child[leaf % zopt_raidz];
}
/*
@@ -2649,7 +2471,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
if (error != 0 && error != ENODEV && error != EBUSY &&
error != ENOTSUP)
fatal(0, "detach (%s) returned %d", oldpath, error);
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
return;
}
@@ -2663,8 +2485,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
(void) strcpy(newpath, newvd->vdev_path);
} else {
(void) snprintf(newpath, sizeof (newpath), ztest_dev_template,
- ztest_opts.zo_dir, ztest_opts.zo_pool,
- top * leaves + leaf);
+ zopt_dir, zopt_pool, top * leaves + leaf);
if (ztest_random(2) == 0)
newpath[strlen(newpath) - 1] = 'b';
newvd = vdev_lookup_by_path(rvd, newpath);
@@ -2743,7 +2564,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
(longlong_t)newsize, replacing, error, expected_error);
}
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
}
/*
@@ -2766,7 +2587,7 @@ grow_vdev(vdev_t *vd, void *arg)
fsize = lseek(fd, 0, SEEK_END);
(void) ftruncate(fd, *newsize);
- if (ztest_opts.zo_verbose >= 6) {
+ if (zopt_verbose >= 6) {
(void) printf("%s grew from %lu to %lu bytes\n",
vd->vdev_path, (ulong_t)fsize, (ulong_t)*newsize);
}
@@ -2802,7 +2623,7 @@ online_vdev(vdev_t *vd, void *arg)
* vdev_open fails is by checking the returned newstate.
*/
if (error || newstate != VDEV_STATE_HEALTHY) {
- if (ztest_opts.zo_verbose >= 5) {
+ if (zopt_verbose >= 5) {
(void) printf("Unable to expand vdev, state %llu, "
"error %d\n", (u_longlong_t)newstate, error);
}
@@ -2817,7 +2638,7 @@ online_vdev(vdev_t *vd, void *arg)
* trying to online it.
*/
if (generation != spa->spa_config_generation) {
- if (ztest_opts.zo_verbose >= 5) {
+ if (zopt_verbose >= 5) {
(void) printf("vdev configuration has changed, "
"guid %llu, state %llu, expected gen %llu, "
"got gen %llu\n",
@@ -2863,7 +2684,8 @@ vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg)
void
ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
{
- spa_t *spa = ztest_spa;
+ ztest_shared_t *zs = ztest_shared;
+ spa_t *spa = zs->zs_spa;
vdev_t *vd, *tvd;
metaslab_class_t *mc;
metaslab_group_t *mg;
@@ -2871,7 +2693,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
uint64_t top;
uint64_t old_class_space, new_class_space, old_ms_count, new_ms_count;
- VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_lock(&zs->zs_vdev_lock) == 0);
spa_config_enter(spa, SCL_STATE, spa, RW_READER);
top = ztest_random_vdev_top(spa, B_TRUE);
@@ -2897,16 +2719,16 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
* original size, and it has a valid psize.
*/
if (tvd->vdev_state != VDEV_STATE_HEALTHY ||
- psize == 0 || psize >= 4 * ztest_opts.zo_vdev_size) {
+ psize == 0 || psize >= 4 * zopt_vdev_size) {
spa_config_exit(spa, SCL_STATE, spa);
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
return;
}
ASSERT(psize > 0);
newsize = psize + psize / 8;
ASSERT3U(newsize, >, psize);
- if (ztest_opts.zo_verbose >= 6) {
+ if (zopt_verbose >= 6) {
(void) printf("Expanding LUN %s from %lu to %lu\n",
vd->vdev_path, (ulong_t)psize, (ulong_t)newsize);
}
@@ -2919,12 +2741,12 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
if (vdev_walk_tree(tvd, grow_vdev, &newsize) != NULL ||
vdev_walk_tree(tvd, online_vdev, NULL) != NULL ||
tvd->vdev_state != VDEV_STATE_HEALTHY) {
- if (ztest_opts.zo_verbose >= 5) {
+ if (zopt_verbose >= 5) {
(void) printf("Could not expand LUN because "
"the vdev configuration changed.\n");
}
spa_config_exit(spa, SCL_STATE, spa);
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
return;
}
@@ -2953,12 +2775,12 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
new_class_space = metaslab_class_get_space(mc);
if (tvd->vdev_mg != mg || mg->mg_class != mc) {
- if (ztest_opts.zo_verbose >= 5) {
+ if (zopt_verbose >= 5) {
(void) printf("Could not verify LUN expansion due to "
"intervening vdev offline or remove.\n");
}
spa_config_exit(spa, SCL_STATE, spa);
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
return;
}
@@ -2976,7 +2798,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
fatal(0, "LUN expansion failed: class_space %llu <= %llu\n",
old_class_space, new_class_space);
- if (ztest_opts.zo_verbose >= 5) {
+ if (zopt_verbose >= 5) {
char oldnumbuf[6], newnumbuf[6];
nicenum(old_class_space, oldnumbuf);
@@ -2986,7 +2808,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
}
spa_config_exit(spa, SCL_STATE, spa);
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
}
/*
@@ -3013,8 +2835,7 @@ ztest_dataset_create(char *dsname)
if (err || zilset < 80)
return (err);
- if (ztest_opts.zo_verbose >= 6)
- (void) printf("Setting dataset %s to sync always\n", dsname);
+ (void) printf("Setting dataset %s to sync always\n", dsname);
return (ztest_dsl_prop_set_uint64(dsname, ZFS_PROP_SYNC,
ZFS_SYNC_ALWAYS, B_FALSE));
}
@@ -3056,7 +2877,8 @@ ztest_snapshot_create(char *osname, uint64_t id)
(void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname,
(u_longlong_t)id);
- error = dmu_objset_snapshot_one(osname, strchr(snapname, '@') + 1);
+ error = dmu_objset_snapshot(osname, strchr(snapname, '@') + 1,
+ NULL, NULL, B_FALSE, B_FALSE, -1);
if (error == ENOSPC) {
ztest_record_enospc(FTAG);
return (B_FALSE);
@@ -3085,6 +2907,7 @@ ztest_snapshot_destroy(char *osname, uint64_t id)
void
ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
{
+ ztest_shared_t *zs = ztest_shared;
ztest_ds_t zdtmp;
int iters;
int error;
@@ -3092,10 +2915,10 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
char name[MAXNAMELEN];
zilog_t *zilog;
- (void) rw_rdlock(&ztest_name_lock);
+ (void) rw_rdlock(&zs->zs_name_lock);
(void) snprintf(name, MAXNAMELEN, "%s/temp_%llu",
- ztest_opts.zo_pool, (u_longlong_t)id);
+ zs->zs_pool, (u_longlong_t)id);
/*
* If this dataset exists from a previous run, process its replay log
@@ -3104,7 +2927,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
*/
if (ztest_random(2) == 0 &&
dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os) == 0) {
- ztest_zd_init(&zdtmp, NULL, os);
+ ztest_zd_init(&zdtmp, os);
zil_replay(os, &zdtmp, ztest_replay_vector);
ztest_zd_fini(&zdtmp);
dmu_objset_disown(os, FTAG);
@@ -3130,7 +2953,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
if (error) {
if (error == ENOSPC) {
ztest_record_enospc(FTAG);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
return;
}
fatal(0, "dmu_objset_create(%s) = %d", name, error);
@@ -3139,7 +2962,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
VERIFY3U(0, ==,
dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os));
- ztest_zd_init(&zdtmp, NULL, os);
+ ztest_zd_init(&zdtmp, os);
/*
* Open the intent log for it.
@@ -3179,7 +3002,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
dmu_objset_disown(os, FTAG);
ztest_zd_fini(&zdtmp);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
/*
@@ -3188,10 +3011,12 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
void
ztest_dmu_snapshot_create_destroy(ztest_ds_t *zd, uint64_t id)
{
- (void) rw_rdlock(&ztest_name_lock);
+ ztest_shared_t *zs = ztest_shared;
+
+ (void) rw_rdlock(&zs->zs_name_lock);
(void) ztest_snapshot_destroy(zd->zd_name, id);
(void) ztest_snapshot_create(zd->zd_name, id);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
/*
@@ -3236,6 +3061,7 @@ ztest_dsl_dataset_cleanup(char *osname, uint64_t id)
void
ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
{
+ ztest_shared_t *zs = ztest_shared;
objset_t *clone;
dsl_dataset_t *ds;
char snap1name[MAXNAMELEN];
@@ -3246,7 +3072,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
char *osname = zd->zd_name;
int error;
- (void) rw_rdlock(&ztest_name_lock);
+ (void) rw_rdlock(&zs->zs_name_lock);
ztest_dsl_dataset_cleanup(osname, id);
@@ -3256,7 +3082,8 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
(void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id);
(void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id);
- error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1);
+ error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1,
+ NULL, NULL, B_FALSE, B_FALSE, -1);
if (error && error != EEXIST) {
if (error == ENOSPC) {
ztest_record_enospc(FTAG);
@@ -3279,7 +3106,8 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
}
- error = dmu_objset_snapshot_one(clone1name, strchr(snap2name, '@') + 1);
+ error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1,
+ NULL, NULL, B_FALSE, B_FALSE, -1);
if (error && error != EEXIST) {
if (error == ENOSPC) {
ztest_record_enospc(FTAG);
@@ -3288,7 +3116,8 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
fatal(0, "dmu_open_snapshot(%s) = %d", snap2name, error);
}
- error = dmu_objset_snapshot_one(clone1name, strchr(snap3name, '@') + 1);
+ error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1,
+ NULL, NULL, B_FALSE, B_FALSE, -1);
if (error && error != EEXIST) {
if (error == ENOSPC) {
ztest_record_enospc(FTAG);
@@ -3323,7 +3152,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
out:
ztest_dsl_dataset_cleanup(osname, id);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
/*
@@ -3522,7 +3351,7 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
dmu_write(os, packobj, packoff, packsize, packbuf, tx);
if (freeit) {
- if (ztest_opts.zo_verbose >= 7) {
+ if (zopt_verbose >= 7) {
(void) printf("freeing offset %llx size %llx"
" txg %llx\n",
(u_longlong_t)bigoff,
@@ -3531,7 +3360,7 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
}
VERIFY(0 == dmu_free_range(os, bigobj, bigoff, bigsize, tx));
} else {
- if (ztest_opts.zo_verbose >= 7) {
+ if (zopt_verbose >= 7) {
(void) printf("writing offset %llx size %llx"
" txg %llx\n",
(u_longlong_t)bigoff,
@@ -3769,7 +3598,7 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
* Now write them out.
*/
dmu_write(os, packobj, packoff, packsize, packbuf, tx);
- if (ztest_opts.zo_verbose >= 7) {
+ if (zopt_verbose >= 7) {
(void) printf("writing offset %llx size %llx"
" txg %llx\n",
(u_longlong_t)bigoff,
@@ -4410,35 +4239,37 @@ ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id)
ZFS_PROP_COPIES,
ZFS_PROP_DEDUP
};
+ ztest_shared_t *zs = ztest_shared;
- (void) rw_rdlock(&ztest_name_lock);
+ (void) rw_rdlock(&zs->zs_name_lock);
for (int p = 0; p < sizeof (proplist) / sizeof (proplist[0]); p++)
(void) ztest_dsl_prop_set_uint64(zd->zd_name, proplist[p],
ztest_random_dsl_prop(proplist[p]), (int)ztest_random(2));
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
/* ARGSUSED */
void
ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id)
{
+ ztest_shared_t *zs = ztest_shared;
nvlist_t *props = NULL;
- (void) rw_rdlock(&ztest_name_lock);
+ (void) rw_rdlock(&zs->zs_name_lock);
- (void) ztest_spa_prop_set_uint64(ZPOOL_PROP_DEDUPDITTO,
+ (void) ztest_spa_prop_set_uint64(zs, ZPOOL_PROP_DEDUPDITTO,
ZIO_DEDUPDITTO_MIN + ztest_random(ZIO_DEDUPDITTO_MIN));
- VERIFY3U(spa_prop_get(ztest_spa, &props), ==, 0);
+ VERIFY3U(spa_prop_get(zs->zs_spa, &props), ==, 0);
- if (ztest_opts.zo_verbose >= 6)
+ if (zopt_verbose >= 6)
dump_nvlist(props, 4);
nvlist_free(props);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
/*
@@ -4456,7 +4287,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
char tag[100];
char osname[MAXNAMELEN];
- (void) rw_rdlock(&ztest_name_lock);
+ (void) rw_rdlock(&ztest_shared->zs_name_lock);
dmu_objset_name(os, osname);
@@ -4476,7 +4307,8 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
* Create snapshot, clone it, mark snap for deferred destroy,
* destroy clone, verify snap was also destroyed.
*/
- error = dmu_objset_snapshot_one(osname, snapname);
+ error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE,
+ FALSE, -1);
if (error) {
if (error == ENOSPC) {
ztest_record_enospc("dmu_objset_snapshot");
@@ -4518,7 +4350,8 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
* destroy a held snapshot, mark for deferred destroy,
* release hold, verify snapshot was destroyed.
*/
- error = dmu_objset_snapshot_one(osname, snapname);
+ error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE,
+ FALSE, -1);
if (error) {
if (error == ENOSPC) {
ztest_record_enospc("dmu_objset_snapshot");
@@ -4551,7 +4384,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
VERIFY(dmu_objset_hold(fullname, FTAG, &origin) == ENOENT);
out:
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&ztest_shared->zs_name_lock);
}
/*
@@ -4562,7 +4395,7 @@ void
ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
{
ztest_shared_t *zs = ztest_shared;
- spa_t *spa = ztest_spa;
+ spa_t *spa = zs->zs_spa;
int fd;
uint64_t offset;
uint64_t leaves;
@@ -4579,11 +4412,11 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
uint64_t guid0 = 0;
boolean_t islog = B_FALSE;
- VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_lock(&zs->zs_vdev_lock) == 0);
maxfaults = MAXFAULTS();
- leaves = MAX(zs->zs_mirrors, 1) * ztest_opts.zo_raidz;
+ leaves = MAX(zs->zs_mirrors, 1) * zopt_raidz;
mirror_save = zs->zs_mirrors;
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
ASSERT(leaves >= 1);
@@ -4606,11 +4439,9 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
* and we'll write random garbage to the randomly chosen leaf.
*/
(void) snprintf(path0, sizeof (path0), ztest_dev_template,
- ztest_opts.zo_dir, ztest_opts.zo_pool,
- top * leaves + zs->zs_splits);
+ zopt_dir, zopt_pool, top * leaves + zs->zs_splits);
(void) snprintf(pathrand, sizeof (pathrand), ztest_dev_template,
- ztest_opts.zo_dir, ztest_opts.zo_pool,
- top * leaves + leaf);
+ zopt_dir, zopt_pool, top * leaves + leaf);
vd0 = vdev_lookup_by_path(spa->spa_root_vdev, path0);
if (vd0 != NULL && vd0->vdev_top->vdev_islog)
@@ -4679,12 +4510,12 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
* leaving the dataset in an inconsistent state.
*/
if (islog)
- (void) rw_wrlock(&ztest_name_lock);
+ (void) rw_wrlock(&ztest_shared->zs_name_lock);
VERIFY(vdev_offline(spa, guid0, flags) != EBUSY);
if (islog)
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&ztest_shared->zs_name_lock);
} else {
(void) vdev_online(spa, guid0, 0, NULL);
}
@@ -4711,9 +4542,9 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
if (offset >= fsize)
continue;
- VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_lock(&zs->zs_vdev_lock) == 0);
if (mirror_save != zs->zs_mirrors) {
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
(void) close(fd);
return;
}
@@ -4722,9 +4553,9 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
fatal(1, "can't inject bad word at 0x%llx in %s",
offset, pathrand);
- VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+ VERIFY(mutex_unlock(&zs->zs_vdev_lock) == 0);
- if (ztest_opts.zo_verbose >= 7)
+ if (zopt_verbose >= 7)
(void) printf("injected bad word into %s,"
" offset 0x%llx\n", pathrand, (u_longlong_t)offset);
}
@@ -4739,7 +4570,7 @@ void
ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
{
ztest_shared_t *zs = ztest_shared;
- spa_t *spa = ztest_spa;
+ spa_t *spa = zs->zs_spa;
objset_t *os = zd->zd_os;
ztest_od_t od[1];
uint64_t object, blocksize, txg, pattern, psize;
@@ -4762,19 +4593,19 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
* Take the name lock as writer to prevent anyone else from changing
* the pool and dataset properies we need to maintain during this test.
*/
- (void) rw_wrlock(&ztest_name_lock);
+ (void) rw_wrlock(&zs->zs_name_lock);
if (ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_DEDUP, checksum,
B_FALSE) != 0 ||
ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_COPIES, 1,
B_FALSE) != 0) {
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
return;
}
object = od[0].od_object;
blocksize = od[0].od_blocksize;
- pattern = zs->zs_guid ^ dmu_objset_fsid_guid(os);
+ pattern = spa_guid(spa) ^ dmu_objset_fsid_guid(os);
ASSERT(object != 0);
@@ -4782,7 +4613,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
dmu_tx_hold_write(tx, object, 0, copies * blocksize);
txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
if (txg == 0) {
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
return;
}
@@ -4826,7 +4657,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
zio_buf_free(buf, psize);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
/*
@@ -4836,7 +4667,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
void
ztest_scrub(ztest_ds_t *zd, uint64_t id)
{
- spa_t *spa = ztest_spa;
+ ztest_shared_t *zs = ztest_shared;
+ spa_t *spa = zs->zs_spa;
(void) spa_scan(spa, POOL_SCAN_SCRUB);
(void) poll(NULL, 0, 100); /* wait a moment, then force a restart */
@@ -4844,42 +4676,19 @@ ztest_scrub(ztest_ds_t *zd, uint64_t id)
}
/*
- * Change the guid for the pool.
- */
-/* ARGSUSED */
-void
-ztest_reguid(ztest_ds_t *zd, uint64_t id)
-{
- spa_t *spa = ztest_spa;
- uint64_t orig, load;
-
- orig = spa_guid(spa);
- load = spa_load_guid(spa);
- if (spa_change_guid(spa) != 0)
- return;
-
- if (ztest_opts.zo_verbose >= 3) {
- (void) printf("Changed guid old %llu -> %llu\n",
- (u_longlong_t)orig, (u_longlong_t)spa_guid(spa));
- }
-
- VERIFY3U(orig, !=, spa_guid(spa));
- VERIFY3U(load, ==, spa_load_guid(spa));
-}
-
-/*
* Rename the pool to a different name and then rename it back.
*/
/* ARGSUSED */
void
ztest_spa_rename(ztest_ds_t *zd, uint64_t id)
{
+ ztest_shared_t *zs = ztest_shared;
char *oldname, *newname;
spa_t *spa;
- (void) rw_wrlock(&ztest_name_lock);
+ (void) rw_wrlock(&zs->zs_name_lock);
- oldname = ztest_opts.zo_pool;
+ oldname = zs->zs_pool;
newname = umem_alloc(strlen(oldname) + 5, UMEM_NOFAIL);
(void) strcpy(newname, oldname);
(void) strcat(newname, "_tmp");
@@ -4899,7 +4708,7 @@ ztest_spa_rename(ztest_ds_t *zd, uint64_t id)
*/
VERIFY3U(0, ==, spa_open(newname, &spa, FTAG));
- ASSERT(spa == ztest_spa);
+ ASSERT(spa == zs->zs_spa);
spa_close(spa, FTAG);
/*
@@ -4912,12 +4721,12 @@ ztest_spa_rename(ztest_ds_t *zd, uint64_t id)
*/
VERIFY3U(0, ==, spa_open(oldname, &spa, FTAG));
- ASSERT(spa == ztest_spa);
+ ASSERT(spa == zs->zs_spa);
spa_close(spa, FTAG);
umem_free(newname, strlen(newname) + 1);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
}
/*
@@ -4948,19 +4757,19 @@ ztest_run_zdb(char *pool)
"/usr/sbin%.*s/zdb -bcc%s%s -U %s %s",
isalen,
isa,
- ztest_opts.zo_verbose >= 3 ? "s" : "",
- ztest_opts.zo_verbose >= 4 ? "v" : "",
+ zopt_verbose >= 3 ? "s" : "",
+ zopt_verbose >= 4 ? "v" : "",
spa_config_path,
pool);
free(isa);
- if (ztest_opts.zo_verbose >= 5)
+ if (zopt_verbose >= 5)
(void) printf("Executing %s\n", strstr(zdb, "zdb "));
fp = popen(zdb, "r");
while (fgets(zbuf, sizeof (zbuf), fp) != NULL)
- if (ztest_opts.zo_verbose >= 3)
+ if (zopt_verbose >= 3)
(void) printf("%s", zbuf);
status = pclose(fp);
@@ -4980,12 +4789,12 @@ ztest_walk_pool_directory(char *header)
{
spa_t *spa = NULL;
- if (ztest_opts.zo_verbose >= 6)
+ if (zopt_verbose >= 6)
(void) printf("%s\n", header);
mutex_enter(&spa_namespace_lock);
while ((spa = spa_next(spa)) != NULL)
- if (ztest_opts.zo_verbose >= 6)
+ if (zopt_verbose >= 6)
(void) printf("\t%s\n", spa_name(spa));
mutex_exit(&spa_namespace_lock);
}
@@ -4997,7 +4806,7 @@ ztest_spa_import_export(char *oldname, char *newname)
uint64_t pool_guid;
spa_t *spa;
- if (ztest_opts.zo_verbose >= 4) {
+ if (zopt_verbose >= 4) {
(void) printf("import/export: old = %s, new = %s\n",
oldname, newname);
}
@@ -5072,7 +4881,7 @@ ztest_spa_import_export(char *oldname, char *newname)
static void
ztest_resume(spa_t *spa)
{
- if (spa_suspended(spa) && ztest_opts.zo_verbose >= 6)
+ if (spa_suspended(spa) && zopt_verbose >= 6)
(void) printf("resuming from suspended state\n");
spa_vdev_state_enter(spa, SCL_NONE);
vdev_clear(spa, NULL);
@@ -5110,10 +4919,10 @@ ztest_deadman_thread(void *arg)
}
static void
-ztest_execute(int test, ztest_info_t *zi, uint64_t id)
+ztest_execute(ztest_info_t *zi, uint64_t id)
{
- ztest_ds_t *zd = &ztest_ds[id % ztest_opts.zo_datasets];
- ztest_shared_callstate_t *zc = ZTEST_GET_SHARED_CALLSTATE(test);
+ ztest_shared_t *zs = ztest_shared;
+ ztest_ds_t *zd = &zs->zs_zd[id % zopt_datasets];
hrtime_t functime = gethrtime();
for (int i = 0; i < zi->zi_iters; i++)
@@ -5121,10 +4930,10 @@ ztest_execute(int test, ztest_info_t *zi, uint64_t id)
functime = gethrtime() - functime;
- atomic_add_64(&zc->zc_count, 1);
- atomic_add_64(&zc->zc_time, functime);
+ atomic_add_64(&zi->zi_call_count, 1);
+ atomic_add_64(&zi->zi_call_time, functime);
- if (ztest_opts.zo_verbose >= 4) {
+ if (zopt_verbose >= 4) {
Dl_info dli;
(void) dladdr((void *)zi->zi_func, &dli);
(void) printf("%6.2f sec in %s\n",
@@ -5135,13 +4944,11 @@ ztest_execute(int test, ztest_info_t *zi, uint64_t id)
static void *
ztest_thread(void *arg)
{
- int rand;
uint64_t id = (uintptr_t)arg;
ztest_shared_t *zs = ztest_shared;
uint64_t call_next;
hrtime_t now;
ztest_info_t *zi;
- ztest_shared_callstate_t *zc;
while ((now = gethrtime()) < zs->zs_thread_stop) {
/*
@@ -5159,16 +4966,13 @@ ztest_thread(void *arg)
/*
* Pick a random function to execute.
*/
- rand = ztest_random(ZTEST_FUNCS);
- zi = &ztest_info[rand];
- zc = ZTEST_GET_SHARED_CALLSTATE(rand);
- call_next = zc->zc_next;
+ zi = &zs->zs_info[ztest_random(ZTEST_FUNCS)];
+ call_next = zi->zi_call_next;
if (now >= call_next &&
- atomic_cas_64(&zc->zc_next, call_next, call_next +
- ztest_random(2 * zi->zi_interval[0] + 1)) == call_next) {
- ztest_execute(rand, zi, id);
- }
+ atomic_cas_64(&zi->zi_call_next, call_next, call_next +
+ ztest_random(2 * zi->zi_interval[0] + 1)) == call_next)
+ ztest_execute(zi, id);
}
return (NULL);
@@ -5181,13 +4985,13 @@ ztest_dataset_name(char *dsname, char *pool, int d)
}
static void
-ztest_dataset_destroy(int d)
+ztest_dataset_destroy(ztest_shared_t *zs, int d)
{
char name[MAXNAMELEN];
- ztest_dataset_name(name, ztest_opts.zo_pool, d);
+ ztest_dataset_name(name, zs->zs_pool, d);
- if (ztest_opts.zo_verbose >= 3)
+ if (zopt_verbose >= 3)
(void) printf("Destroying %s to free up space\n", name);
/*
@@ -5195,10 +4999,8 @@ ztest_dataset_destroy(int d)
* ztest thread t operates on dataset (t % zopt_datasets),
* so there may be more than one thing to clean up.
*/
- for (int t = d; t < ztest_opts.zo_threads;
- t += ztest_opts.zo_datasets) {
+ for (int t = d; t < zopt_threads; t += zopt_datasets)
ztest_dsl_dataset_cleanup(name, t);
- }
(void) dmu_objset_find(name, ztest_objset_destroy_cb, NULL,
DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN);
@@ -5226,31 +5028,31 @@ ztest_dataset_dirobj_verify(ztest_ds_t *zd)
}
static int
-ztest_dataset_open(int d)
+ztest_dataset_open(ztest_shared_t *zs, int d)
{
- ztest_ds_t *zd = &ztest_ds[d];
- uint64_t committed_seq = ZTEST_GET_SHARED_DS(d)->zd_seq;
+ ztest_ds_t *zd = &zs->zs_zd[d];
+ uint64_t committed_seq = zd->zd_seq;
objset_t *os;
zilog_t *zilog;
char name[MAXNAMELEN];
int error;
- ztest_dataset_name(name, ztest_opts.zo_pool, d);
+ ztest_dataset_name(name, zs->zs_pool, d);
- (void) rw_rdlock(&ztest_name_lock);
+ (void) rw_rdlock(&zs->zs_name_lock);
error = ztest_dataset_create(name);
if (error == ENOSPC) {
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
ztest_record_enospc(FTAG);
return (error);
}
ASSERT(error == 0 || error == EEXIST);
VERIFY3U(dmu_objset_hold(name, zd, &os), ==, 0);
- (void) rw_unlock(&ztest_name_lock);
+ (void) rw_unlock(&zs->zs_name_lock);
- ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
+ ztest_zd_init(zd, os);
zilog = zd->zd_zilog;
@@ -5265,7 +5067,7 @@ ztest_dataset_open(int d)
ztest_dataset_dirobj_verify(zd);
- if (ztest_opts.zo_verbose >= 6)
+ if (zopt_verbose >= 6)
(void) printf("%s replay %llu blocks, %llu records, seq %llu\n",
zd->zd_name,
(u_longlong_t)zilog->zl_parse_blk_count,
@@ -5283,9 +5085,9 @@ ztest_dataset_open(int d)
}
static void
-ztest_dataset_close(int d)
+ztest_dataset_close(ztest_shared_t *zs, int d)
{
- ztest_ds_t *zd = &ztest_ds[d];
+ ztest_ds_t *zd = &zs->zs_zd[d];
zil_close(zd->zd_zilog);
dmu_objset_rele(zd->zd_os, zd);
@@ -5301,7 +5103,6 @@ ztest_run(ztest_shared_t *zs)
{
thread_t *tid;
spa_t *spa;
- objset_t *os;
thread_t resume_tid;
int error;
@@ -5310,18 +5111,15 @@ ztest_run(ztest_shared_t *zs)
/*
* Initialize parent/child shared state.
*/
- VERIFY(_mutex_init(&ztest_vdev_lock, USYNC_THREAD, NULL) == 0);
- VERIFY(rwlock_init(&ztest_name_lock, USYNC_THREAD, NULL) == 0);
+ VERIFY(_mutex_init(&zs->zs_vdev_lock, USYNC_THREAD, NULL) == 0);
+ VERIFY(rwlock_init(&zs->zs_name_lock, USYNC_THREAD, NULL) == 0);
zs->zs_thread_start = gethrtime();
- zs->zs_thread_stop =
- zs->zs_thread_start + ztest_opts.zo_passtime * NANOSEC;
+ zs->zs_thread_stop = zs->zs_thread_start + zopt_passtime * NANOSEC;
zs->zs_thread_stop = MIN(zs->zs_thread_stop, zs->zs_proc_stop);
zs->zs_thread_kill = zs->zs_thread_stop;
- if (ztest_random(100) < ztest_opts.zo_killrate) {
- zs->zs_thread_kill -=
- ztest_random(ztest_opts.zo_passtime * NANOSEC);
- }
+ if (ztest_random(100) < zopt_killrate)
+ zs->zs_thread_kill -= ztest_random(zopt_passtime * NANOSEC);
(void) _mutex_init(&zcl.zcl_callbacks_lock, USYNC_THREAD, NULL);
@@ -5332,13 +5130,8 @@ ztest_run(ztest_shared_t *zs)
* Open our pool.
*/
kernel_init(FREAD | FWRITE);
- VERIFY(spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0);
- spa->spa_debug = B_TRUE;
- ztest_spa = spa;
-
- VERIFY3U(0, ==, dmu_objset_hold(ztest_opts.zo_pool, FTAG, &os));
- zs->zs_guid = dmu_objset_fsid_guid(os);
- dmu_objset_rele(os, FTAG);
+ VERIFY(spa_open(zs->zs_pool, &spa, FTAG) == 0);
+ zs->zs_spa = spa;
spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN;
@@ -5383,23 +5176,21 @@ ztest_run(ztest_shared_t *zs)
* If we got any ENOSPC errors on the previous run, destroy something.
*/
if (zs->zs_enospc_count != 0) {
- int d = ztest_random(ztest_opts.zo_datasets);
- ztest_dataset_destroy(d);
+ int d = ztest_random(zopt_datasets);
+ ztest_dataset_destroy(zs, d);
}
zs->zs_enospc_count = 0;
- tid = umem_zalloc(ztest_opts.zo_threads * sizeof (thread_t),
- UMEM_NOFAIL);
+ tid = umem_zalloc(zopt_threads * sizeof (thread_t), UMEM_NOFAIL);
- if (ztest_opts.zo_verbose >= 4)
+ if (zopt_verbose >= 4)
(void) printf("starting main threads...\n");
/*
* Kick off all the tests that run in parallel.
*/
- for (int t = 0; t < ztest_opts.zo_threads; t++) {
- if (t < ztest_opts.zo_datasets &&
- ztest_dataset_open(t) != 0)
+ for (int t = 0; t < zopt_threads; t++) {
+ if (t < zopt_datasets && ztest_dataset_open(zs, t) != 0)
return;
VERIFY(thr_create(0, 0, ztest_thread, (void *)(uintptr_t)t,
THR_BOUND, &tid[t]) == 0);
@@ -5409,10 +5200,10 @@ ztest_run(ztest_shared_t *zs)
* Wait for all of the tests to complete. We go in reverse order
* so we don't close datasets while threads are still using them.
*/
- for (int t = ztest_opts.zo_threads - 1; t >= 0; t--) {
+ for (int t = zopt_threads - 1; t >= 0; t--) {
VERIFY(thr_join(tid[t], NULL, NULL) == 0);
- if (t < ztest_opts.zo_datasets)
- ztest_dataset_close(t);
+ if (t < zopt_datasets)
+ ztest_dataset_close(zs, t);
}
txg_wait_synced(spa_get_dsl(spa), 0);
@@ -5420,7 +5211,7 @@ ztest_run(ztest_shared_t *zs)
zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa));
zs->zs_space = metaslab_class_get_space(spa_normal_class(spa));
- umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t));
+ umem_free(tid, zopt_threads * sizeof (thread_t));
/* Kill the resume thread */
ztest_exiting = B_TRUE;
@@ -5441,7 +5232,7 @@ ztest_run(ztest_shared_t *zs)
*/
mutex_enter(&spa_namespace_lock);
for (spa = spa_next(NULL); spa != NULL; spa = spa_next(spa))
- if (ztest_opts.zo_verbose > 3)
+ if (zopt_verbose > 3)
(void) printf("spa_next: found %s\n", spa_name(spa));
mutex_exit(&spa_namespace_lock);
@@ -5451,10 +5242,9 @@ ztest_run(ztest_shared_t *zs)
*/
if (ztest_random(2) == 0) {
char name[MAXNAMELEN];
- (void) snprintf(name, MAXNAMELEN, "%s_import",
- ztest_opts.zo_pool);
- ztest_spa_import_export(ztest_opts.zo_pool, name);
- ztest_spa_import_export(name, ztest_opts.zo_pool);
+ (void) snprintf(name, MAXNAMELEN, "%s_import", zs->zs_pool);
+ ztest_spa_import_export(zs->zs_pool, name);
+ ztest_spa_import_export(name, zs->zs_pool);
}
kernel_fini();
@@ -5463,23 +5253,23 @@ ztest_run(ztest_shared_t *zs)
(void) _mutex_destroy(&zcl.zcl_callbacks_lock);
- (void) rwlock_destroy(&ztest_name_lock);
- (void) _mutex_destroy(&ztest_vdev_lock);
+ (void) rwlock_destroy(&zs->zs_name_lock);
+ (void) _mutex_destroy(&zs->zs_vdev_lock);
}
static void
-ztest_freeze(void)
+ztest_freeze(ztest_shared_t *zs)
{
- ztest_ds_t *zd = &ztest_ds[0];
+ ztest_ds_t *zd = &zs->zs_zd[0];
spa_t *spa;
int numloops = 0;
- if (ztest_opts.zo_verbose >= 3)
+ if (zopt_verbose >= 3)
(void) printf("testing spa_freeze()...\n");
kernel_init(FREAD | FWRITE);
- VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
- VERIFY3U(0, ==, ztest_dataset_open(0));
+ VERIFY3U(0, ==, spa_open(zs->zs_pool, &spa, FTAG));
+ VERIFY3U(0, ==, ztest_dataset_open(zs, 0));
/*
* Force the first log block to be transactionally allocated.
@@ -5506,8 +5296,7 @@ ztest_freeze(void)
* to increase well beyond the last synced value in the uberblock.
* The ZIL should be OK with that.
*/
- while (ztest_random(10) != 0 &&
- numloops++ < ztest_opts.zo_maxloops) {
+ while (ztest_random(10) != 0 && numloops++ < zopt_maxloops) {
ztest_dmu_write_parallel(zd, 0);
ztest_dmu_object_alloc_free(zd, 0);
txg_wait_synced(spa_get_dsl(spa), 0);
@@ -5522,7 +5311,7 @@ ztest_freeze(void)
/*
* Close our dataset and close the pool.
*/
- ztest_dataset_close(0);
+ ztest_dataset_close(zs, 0);
spa_close(spa, FTAG);
kernel_fini();
@@ -5530,9 +5319,9 @@ ztest_freeze(void)
* Open and close the pool and dataset to induce log replay.
*/
kernel_init(FREAD | FWRITE);
- VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
- VERIFY3U(0, ==, ztest_dataset_open(0));
- ztest_dataset_close(0);
+ VERIFY3U(0, ==, spa_open(zs->zs_pool, &spa, FTAG));
+ VERIFY3U(0, ==, ztest_dataset_open(zs, 0));
+ ztest_dataset_close(zs, 0);
spa_close(spa, FTAG);
kernel_fini();
}
@@ -5567,11 +5356,15 @@ make_random_props()
{
nvlist_t *props;
- VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
if (ztest_random(2) == 0)
- return (props);
+ return (NULL);
+
+ VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
VERIFY(nvlist_add_uint64(props, "autoreplace", 1) == 0);
+ (void) printf("props:\n");
+ dump_nvlist(props, 4);
+
return (props);
}
@@ -5585,211 +5378,38 @@ ztest_init(ztest_shared_t *zs)
spa_t *spa;
nvlist_t *nvroot, *props;
- VERIFY(_mutex_init(&ztest_vdev_lock, USYNC_THREAD, NULL) == 0);
- VERIFY(rwlock_init(&ztest_name_lock, USYNC_THREAD, NULL) == 0);
+ VERIFY(_mutex_init(&zs->zs_vdev_lock, USYNC_THREAD, NULL) == 0);
+ VERIFY(rwlock_init(&zs->zs_name_lock, USYNC_THREAD, NULL) == 0);
kernel_init(FREAD | FWRITE);
/*
* Create the storage pool.
*/
- (void) spa_destroy(ztest_opts.zo_pool);
+ (void) spa_destroy(zs->zs_pool);
ztest_shared->zs_vdev_next_leaf = 0;
zs->zs_splits = 0;
- zs->zs_mirrors = ztest_opts.zo_mirrors;
- nvroot = make_vdev_root(NULL, NULL, ztest_opts.zo_vdev_size, 0,
- 0, ztest_opts.zo_raidz, zs->zs_mirrors, 1);
+ zs->zs_mirrors = zopt_mirrors;
+ nvroot = make_vdev_root(NULL, NULL, zopt_vdev_size, 0,
+ 0, zopt_raidz, zs->zs_mirrors, 1);
props = make_random_props();
- for (int i = 0; i < SPA_FEATURES; i++) {
- char buf[1024];
- (void) snprintf(buf, sizeof (buf), "feature@%s",
- spa_feature_table[i].fi_uname);
- VERIFY3U(0, ==, nvlist_add_uint64(props, buf, 0));
- }
- VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props, NULL));
+ VERIFY3U(0, ==, spa_create(zs->zs_pool, nvroot, props, NULL, NULL));
nvlist_free(nvroot);
- VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
- zs->zs_metaslab_sz =
- 1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift;
-
+ VERIFY3U(0, ==, spa_open(zs->zs_pool, &spa, FTAG));
+ metaslab_sz = 1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift;
spa_close(spa, FTAG);
kernel_fini();
- ztest_run_zdb(ztest_opts.zo_pool);
-
- ztest_freeze();
-
- ztest_run_zdb(ztest_opts.zo_pool);
+ ztest_run_zdb(zs->zs_pool);
- (void) rwlock_destroy(&ztest_name_lock);
- (void) _mutex_destroy(&ztest_vdev_lock);
-}
-
-static void
-setup_fds(void)
-{
- int fd;
+ ztest_freeze(zs);
- char *tmp = tempnam(NULL, NULL);
- fd = open(tmp, O_RDWR | O_CREAT, 0700);
- ASSERT3U(fd, ==, ZTEST_FD_DATA);
- (void) unlink(tmp);
- free(tmp);
+ ztest_run_zdb(zs->zs_pool);
- fd = open("/dev/urandom", O_RDONLY);
- ASSERT3U(fd, ==, ZTEST_FD_RAND);
-}
-
-static int
-shared_data_size(ztest_shared_hdr_t *hdr)
-{
- int size;
-
- size = hdr->zh_hdr_size;
- size += hdr->zh_opts_size;
- size += hdr->zh_size;
- size += hdr->zh_stats_size * hdr->zh_stats_count;
- size += hdr->zh_ds_size * hdr->zh_ds_count;
-
- return (size);
-}
-
-static void
-setup_hdr(void)
-{
- int size;
- ztest_shared_hdr_t *hdr;
-
- hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
- PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0);
- ASSERT(hdr != MAP_FAILED);
-
- VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t)));
-
- hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t);
- hdr->zh_opts_size = sizeof (ztest_shared_opts_t);
- hdr->zh_size = sizeof (ztest_shared_t);
- hdr->zh_stats_size = sizeof (ztest_shared_callstate_t);
- hdr->zh_stats_count = ZTEST_FUNCS;
- hdr->zh_ds_size = sizeof (ztest_shared_ds_t);
- hdr->zh_ds_count = ztest_opts.zo_datasets;
-
- size = shared_data_size(hdr);
- VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size));
-
- (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
-}
-
-static void
-setup_data(void)
-{
- int size, offset;
- ztest_shared_hdr_t *hdr;
- uint8_t *buf;
-
- hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
- PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0);
- ASSERT(hdr != MAP_FAILED);
-
- size = shared_data_size(hdr);
-
- (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
- hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()),
- PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0);
- ASSERT(hdr != MAP_FAILED);
- buf = (uint8_t *)hdr;
-
- offset = hdr->zh_hdr_size;
- ztest_shared_opts = (void *)&buf[offset];
- offset += hdr->zh_opts_size;
- ztest_shared = (void *)&buf[offset];
- offset += hdr->zh_size;
- ztest_shared_callstate = (void *)&buf[offset];
- offset += hdr->zh_stats_size * hdr->zh_stats_count;
- ztest_shared_ds = (void *)&buf[offset];
-}
-
-static boolean_t
-exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
-{
- pid_t pid;
- int status;
- char cmdbuf[MAXPATHLEN];
-
- pid = fork();
-
- if (cmd == NULL) {
- (void) strlcpy(cmdbuf, getexecname(), sizeof (cmdbuf));
- cmd = cmdbuf;
- }
-
- if (pid == -1)
- fatal(1, "fork failed");
-
- if (pid == 0) { /* child */
- char *emptyargv[2] = { cmd, NULL };
-
- struct rlimit rl = { 1024, 1024 };
- (void) setrlimit(RLIMIT_NOFILE, &rl);
- (void) enable_extended_FILE_stdio(-1, -1);
- if (libpath != NULL)
- VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1));
- (void) execv(cmd, emptyargv);
- ztest_dump_core = B_FALSE;
- fatal(B_TRUE, "exec failed: %s", cmd);
- }
-
- while (waitpid(pid, &status, 0) != pid)
- continue;
- if (statusp != NULL)
- *statusp = status;
-
- if (WIFEXITED(status)) {
- if (WEXITSTATUS(status) != 0) {
- (void) fprintf(stderr, "child exited with code %d\n",
- WEXITSTATUS(status));
- exit(2);
- }
- return (B_FALSE);
- } else if (WIFSIGNALED(status)) {
- if (!ignorekill || WTERMSIG(status) != SIGKILL) {
- (void) fprintf(stderr, "child died with signal %d\n",
- WTERMSIG(status));
- exit(3);
- }
- return (B_TRUE);
- } else {
- (void) fprintf(stderr, "something strange happened to child\n");
- exit(4);
- /* NOTREACHED */
- }
-}
-
-static void
-ztest_run_init(void)
-{
- ztest_shared_t *zs = ztest_shared;
-
- ASSERT(ztest_opts.zo_init != 0);
-
- /*
- * Blow away any existing copy of zpool.cache
- */
- (void) remove(spa_config_path);
-
- /*
- * Create and initialize our storage pool.
- */
- for (int i = 1; i <= ztest_opts.zo_init; i++) {
- bzero(zs, sizeof (ztest_shared_t));
- if (ztest_opts.zo_verbose >= 3 &&
- ztest_opts.zo_init != 1) {
- (void) printf("ztest_init(), pass %d\n", i);
- }
- ztest_init(zs);
- }
+ (void) rwlock_destroy(&zs->zs_name_lock);
+ (void) _mutex_destroy(&zs->zs_vdev_lock);
}
int
@@ -5797,92 +5417,63 @@ main(int argc, char **argv)
{
int kills = 0;
int iters = 0;
- int older = 0;
- int newer = 0;
ztest_shared_t *zs;
+ size_t shared_size;
ztest_info_t *zi;
- ztest_shared_callstate_t *zc;
char timebuf[100];
char numbuf[6];
spa_t *spa;
- char cmd[MAXNAMELEN];
- boolean_t hasalt;
-
- boolean_t ischild = (0 == lseek(ZTEST_FD_DATA, 0, SEEK_CUR));
- ASSERT(ischild || errno == EBADF);
(void) setvbuf(stdout, NULL, _IOLBF, 0);
- if (!ischild) {
- process_options(argc, argv);
+ ztest_random_fd = open("/dev/urandom", O_RDONLY);
- setup_fds();
- setup_hdr();
- setup_data();
- bcopy(&ztest_opts, ztest_shared_opts,
- sizeof (*ztest_shared_opts));
- } else {
- setup_data();
- bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts));
- }
- ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count);
+ process_options(argc, argv);
/* Override location of zpool.cache */
- (void) asprintf((char **)&spa_config_path, "%s/zpool.cache",
- ztest_opts.zo_dir);
-
- ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t),
- UMEM_NOFAIL);
- zs = ztest_shared;
+ (void) asprintf((char **)&spa_config_path, "%s/zpool.cache", zopt_dir);
- if (ischild) {
- metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang;
- metaslab_df_alloc_threshold =
- zs->zs_metaslab_df_alloc_threshold;
+ /*
+ * Blow away any existing copy of zpool.cache
+ */
+ if (zopt_init != 0)
+ (void) remove(spa_config_path);
- if (zs->zs_do_init)
- ztest_run_init();
- else
- ztest_run(zs);
- exit(0);
- }
+ shared_size = sizeof (*zs) + zopt_datasets * sizeof (ztest_ds_t);
- hasalt = (strlen(ztest_opts.zo_alt_ztest) != 0);
+ zs = ztest_shared = (void *)mmap(0,
+ P2ROUNDUP(shared_size, getpagesize()),
+ PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
- if (ztest_opts.zo_verbose >= 1) {
+ if (zopt_verbose >= 1) {
(void) printf("%llu vdevs, %d datasets, %d threads,"
" %llu seconds...\n",
- (u_longlong_t)ztest_opts.zo_vdevs,
- ztest_opts.zo_datasets,
- ztest_opts.zo_threads,
- (u_longlong_t)ztest_opts.zo_time);
+ (u_longlong_t)zopt_vdevs, zopt_datasets, zopt_threads,
+ (u_longlong_t)zopt_time);
}
- (void) strlcpy(cmd, getexecname(), sizeof (cmd));
-
- zs->zs_do_init = B_TRUE;
- if (strlen(ztest_opts.zo_alt_ztest) != 0) {
- if (ztest_opts.zo_verbose >= 1) {
- (void) printf("Executing older ztest for "
- "initialization: %s\n", ztest_opts.zo_alt_ztest);
- }
- VERIFY(!exec_child(ztest_opts.zo_alt_ztest,
- ztest_opts.zo_alt_libpath, B_FALSE, NULL));
- } else {
- VERIFY(!exec_child(NULL, NULL, B_FALSE, NULL));
+ /*
+ * Create and initialize our storage pool.
+ */
+ for (int i = 1; i <= zopt_init; i++) {
+ bzero(zs, sizeof (ztest_shared_t));
+ if (zopt_verbose >= 3 && zopt_init != 1)
+ (void) printf("ztest_init(), pass %d\n", i);
+ zs->zs_pool = zopt_pool;
+ ztest_init(zs);
}
- zs->zs_do_init = B_FALSE;
+ zs->zs_pool = zopt_pool;
zs->zs_proc_start = gethrtime();
- zs->zs_proc_stop = zs->zs_proc_start + ztest_opts.zo_time * NANOSEC;
+ zs->zs_proc_stop = zs->zs_proc_start + zopt_time * NANOSEC;
for (int f = 0; f < ZTEST_FUNCS; f++) {
- zi = &ztest_info[f];
- zc = ZTEST_GET_SHARED_CALLSTATE(f);
+ zi = &zs->zs_info[f];
+ *zi = ztest_info[f];
if (zs->zs_proc_start + zi->zi_interval[0] > zs->zs_proc_stop)
- zc->zc_next = UINT64_MAX;
+ zi->zi_call_next = UINT64_MAX;
else
- zc->zc_next = zs->zs_proc_start +
+ zi->zi_call_next = zs->zs_proc_start +
ztest_random(2 * zi->zi_interval[0] + 1);
}
@@ -5893,43 +5484,60 @@ main(int argc, char **argv)
*/
while (gethrtime() < zs->zs_proc_stop) {
int status;
- boolean_t killed;
+ pid_t pid;
/*
* Initialize the workload counters for each function.
*/
for (int f = 0; f < ZTEST_FUNCS; f++) {
- zc = ZTEST_GET_SHARED_CALLSTATE(f);
- zc->zc_count = 0;
- zc->zc_time = 0;
+ zi = &zs->zs_info[f];
+ zi->zi_call_count = 0;
+ zi->zi_call_time = 0;
}
/* Set the allocation switch size */
- zs->zs_metaslab_df_alloc_threshold =
- ztest_random(zs->zs_metaslab_sz / 4) + 1;
+ metaslab_df_alloc_threshold = ztest_random(metaslab_sz / 4) + 1;
+
+ pid = fork();
- if (!hasalt || ztest_random(2) == 0) {
- if (hasalt && ztest_opts.zo_verbose >= 1) {
- (void) printf("Executing newer ztest: %s\n",
- cmd);
+ if (pid == -1)
+ fatal(1, "fork failed");
+
+ if (pid == 0) { /* child */
+ struct rlimit rl = { 1024, 1024 };
+ (void) setrlimit(RLIMIT_NOFILE, &rl);
+ (void) enable_extended_FILE_stdio(-1, -1);
+ ztest_run(zs);
+ exit(0);
+ }
+
+ while (waitpid(pid, &status, 0) != pid)
+ continue;
+
+ if (WIFEXITED(status)) {
+ if (WEXITSTATUS(status) != 0) {
+ (void) fprintf(stderr,
+ "child exited with code %d\n",
+ WEXITSTATUS(status));
+ exit(2);
}
- newer++;
- killed = exec_child(cmd, NULL, B_TRUE, &status);
- } else {
- if (hasalt && ztest_opts.zo_verbose >= 1) {
- (void) printf("Executing older ztest: %s\n",
- ztest_opts.zo_alt_ztest);
+ } else if (WIFSIGNALED(status)) {
+ if (WTERMSIG(status) != SIGKILL) {
+ (void) fprintf(stderr,
+ "child died with signal %d\n",
+ WTERMSIG(status));
+ exit(3);
}
- older++;
- killed = exec_child(ztest_opts.zo_alt_ztest,
- ztest_opts.zo_alt_libpath, B_TRUE, &status);
+ kills++;
+ } else {
+ (void) fprintf(stderr, "something strange happened "
+ "to child\n");
+ exit(4);
}
- if (killed)
- kills++;
iters++;
- if (ztest_opts.zo_verbose >= 1) {
+ if (zopt_verbose >= 1) {
hrtime_t now = gethrtime();
now = MIN(now, zs->zs_proc_stop);
@@ -5944,10 +5552,10 @@ main(int argc, char **argv)
100.0 * zs->zs_alloc / zs->zs_space,
numbuf,
100.0 * (now - zs->zs_proc_start) /
- (ztest_opts.zo_time * NANOSEC), timebuf);
+ (zopt_time * NANOSEC), timebuf);
}
- if (ztest_opts.zo_verbose >= 2) {
+ if (zopt_verbose >= 2) {
(void) printf("\nWorkload summary:\n\n");
(void) printf("%7s %9s %s\n",
"Calls", "Time", "Function");
@@ -5956,12 +5564,11 @@ main(int argc, char **argv)
for (int f = 0; f < ZTEST_FUNCS; f++) {
Dl_info dli;
- zi = &ztest_info[f];
- zc = ZTEST_GET_SHARED_CALLSTATE(f);
- print_time(zc->zc_time, timebuf);
+ zi = &zs->zs_info[f];
+ print_time(zi->zi_call_time, timebuf);
(void) dladdr((void *)zi->zi_func, &dli);
(void) printf("%7llu %9s %s\n",
- (u_longlong_t)zc->zc_count, timebuf,
+ (u_longlong_t)zi->zi_call_count, timebuf,
dli.dli_sname);
}
(void) printf("\n");
@@ -5973,28 +5580,22 @@ main(int argc, char **argv)
* instead of 'ztest'. Do a blind rename in case this happened.
*/
kernel_init(FREAD);
- if (spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0) {
+ if (spa_open(zopt_pool, &spa, FTAG) == 0) {
spa_close(spa, FTAG);
} else {
char tmpname[MAXNAMELEN];
kernel_fini();
kernel_init(FREAD | FWRITE);
(void) snprintf(tmpname, sizeof (tmpname), "%s_tmp",
- ztest_opts.zo_pool);
- (void) spa_rename(tmpname, ztest_opts.zo_pool);
+ zopt_pool);
+ (void) spa_rename(tmpname, zopt_pool);
}
kernel_fini();
- ztest_run_zdb(ztest_opts.zo_pool);
+ ztest_run_zdb(zopt_pool);
}
- if (ztest_opts.zo_verbose >= 1) {
- if (hasalt) {
- (void) printf("%d runs of older ztest: %s\n", older,
- ztest_opts.zo_alt_ztest);
- (void) printf("%d runs of newer ztest: %s\n", newer,
- cmd);
- }
+ if (zopt_verbose >= 1) {
(void) printf("%d killed, %d completed, %.0f%% kill rate\n",
kills, iters - kills, (100.0 * kills) / MAX(1, iters));
}
diff --git a/lib/libctf/common/ctf_lib.c b/lib/libctf/common/ctf_lib.c
index 1c5c3f1d5f7e..6e599540a4f6 100644
--- a/lib/libctf/common/ctf_lib.c
+++ b/lib/libctf/common/ctf_lib.c
@@ -24,6 +24,8 @@
* Use is subject to license terms.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
@@ -35,9 +37,9 @@
#include <gelf.h>
#ifdef _LP64
-static const char *_libctf_zlib = "/usr/lib/64/libz.so.1";
+static const char *_libctf_zlib = "/usr/lib/64/libz.so";
#else
-static const char *_libctf_zlib = "/usr/lib/libz.so.1";
+static const char *_libctf_zlib = "/usr/lib/libz.so";
#endif
static struct {
diff --git a/lib/libdtrace/common/dt_aggregate.c b/lib/libdtrace/common/dt_aggregate.c
index bb766f71c466..2e66250b88d7 100644
--- a/lib/libdtrace/common/dt_aggregate.c
+++ b/lib/libdtrace/common/dt_aggregate.c
@@ -24,9 +24,7 @@
* Use is subject to license terms.
*/
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
+#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <strings.h>
@@ -206,83 +204,6 @@ dt_aggregate_lquantizedcmp(int64_t *lhs, int64_t *rhs)
return (0);
}
-static void
-dt_aggregate_llquantize(int64_t *existing, int64_t *new, size_t size)
-{
- int i;
-
- for (i = 1; i < size / sizeof (int64_t); i++)
- existing[i] = existing[i] + new[i];
-}
-
-static long double
-dt_aggregate_llquantizedsum(int64_t *llquanta)
-{
- int64_t arg = *llquanta++;
- uint16_t factor = DTRACE_LLQUANTIZE_FACTOR(arg);
- uint16_t low = DTRACE_LLQUANTIZE_LOW(arg);
- uint16_t high = DTRACE_LLQUANTIZE_HIGH(arg);
- uint16_t nsteps = DTRACE_LLQUANTIZE_NSTEP(arg);
- int bin = 0, order;
- int64_t value = 1, next, step;
- long double total;
-
- assert(nsteps >= factor);
- assert(nsteps % factor == 0);
-
- for (order = 0; order < low; order++)
- value *= factor;
-
- total = (long double)llquanta[bin++] * (long double)(value - 1);
-
- next = value * factor;
- step = next > nsteps ? next / nsteps : 1;
-
- while (order <= high) {
- assert(value < next);
- total += (long double)llquanta[bin++] * (long double)(value);
-
- if ((value += step) != next)
- continue;
-
- next = value * factor;
- step = next > nsteps ? next / nsteps : 1;
- order++;
- }
-
- return (total + (long double)llquanta[bin] * (long double)value);
-}
-
-static int
-dt_aggregate_llquantizedcmp(int64_t *lhs, int64_t *rhs)
-{
- long double lsum = dt_aggregate_llquantizedsum(lhs);
- long double rsum = dt_aggregate_llquantizedsum(rhs);
- int64_t lzero, rzero;
-
- if (lsum < rsum)
- return (DT_LESSTHAN);
-
- if (lsum > rsum)
- return (DT_GREATERTHAN);
-
- /*
- * If they're both equal, then we will compare based on the weights at
- * zero. If the weights at zero are equal, then this will be judged a
- * tie and will be resolved based on the key comparison.
- */
- lzero = lhs[1];
- rzero = rhs[1];
-
- if (lzero < rzero)
- return (DT_LESSTHAN);
-
- if (lzero > rzero)
- return (DT_GREATERTHAN);
-
- return (0);
-}
-
static int
dt_aggregate_quantizedcmp(int64_t *lhs, int64_t *rhs)
{
@@ -661,10 +582,6 @@ hashnext:
h->dtahe_aggregate = dt_aggregate_lquantize;
break;
- case DTRACEAGG_LLQUANTIZE:
- h->dtahe_aggregate = dt_aggregate_llquantize;
- break;
-
case DTRACEAGG_COUNT:
case DTRACEAGG_SUM:
case DTRACEAGG_AVG:
@@ -932,10 +849,6 @@ dt_aggregate_valcmp(const void *lhs, const void *rhs)
rval = dt_aggregate_lquantizedcmp(laddr, raddr);
break;
- case DTRACEAGG_LLQUANTIZE:
- rval = dt_aggregate_llquantizedcmp(laddr, raddr);
- break;
-
case DTRACEAGG_COUNT:
case DTRACEAGG_SUM:
case DTRACEAGG_MIN:
diff --git a/lib/libdtrace/common/dt_cc.c b/lib/libdtrace/common/dt_cc.c
index 8b8bcf475cba..24a386bbde95 100644
--- a/lib/libdtrace/common/dt_cc.c
+++ b/lib/libdtrace/common/dt_cc.c
@@ -21,8 +21,6 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
*/
/*
@@ -84,7 +82,6 @@
#include <sys/types.h>
#include <sys/wait.h>
-#include <sys/sysmacros.h>
#include <assert.h>
#include <strings.h>
@@ -679,59 +676,13 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
ap->dtad_kind = DTRACEACT_DIFEXPR;
}
-/*
- * The print() action behaves identically to trace(), except that it stores the
- * CTF type of the argument (if present) within the DOF for the DIFEXPR action.
- * To do this, we set the 'dtsd_strdata' to point to the fully-qualified CTF
- * type ID for the result of the DIF action. We use the ID instead of the name
- * to handles complex types like arrays and function pointers that can't be
- * resolved by ctf_type_lookup(). This is later processed by
- * dtrace_dof_create() and turned into a reference into the string table so
- * that we can get the type information when we process the data after the
- * fact.
- */
-static void
-dt_action_print(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
-{
- dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
- dt_node_t *dret;
- size_t len;
- dt_module_t *dmp;
-
- if (dt_node_is_void(dnp->dn_args)) {
- dnerror(dnp->dn_args, D_PRINT_VOID,
- "print( ) may not be applied to a void expression\n");
- }
-
- if (dt_node_is_dynamic(dnp->dn_args)) {
- dnerror(dnp->dn_args, D_PRINT_DYN,
- "print( ) may not be applied to a dynamic expression\n");
- }
-
- dt_cg(yypcb, dnp->dn_args);
-
- dret = yypcb->pcb_dret;
- dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp);
-
- len = snprintf(NULL, 0, "%s`%d", dmp->dm_name, dret->dn_type) + 1;
- sdp->dtsd_strdata = dt_alloc(dtp, len);
- if (sdp->dtsd_strdata == NULL)
- longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
- (void) snprintf(sdp->dtsd_strdata, len, "%s`%d", dmp->dm_name,
- dret->dn_type);
-
- ap->dtad_difo = dt_as(yypcb);
- ap->dtad_kind = DTRACEACT_DIFEXPR;
-}
-
static void
dt_action_tracemem(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
{
dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
dt_node_t *addr = dnp->dn_args;
- dt_node_t *max = dnp->dn_args->dn_list;
- dt_node_t *size;
+ dt_node_t *size = dnp->dn_args->dn_list;
char n[DT_TYPE_NAMELEN];
@@ -743,37 +694,17 @@ dt_action_tracemem(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
dt_node_type_name(addr, n, sizeof (n)));
}
- if (dt_node_is_posconst(max) == 0) {
- dnerror(max, D_TRACEMEM_SIZE, "tracemem( ) argument #2 must "
+ if (dt_node_is_posconst(size) == 0) {
+ dnerror(size, D_TRACEMEM_SIZE, "tracemem( ) argument #2 must "
"be a non-zero positive integral constant expression\n");
}
- if ((size = max->dn_list) != NULL) {
- if (size->dn_list != NULL) {
- dnerror(size, D_TRACEMEM_ARGS, "tracemem ( ) prototype "
- "mismatch: expected at most 3 args\n");
- }
-
- if (!dt_node_is_scalar(size)) {
- dnerror(size, D_TRACEMEM_DYNSIZE, "tracemem ( ) "
- "dynamic size (argument #3) must be of "
- "scalar type\n");
- }
-
- dt_cg(yypcb, size);
- ap->dtad_difo = dt_as(yypcb);
- ap->dtad_difo->dtdo_rtype = dt_int_rtype;
- ap->dtad_kind = DTRACEACT_TRACEMEM_DYNSIZE;
-
- ap = dt_stmt_action(dtp, sdp);
- }
-
dt_cg(yypcb, addr);
ap->dtad_difo = dt_as(yypcb);
- ap->dtad_kind = DTRACEACT_TRACEMEM;
+ ap->dtad_kind = DTRACEACT_DIFEXPR;
ap->dtad_difo->dtdo_rtype.dtdt_flags |= DIF_TF_BYREF;
- ap->dtad_difo->dtdo_rtype.dtdt_size = max->dn_value;
+ ap->dtad_difo->dtdo_rtype.dtdt_size = size->dn_value;
}
static void
@@ -1103,9 +1034,6 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
case DT_ACT_TRACE:
dt_action_trace(dtp, dnp->dn_expr, sdp);
break;
- case DT_ACT_PRINT:
- dt_action_print(dtp, dnp->dn_expr, sdp);
- break;
case DT_ACT_TRACEMEM:
dt_action_tracemem(dtp, dnp->dn_expr, sdp);
break;
@@ -1363,145 +1291,6 @@ dt_compile_agg(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
argmax = 5;
}
- if (fid->di_id == DTRACEAGG_LLQUANTIZE) {
- /*
- * For log/linear quantizations, we have between one and five
- * arguments in addition to the expression:
- *
- * arg1 => Factor
- * arg2 => Low magnitude
- * arg3 => High magnitude
- * arg4 => Number of steps per magnitude
- * arg5 => Quantization increment value (defaults to 1)
- */
- dt_node_t *llarg = dnp->dn_aggfun->dn_args->dn_list;
- uint64_t oarg, order, v;
- dt_idsig_t *isp;
- int i;
-
- struct {
- char *str; /* string identifier */
- int badtype; /* error on bad type */
- int badval; /* error on bad value */
- int mismatch; /* error on bad match */
- int shift; /* shift value */
- uint16_t value; /* value itself */
- } args[] = {
- { "factor", D_LLQUANT_FACTORTYPE,
- D_LLQUANT_FACTORVAL, D_LLQUANT_FACTORMATCH,
- DTRACE_LLQUANTIZE_FACTORSHIFT },
- { "low magnitude", D_LLQUANT_LOWTYPE,
- D_LLQUANT_LOWVAL, D_LLQUANT_LOWMATCH,
- DTRACE_LLQUANTIZE_LOWSHIFT },
- { "high magnitude", D_LLQUANT_HIGHTYPE,
- D_LLQUANT_HIGHVAL, D_LLQUANT_HIGHMATCH,
- DTRACE_LLQUANTIZE_HIGHSHIFT },
- { "linear steps per magnitude", D_LLQUANT_NSTEPTYPE,
- D_LLQUANT_NSTEPVAL, D_LLQUANT_NSTEPMATCH,
- DTRACE_LLQUANTIZE_NSTEPSHIFT },
- { NULL }
- };
-
- assert(arg == 0);
-
- for (i = 0; args[i].str != NULL; i++) {
- if (llarg->dn_kind != DT_NODE_INT) {
- dnerror(llarg, args[i].badtype, "llquantize( ) "
- "argument #%d (%s) must be an "
- "integer constant\n", i + 1, args[i].str);
- }
-
- if ((uint64_t)llarg->dn_value > UINT16_MAX) {
- dnerror(llarg, args[i].badval, "llquantize( ) "
- "argument #%d (%s) must be an unsigned "
- "16-bit quantity\n", i + 1, args[i].str);
- }
-
- args[i].value = (uint16_t)llarg->dn_value;
-
- assert(!(arg & (UINT16_MAX << args[i].shift)));
- arg |= ((uint64_t)args[i].value << args[i].shift);
- llarg = llarg->dn_list;
- }
-
- assert(arg != 0);
-
- if (args[0].value < 2) {
- dnerror(dnp, D_LLQUANT_FACTORSMALL, "llquantize( ) "
- "factor (argument #1) must be two or more\n");
- }
-
- if (args[1].value >= args[2].value) {
- dnerror(dnp, D_LLQUANT_MAGRANGE, "llquantize( ) "
- "high magnitude (argument #3) must be greater "
- "than low magnitude (argument #2)\n");
- }
-
- if (args[3].value < args[0].value) {
- dnerror(dnp, D_LLQUANT_FACTORNSTEPS, "llquantize( ) "
- "factor (argument #1) must be less than or "
- "equal to the number of linear steps per "
- "magnitude (argument #4)\n");
- }
-
- for (v = args[0].value; v < args[3].value; v *= args[0].value)
- continue;
-
- if ((args[3].value % args[0].value) || (v % args[3].value)) {
- dnerror(dnp, D_LLQUANT_FACTOREVEN, "llquantize( ) "
- "factor (argument #1) must evenly divide the "
- "number of steps per magnitude (argument #4), "
- "and the number of steps per magnitude must evenly "
- "divide a power of the factor\n");
- }
-
- for (i = 0, order = 1; i < args[2].value; i++) {
- if (order * args[0].value > order) {
- order *= args[0].value;
- continue;
- }
-
- dnerror(dnp, D_LLQUANT_MAGTOOBIG, "llquantize( ) "
- "factor (%d) raised to power of high magnitude "
- "(%d) overflows 64-bits\n", args[0].value,
- args[2].value);
- }
-
- isp = (dt_idsig_t *)aid->di_data;
-
- if (isp->dis_auxinfo == 0) {
- /*
- * This is the first time we've seen an llquantize()
- * for this aggregation; we'll store our argument
- * as the auxiliary signature information.
- */
- isp->dis_auxinfo = arg;
- } else if ((oarg = isp->dis_auxinfo) != arg) {
- /*
- * If we have seen this llquantize() before and the
- * argument doesn't match the original argument, pick
- * the original argument apart to concisely report the
- * mismatch.
- */
- int expected = 0, found = 0;
-
- for (i = 0; expected == found; i++) {
- assert(args[i].str != NULL);
-
- expected = (oarg >> args[i].shift) & UINT16_MAX;
- found = (arg >> args[i].shift) & UINT16_MAX;
- }
-
- dnerror(dnp, args[i - 1].mismatch, "llquantize( ) "
- "%s (argument #%d) doesn't match previous "
- "declaration: expected %d, found %d\n",
- args[i - 1].str, i, expected, found);
- }
-
- incr = llarg;
- argmax = 6;
- }
-
if (fid->di_id == DTRACEAGG_QUANTIZE) {
incr = dnp->dn_aggfun->dn_args->dn_list;
argmax = 2;
@@ -2124,23 +1913,25 @@ dt_lib_depend_free(dtrace_hdl_t *dtp)
}
}
+
/*
- * Open all the .d library files found in the specified directory and
- * compile each one of them. We silently ignore any missing directories and
- * other files found therein. We only fail (and thereby fail dt_load_libs()) if
- * we fail to compile a library and the error is something other than #pragma D
- * depends_on. Dependency errors are silently ignored to permit a library
- * directory to contain libraries which may not be accessible depending on our
- * privileges.
+ * Open all of the .d library files found in the specified directory and
+ * compile each one in topological order to cache its inlines and translators,
+ * etc. We silently ignore any missing directories and other files found
+ * therein. We only fail (and thereby fail dt_load_libs()) if we fail to
+ * compile a library and the error is something other than #pragma D depends_on.
+ * Dependency errors are silently ignored to permit a library directory to
+ * contain libraries which may not be accessible depending on our privileges.
*/
static int
dt_load_libs_dir(dtrace_hdl_t *dtp, const char *path)
{
struct dirent *dp;
- const char *p, *end;
+ const char *p;
DIR *dirp;
char fname[PATH_MAX];
+ dtrace_prog_t *pgp;
FILE *fp;
void *rv;
dt_lib_depend_t *dld;
@@ -2164,28 +1955,9 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, const char *path)
continue;
}
- /*
- * Skip files whose name match an already processed library
- */
- for (dld = dt_list_next(&dtp->dt_lib_dep); dld != NULL;
- dld = dt_list_next(dld)) {
- end = strrchr(dld->dtld_library, '/');
- /* dt_lib_depend_add ensures this */
- assert(end != NULL);
- if (strcmp(end + 1, dp->d_name) == 0)
- break;
- }
-
- if (dld != NULL) {
- dt_dprintf("skipping library %s, already processed "
- "library with the same name: %s", dp->d_name,
- dld->dtld_library);
- continue;
- }
-
dtp->dt_filetag = fname;
if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0)
- return (-1); /* preserve dt_errno */
+ goto err;
rv = dt_compile(dtp, DT_CTX_DPROG,
DTRACE_PROBESPEC_NAME, NULL,
@@ -2194,7 +1966,7 @@ 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)))
- return (-1); /* preserve dt_errno */
+ goto err;
if (dtp->dt_errno)
dt_dprintf("error parsing library %s: %s\n",
@@ -2205,27 +1977,6 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, const char *path)
}
(void) closedir(dirp);
-
- return (0);
-}
-
-/*
- * Perform a topological sorting of all the libraries found across the entire
- * dt_lib_path. Once sorted, compile each one in topological order to cache its
- * inlines and translators, etc. We silently ignore any missing directories and
- * other files found therein. We only fail (and thereby fail dt_load_libs()) if
- * we fail to compile a library and the error is something other than #pragma D
- * depends_on. Dependency errors are silently ignored to permit a library
- * directory to contain libraries which may not be accessible depending on our
- * privileges.
- */
-static int
-dt_load_libs_sort(dtrace_hdl_t *dtp)
-{
- dtrace_prog_t *pgp;
- FILE *fp;
- dt_lib_depend_t *dld;
-
/*
* Finish building the graph containing the library dependencies
* and perform a topological sort to generate an ordered list
@@ -2286,14 +2037,7 @@ dt_load_libs(dtrace_hdl_t *dtp)
dtp->dt_cflags |= DTRACE_C_NOLIBS;
- /*
- * /usr/lib/dtrace is always at the head of the list. The rest of the
- * list is specified in the precedence order the user requested. Process
- * everything other than the head first. DTRACE_C_NOLIBS has already
- * been spcified so dt_vopen will ensure that there is always one entry
- * in dt_lib_path.
- */
- for (dirp = dt_list_next(dt_list_next(&dtp->dt_lib_path));
+ for (dirp = dt_list_next(&dtp->dt_lib_path);
dirp != NULL; dirp = dt_list_next(dirp)) {
if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) {
dtp->dt_cflags &= ~DTRACE_C_NOLIBS;
@@ -2301,16 +2045,6 @@ dt_load_libs(dtrace_hdl_t *dtp)
}
}
- /* Handle /usr/lib/dtrace */
- dirp = dt_list_next(&dtp->dt_lib_path);
- if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) {
- dtp->dt_cflags &= ~DTRACE_C_NOLIBS;
- return (-1); /* errno is set for us */
- }
-
- if (dt_load_libs_sort(dtp) < 0)
- return (-1); /* errno is set for us */
-
return (0);
}
diff --git a/lib/libdtrace/common/dt_consume.c b/lib/libdtrace/common/dt_consume.c
index d3a554c1c6b7..564189a000ad 100644
--- a/lib/libdtrace/common/dt_consume.c
+++ b/lib/libdtrace/common/dt_consume.c
@@ -23,11 +23,6 @@
* Use is subject to license terms.
*/
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
#include <stdlib.h>
#include <strings.h>
#include <errno.h>
@@ -686,121 +681,6 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
return (0);
}
-int
-dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
- size_t size, uint64_t normal)
-{
- int i, first_bin, last_bin, bin = 1, order, levels;
- uint16_t factor, low, high, nsteps;
- const int64_t *data = addr;
- int64_t value = 1, next, step;
- char positives = 0, negatives = 0;
- long double total = 0;
- uint64_t arg;
- char c[32];
-
- if (size < sizeof (uint64_t))
- return (dt_set_errno(dtp, EDT_DMISMATCH));
-
- arg = *data++;
- size -= sizeof (uint64_t);
-
- factor = DTRACE_LLQUANTIZE_FACTOR(arg);
- low = DTRACE_LLQUANTIZE_LOW(arg);
- high = DTRACE_LLQUANTIZE_HIGH(arg);
- nsteps = DTRACE_LLQUANTIZE_NSTEP(arg);
-
- /*
- * We don't expect to be handed invalid llquantize() parameters here,
- * but sanity check them (to a degree) nonetheless.
- */
- if (size > INT32_MAX || factor < 2 || low >= high ||
- nsteps == 0 || factor > nsteps)
- return (dt_set_errno(dtp, EDT_DMISMATCH));
-
- levels = (int)size / sizeof (uint64_t);
-
- first_bin = 0;
- last_bin = levels - 1;
-
- while (first_bin < levels && data[first_bin] == 0)
- first_bin++;
-
- if (first_bin == levels) {
- first_bin = 0;
- last_bin = 1;
- } else {
- if (first_bin > 0)
- first_bin--;
-
- while (last_bin > 0 && data[last_bin] == 0)
- last_bin--;
-
- if (last_bin < levels - 1)
- last_bin++;
- }
-
- for (i = first_bin; i <= last_bin; i++) {
- positives |= (data[i] > 0);
- negatives |= (data[i] < 0);
- total += dt_fabsl((long double)data[i]);
- }
-
- if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value",
- "------------- Distribution -------------", "count") < 0)
- return (-1);
-
- for (order = 0; order < low; order++)
- value *= factor;
-
- next = value * factor;
- step = next > nsteps ? next / nsteps : 1;
-
- if (first_bin == 0) {
- (void) snprintf(c, sizeof (c), "< %lld", value);
-
- if (dt_printf(dtp, fp, "%16s ", c) < 0)
- return (-1);
-
- if (dt_print_quantline(dtp, fp, data[0], normal,
- total, positives, negatives) < 0)
- return (-1);
- }
-
- while (order <= high) {
- if (bin >= first_bin && bin <= last_bin) {
- if (dt_printf(dtp, fp, "%16lld ", (long long)value) < 0)
- return (-1);
-
- if (dt_print_quantline(dtp, fp, data[bin],
- normal, total, positives, negatives) < 0)
- return (-1);
- }
-
- assert(value < next);
- bin++;
-
- if ((value += step) != next)
- continue;
-
- next = value * factor;
- step = next > nsteps ? next / nsteps : 1;
- order++;
- }
-
- if (last_bin < bin)
- return (0);
-
- assert(last_bin == bin);
- (void) snprintf(c, sizeof (c), ">= %lld", value);
-
- if (dt_printf(dtp, fp, "%16s ", c) < 0)
- return (-1);
-
- return (dt_print_quantline(dtp, fp, data[bin], normal,
- total, positives, negatives));
-}
-
/*ARGSUSED*/
static int
dt_print_average(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
@@ -828,7 +708,7 @@ dt_print_stddev(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
/*ARGSUSED*/
int
dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
- size_t nbytes, int width, int quiet, int forceraw)
+ size_t nbytes, int width, int quiet)
{
/*
* If the byte stream is a series of printable characters, followed by
@@ -841,9 +721,6 @@ dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
if (nbytes == 0)
return (0);
- if (forceraw)
- goto raw;
-
if (dtp->dt_options[DTRACEOPT_RAWBYTES] != DTRACEOPT_UNSET)
goto raw;
@@ -1520,9 +1397,6 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec,
case DTRACEAGG_LQUANTIZE:
return (dt_print_lquantize(dtp, fp, addr, size, normal));
- case DTRACEAGG_LLQUANTIZE:
- return (dt_print_llquantize(dtp, fp, addr, size, normal));
-
case DTRACEAGG_AVG:
return (dt_print_average(dtp, fp, addr, size, normal));
@@ -1554,7 +1428,7 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec,
(uint32_t)normal);
break;
default:
- err = dt_print_bytes(dtp, fp, addr, size, 50, 0, 0);
+ err = dt_print_bytes(dtp, fp, addr, size, 50, 0);
break;
}
@@ -1709,7 +1583,6 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, dtrace_bufdesc_t *buf,
int quiet = (dtp->dt_options[DTRACEOPT_QUIET] != DTRACEOPT_UNSET);
int rval, i, n;
dtrace_epid_t last = DTRACE_EPIDNONE;
- uint64_t tracememsize = 0;
dtrace_probedata_t data;
uint64_t drops;
caddr_t addr;
@@ -1878,13 +1751,6 @@ again:
}
}
- if (act == DTRACEACT_TRACEMEM_DYNSIZE &&
- rec->dtrd_size == sizeof (uint64_t)) {
- /* LINTED - alignment */
- tracememsize = *((unsigned long long *)addr);
- continue;
- }
-
rval = (*rfunc)(&data, rec, arg);
if (rval == DTRACE_CONSUME_NEXT)
@@ -1976,35 +1842,6 @@ again:
goto nextrec;
}
- /*
- * If this is a DIF expression, and the record has a
- * format set, this indicates we have a CTF type name
- * associated with the data and we should try to print
- * it out by type.
- */
- if (act == DTRACEACT_DIFEXPR) {
- const char *strdata = dt_strdata_lookup(dtp,
- rec->dtrd_format);
- if (strdata != NULL) {
- n = dtrace_print(dtp, fp, strdata,
- addr, rec->dtrd_size);
-
- /*
- * dtrace_print() will return -1 on
- * error, or return the number of bytes
- * consumed. It will return 0 if the
- * type couldn't be determined, and we
- * should fall through to the normal
- * trace method.
- */
- if (n < 0)
- return (-1);
-
- if (n > 0)
- goto nextrec;
- }
- }
-
nofmt:
if (act == DTRACEACT_PRINTA) {
dt_print_aggdata_t pd;
@@ -2073,23 +1910,6 @@ nofmt:
goto nextrec;
}
- if (act == DTRACEACT_TRACEMEM) {
- if (tracememsize == 0 ||
- tracememsize > rec->dtrd_size) {
- tracememsize = rec->dtrd_size;
- }
-
- n = dt_print_bytes(dtp, fp, addr,
- tracememsize, 33, quiet, 1);
-
- tracememsize = 0;
-
- if (n < 0)
- return (-1);
-
- goto nextrec;
- }
-
switch (rec->dtrd_size) {
case sizeof (uint64_t):
n = dt_printf(dtp, fp,
@@ -2113,7 +1933,7 @@ nofmt:
break;
default:
n = dt_print_bytes(dtp, fp, addr,
- rec->dtrd_size, 33, quiet, 0);
+ rec->dtrd_size, 33, quiet);
break;
}
diff --git a/lib/libdtrace/common/dt_dof.c b/lib/libdtrace/common/dt_dof.c
index 04c4c89cdbdb..a7eb8e4d239f 100644
--- a/lib/libdtrace/common/dt_dof.c
+++ b/lib/libdtrace/common/dt_dof.c
@@ -21,7 +21,6 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
*/
#include <sys/types.h>
@@ -755,23 +754,16 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t flags)
dofa[i].dofa_difo = DOF_SECIDX_NONE;
/*
- * If the first action in a statement has string data,
- * add the string to the global string table. This can
- * be due either to a printf() format string
- * (dtsd_fmtdata) or a print() type string
- * (dtsd_strdata).
+ * If the first action in a statement has format data,
+ * add the format string to the global string table.
*/
if (sdp != NULL && ap == sdp->dtsd_action) {
if (sdp->dtsd_fmtdata != NULL) {
(void) dtrace_printf_format(dtp,
sdp->dtsd_fmtdata, fmt, maxfmt + 1);
strndx = dof_add_string(ddo, fmt);
- } else if (sdp->dtsd_strdata != NULL) {
- strndx = dof_add_string(ddo,
- sdp->dtsd_strdata);
- } else {
+ } else
strndx = 0; /* use dtad_arg instead */
- }
if ((next = dt_list_next(next)) != NULL)
sdp = next->ds_desc;
diff --git a/lib/libdtrace/common/dt_errtags.h b/lib/libdtrace/common/dt_errtags.h
index 473e2addc789..9e32dfdf2492 100644
--- a/lib/libdtrace/common/dt_errtags.h
+++ b/lib/libdtrace/common/dt_errtags.h
@@ -24,14 +24,11 @@
* Use is subject to license terms.
*/
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
#ifndef _DT_ERRTAGS_H
#define _DT_ERRTAGS_H
+#pragma ident "%Z%%M% %I% %E% SMI"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -190,12 +187,8 @@ typedef enum {
D_PRINTA_AGGPROTO, /* printa() aggregation mismatch */
D_TRACE_VOID, /* trace() argument has void type */
D_TRACE_DYN, /* trace() argument has dynamic type */
- D_PRINT_VOID, /* print() argument has void type */
- D_PRINT_DYN, /* print() argument has dynamic type */
D_TRACEMEM_ADDR, /* tracemem() address bad type */
D_TRACEMEM_SIZE, /* tracemem() size bad type */
- D_TRACEMEM_ARGS, /* tracemem() illegal number of args */
- D_TRACEMEM_DYNSIZE, /* tracemem() dynamic size bad type */
D_STACK_PROTO, /* stack() prototype mismatch */
D_STACK_SIZE, /* stack() size argument bad type */
D_USTACK_FRAMES, /* ustack() frames arg bad type */
@@ -242,24 +235,7 @@ typedef enum {
D_FREOPEN_INVALID, /* frename() filename is invalid */
D_LQUANT_MATCHBASE, /* lquantize() mismatch on base */
D_LQUANT_MATCHLIM, /* lquantize() mismatch on limit */
- D_LQUANT_MATCHSTEP, /* lquantize() mismatch on step */
- D_LLQUANT_FACTORTYPE, /* llquantize() bad magnitude type */
- D_LLQUANT_FACTORVAL, /* llquantize() bad magnitude value */
- D_LLQUANT_FACTORMATCH, /* llquantize() mismatch on magnitude */
- D_LLQUANT_LOWTYPE, /* llquantize() bad low mag type */
- D_LLQUANT_LOWVAL, /* llquantize() bad low mag value */
- D_LLQUANT_LOWMATCH, /* llquantize() mismatch on low mag */
- D_LLQUANT_HIGHTYPE, /* llquantize() bad high mag type */
- D_LLQUANT_HIGHVAL, /* llquantize() bad high mag value */
- D_LLQUANT_HIGHMATCH, /* llquantize() mismatch on high mag */
- D_LLQUANT_NSTEPTYPE, /* llquantize() bad # steps type */
- D_LLQUANT_NSTEPVAL, /* llquantize() bad # steps value */
- D_LLQUANT_NSTEPMATCH, /* llquantize() mismatch on # steps */
- D_LLQUANT_MAGRANGE, /* llquantize() bad magnitude range */
- D_LLQUANT_FACTORNSTEPS, /* llquantize() # steps < factor */
- D_LLQUANT_FACTOREVEN, /* llquantize() bad # steps/factor */
- D_LLQUANT_FACTORSMALL, /* llquantize() magnitude too small */
- D_LLQUANT_MAGTOOBIG /* llquantize() high mag too large */
+ D_LQUANT_MATCHSTEP /* lquantize() mismatch on step */
} dt_errtag_t;
extern const char *dt_errtag(dt_errtag_t);
diff --git a/lib/libdtrace/common/dt_impl.h b/lib/libdtrace/common/dt_impl.h
index b06fd6477d7a..1937ce06474d 100644
--- a/lib/libdtrace/common/dt_impl.h
+++ b/lib/libdtrace/common/dt_impl.h
@@ -24,11 +24,6 @@
* Use is subject to license terms.
*/
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
#ifndef _DT_IMPL_H
#define _DT_IMPL_H
@@ -241,8 +236,6 @@ struct dtrace_hdl {
dtrace_aggdesc_t **dt_aggdesc; /* aggregation descriptions */
int dt_maxformat; /* max format ID */
void **dt_formats; /* pointer to format array */
- int dt_maxstrdata; /* max strdata ID */
- char **dt_strdata; /* pointer to strdata array */
dt_aggregate_t dt_aggregate; /* aggregate */
dtrace_bufdesc_t dt_buf; /* staging buffer */
struct dt_pfdict *dt_pfdict; /* dictionary of printf conversions */
@@ -420,7 +413,6 @@ struct dtrace_hdl {
#define DT_ACT_UMOD DT_ACT(26) /* umod() action */
#define DT_ACT_UADDR DT_ACT(27) /* uaddr() action */
#define DT_ACT_SETOPT DT_ACT(28) /* setopt() action */
-#define DT_ACT_PRINT DT_ACT(29) /* print() action */
/*
* Sentinel to tell freopen() to restore the saved stdout. This must not
@@ -604,15 +596,10 @@ extern void dt_aggid_destroy(dtrace_hdl_t *);
extern void *dt_format_lookup(dtrace_hdl_t *, int);
extern void dt_format_destroy(dtrace_hdl_t *);
-extern const char *dt_strdata_lookup(dtrace_hdl_t *, int);
-extern void dt_strdata_destroy(dtrace_hdl_t *);
-
extern int dt_print_quantize(dtrace_hdl_t *, FILE *,
const void *, size_t, uint64_t);
extern int dt_print_lquantize(dtrace_hdl_t *, FILE *,
const void *, size_t, uint64_t);
-extern int dt_print_llquantize(dtrace_hdl_t *, FILE *,
- const void *, size_t, uint64_t);
extern int dt_print_agg(const dtrace_aggdata_t *, void *);
extern int dt_handle(dtrace_hdl_t *, dtrace_probedata_t *);
diff --git a/lib/libdtrace/common/dt_map.c b/lib/libdtrace/common/dt_map.c
index 8a3ce817e4d7..15361862de8f 100644
--- a/lib/libdtrace/common/dt_map.c
+++ b/lib/libdtrace/common/dt_map.c
@@ -23,9 +23,7 @@
* Use is subject to license terms.
*/
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
+#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <strings.h>
@@ -37,81 +35,10 @@
#include <dt_printf.h>
static int
-dt_strdata_add(dtrace_hdl_t *dtp, dtrace_recdesc_t *rec, void ***data, int *max)
-{
- int maxformat;
- dtrace_fmtdesc_t fmt;
- void *result;
-
- if (rec->dtrd_format == 0)
- return (0);
-
- if (rec->dtrd_format <= *max &&
- (*data)[rec->dtrd_format - 1] != NULL) {
- return (0);
- }
-
- bzero(&fmt, sizeof (fmt));
- fmt.dtfd_format = rec->dtrd_format;
- fmt.dtfd_string = NULL;
- fmt.dtfd_length = 0;
-
- if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1)
- return (dt_set_errno(dtp, errno));
-
- if ((fmt.dtfd_string = dt_alloc(dtp, fmt.dtfd_length)) == NULL)
- return (dt_set_errno(dtp, EDT_NOMEM));
-
- if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1) {
- free(fmt.dtfd_string);
- return (dt_set_errno(dtp, errno));
- }
-
- while (rec->dtrd_format > (maxformat = *max)) {
- int new_max = maxformat ? (maxformat << 1) : 1;
- size_t nsize = new_max * sizeof (void *);
- size_t osize = maxformat * sizeof (void *);
- void **new_data = dt_zalloc(dtp, nsize);
-
- if (new_data == NULL) {
- dt_free(dtp, fmt.dtfd_string);
- return (dt_set_errno(dtp, EDT_NOMEM));
- }
-
- bcopy(*data, new_data, osize);
- free(*data);
-
- *data = new_data;
- *max = new_max;
- }
-
- switch (rec->dtrd_action) {
- case DTRACEACT_DIFEXPR:
- result = fmt.dtfd_string;
- break;
- case DTRACEACT_PRINTA:
- result = dtrace_printa_create(dtp, fmt.dtfd_string);
- dt_free(dtp, fmt.dtfd_string);
- break;
- default:
- result = dtrace_printf_create(dtp, fmt.dtfd_string);
- dt_free(dtp, fmt.dtfd_string);
- break;
- }
-
- if (result == NULL)
- return (-1);
-
- (*data)[rec->dtrd_format - 1] = result;
-
- return (0);
-}
-
-static int
dt_epid_add(dtrace_hdl_t *dtp, dtrace_epid_t id)
{
dtrace_id_t max;
- int rval, i;
+ int rval, i, maxformat;
dtrace_eprobedesc_t *enabled, *nenabled;
dtrace_probedesc_t *probe;
@@ -197,23 +124,71 @@ dt_epid_add(dtrace_hdl_t *dtp, dtrace_epid_t id)
}
for (i = 0; i < enabled->dtepd_nrecs; i++) {
+ dtrace_fmtdesc_t fmt;
dtrace_recdesc_t *rec = &enabled->dtepd_rec[i];
- if (DTRACEACT_ISPRINTFLIKE(rec->dtrd_action)) {
- if (dt_strdata_add(dtp, rec, &dtp->dt_formats,
- &dtp->dt_maxformat) != 0) {
- rval = -1;
- goto err;
- }
- } else if (rec->dtrd_action == DTRACEACT_DIFEXPR) {
- if (dt_strdata_add(dtp, rec,
- (void ***)&dtp->dt_strdata,
- &dtp->dt_maxstrdata) != 0) {
- rval = -1;
+ if (!DTRACEACT_ISPRINTFLIKE(rec->dtrd_action))
+ continue;
+
+ if (rec->dtrd_format == 0)
+ continue;
+
+ if (rec->dtrd_format <= dtp->dt_maxformat &&
+ dtp->dt_formats[rec->dtrd_format - 1] != NULL)
+ continue;
+
+ bzero(&fmt, sizeof (fmt));
+ fmt.dtfd_format = rec->dtrd_format;
+ fmt.dtfd_string = NULL;
+ fmt.dtfd_length = 0;
+
+ if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1) {
+ rval = dt_set_errno(dtp, errno);
+ goto err;
+ }
+
+ if ((fmt.dtfd_string = malloc(fmt.dtfd_length)) == NULL) {
+ rval = dt_set_errno(dtp, EDT_NOMEM);
+ goto err;
+ }
+
+ if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1) {
+ rval = dt_set_errno(dtp, errno);
+ free(fmt.dtfd_string);
+ goto err;
+ }
+
+ while (rec->dtrd_format > (maxformat = dtp->dt_maxformat)) {
+ int new_max = maxformat ? (maxformat << 1) : 1;
+ size_t nsize = new_max * sizeof (void *);
+ size_t osize = maxformat * sizeof (void *);
+ void **new_formats = malloc(nsize);
+
+ if (new_formats == NULL) {
+ rval = dt_set_errno(dtp, EDT_NOMEM);
+ free(fmt.dtfd_string);
goto err;
}
+
+ bzero(new_formats, nsize);
+ bcopy(dtp->dt_formats, new_formats, osize);
+ free(dtp->dt_formats);
+
+ dtp->dt_formats = new_formats;
+ dtp->dt_maxformat = new_max;
}
+ dtp->dt_formats[rec->dtrd_format - 1] =
+ rec->dtrd_action == DTRACEACT_PRINTA ?
+ dtrace_printa_create(dtp, fmt.dtfd_string) :
+ dtrace_printf_create(dtp, fmt.dtfd_string);
+
+ free(fmt.dtfd_string);
+
+ if (dtp->dt_formats[rec->dtrd_format - 1] == NULL) {
+ rval = -1; /* dt_errno is set for us */
+ goto err;
+ }
}
dtp->dt_pdesc[id] = probe;
@@ -449,28 +424,3 @@ dt_aggid_destroy(dtrace_hdl_t *dtp)
dtp->dt_aggdesc = NULL;
dtp->dt_maxagg = 0;
}
-
-const char *
-dt_strdata_lookup(dtrace_hdl_t *dtp, int idx)
-{
- if (idx == 0 || idx > dtp->dt_maxstrdata)
- return (NULL);
-
- if (dtp->dt_strdata == NULL)
- return (NULL);
-
- return (dtp->dt_strdata[idx - 1]);
-}
-
-void
-dt_strdata_destroy(dtrace_hdl_t *dtp)
-{
- int i;
-
- for (i = 0; i < dtp->dt_maxstrdata; i++) {
- free(dtp->dt_strdata[i]);
- }
-
- free(dtp->dt_strdata);
- dtp->dt_strdata = NULL;
-}
diff --git a/lib/libdtrace/common/dt_open.c b/lib/libdtrace/common/dt_open.c
index 502a9d42ad73..2b9cd7c414da 100644
--- a/lib/libdtrace/common/dt_open.c
+++ b/lib/libdtrace/common/dt_open.c
@@ -21,8 +21,6 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
*/
#include <sys/types.h>
@@ -105,13 +103,8 @@
#define DT_VERS_1_6_1 DT_VERSION_NUMBER(1, 6, 1)
#define DT_VERS_1_6_2 DT_VERSION_NUMBER(1, 6, 2)
#define DT_VERS_1_6_3 DT_VERSION_NUMBER(1, 6, 3)
-#define DT_VERS_1_7 DT_VERSION_NUMBER(1, 7, 0)
-#define DT_VERS_1_7_1 DT_VERSION_NUMBER(1, 7, 1)
-#define DT_VERS_1_8 DT_VERSION_NUMBER(1, 8, 0)
-#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_LATEST DT_VERS_1_9
-#define DT_VERS_STRING "Sun D 1.9"
+#define DT_VERS_LATEST DT_VERS_1_6_3
+#define DT_VERS_STRING "Sun D 1.6.3"
const dt_version_t _dtrace_versions[] = {
DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
@@ -127,11 +120,6 @@ const dt_version_t _dtrace_versions[] = {
DT_VERS_1_6_1, /* D API 1.6.1 */
DT_VERS_1_6_2, /* D API 1.6.2 */
DT_VERS_1_6_3, /* D API 1.6.3 */
- DT_VERS_1_7, /* D API 1.7 */
- DT_VERS_1_7_1, /* D API 1.7.1 */
- DT_VERS_1_8, /* D API 1.8 */
- DT_VERS_1_8_1, /* D API 1.8.1 */
- DT_VERS_1_9, /* D API 1.9 */
0
};
@@ -262,10 +250,7 @@ static const dt_ident_t _dtrace_globals[] = {
{ "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "stack(...)" },
{ "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
- &dt_idops_func, "string(int64_t, [int])" },
-{ "llquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LLQUANTIZE, DT_ATTR_STABCMN,
- DT_VERS_1_7, &dt_idops_func,
- "void(@, int32_t, int32_t, int32_t, int32_t, ...)" },
+ &dt_idops_func, "string(int64_t)" },
{ "lquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LQUANTIZE,
DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(@, int32_t, int32_t, ...)" },
@@ -307,8 +292,6 @@ static const dt_ident_t _dtrace_globals[] = {
&dt_idops_type, "pid_t" },
{ "ppid", DT_IDENT_SCALAR, 0, DIF_VAR_PPID, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "pid_t" },
-{ "print", DT_IDENT_ACTFUNC, 0, DT_ACT_PRINT, DT_ATTR_STABCMN, DT_VERS_1_9,
- &dt_idops_func, "void(@)" },
{ "printa", DT_IDENT_ACTFUNC, 0, DT_ACT_PRINTA, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(@, ...)" },
{ "printf", DT_IDENT_ACTFUNC, 0, DT_ACT_PRINTF, DT_ATTR_STABCMN, DT_VERS_1_0,
@@ -388,15 +371,11 @@ static const dt_ident_t _dtrace_globals[] = {
{ "timestamp", DT_IDENT_SCALAR, 0, DIF_VAR_TIMESTAMP,
DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "uint64_t" },
-{ "tolower", DT_IDENT_FUNC, 0, DIF_SUBR_TOLOWER, DT_ATTR_STABCMN, DT_VERS_1_8,
- &dt_idops_func, "string(const char *)" },
-{ "toupper", DT_IDENT_FUNC, 0, DIF_SUBR_TOUPPER, DT_ATTR_STABCMN, DT_VERS_1_8,
- &dt_idops_func, "string(const char *)" },
{ "trace", DT_IDENT_ACTFUNC, 0, DT_ACT_TRACE, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(@)" },
{ "tracemem", DT_IDENT_ACTFUNC, 0, DT_ACT_TRACEMEM,
DT_ATTR_STABCMN, DT_VERS_1_0,
- &dt_idops_func, "void(@, size_t, ...)" },
+ &dt_idops_func, "void(@, size_t)" },
{ "trunc", DT_IDENT_ACTFUNC, 0, DT_ACT_TRUNC, DT_ATTR_STABCMN,
DT_VERS_1_0, &dt_idops_func, "void(...)" },
{ "uaddr", DT_IDENT_ACTFUNC, 0, DT_ACT_UADDR, DT_ATTR_STABCMN,
@@ -418,8 +397,6 @@ static const dt_ident_t _dtrace_globals[] = {
&dt_idops_type, "uint32_t" },
{ "usym", DT_IDENT_ACTFUNC, 0, DT_ACT_USYM, DT_ATTR_STABCMN,
DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
-{ "vmregs", DT_IDENT_ARRAY, 0, DIF_VAR_VMREGS, DT_ATTR_STABCMN, DT_VERS_1_7,
- &dt_idops_regs, NULL },
{ "vtimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_VTIMESTAMP,
DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "uint64_t" },
@@ -1362,7 +1339,6 @@ dtrace_close(dtrace_hdl_t *dtp)
dt_epid_destroy(dtp);
dt_aggid_destroy(dtp);
dt_format_destroy(dtp);
- dt_strdata_destroy(dtp);
dt_buffered_destroy(dtp);
dt_aggregate_destroy(dtp);
free(dtp->dt_buf.dtbd_data);
diff --git a/lib/libdtrace/common/dt_options.c b/lib/libdtrace/common/dt_options.c
index 426f8cb73c7a..5353bfae528d 100644
--- a/lib/libdtrace/common/dt_options.c
+++ b/lib/libdtrace/common/dt_options.c
@@ -24,6 +24,8 @@
* Use is subject to license terms.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
#include <sys/resource.h>
#include <sys/mman.h>
#include <sys/types.h>
@@ -835,6 +837,30 @@ dt_options_load(dtrace_hdl_t *dtp)
return (0);
}
+/*ARGSUSED*/
+static int
+dt_opt_preallocate(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
+{
+ dtrace_optval_t size;
+ void *p;
+
+ if (arg == NULL || dt_optval_parse(arg, &size) != 0)
+ return (dt_set_errno(dtp, EDT_BADOPTVAL));
+
+ if (size > SIZE_MAX)
+ size = SIZE_MAX;
+
+ if ((p = dt_zalloc(dtp, size)) == NULL) {
+ do {
+ size /= 2;
+ } while ((p = dt_zalloc(dtp, size)) == NULL);
+ }
+
+ dt_free(dtp, p);
+
+ return (0);
+}
+
typedef struct dt_option {
const char *o_name;
int (*o_func)(dtrace_hdl_t *, const char *, uintptr_t);
@@ -873,6 +899,7 @@ static const dt_option_t _dtrace_ctoptions[] = {
{ "linktype", dt_opt_linktype },
{ "nolibs", dt_opt_cflags, DTRACE_C_NOLIBS },
{ "pgmax", dt_opt_pgmax },
+ { "preallocate", dt_opt_preallocate },
{ "pspec", dt_opt_cflags, DTRACE_C_PSPEC },
{ "stdc", dt_opt_stdc },
{ "strip", dt_opt_dflags, DTRACE_D_STRIP },
diff --git a/lib/libdtrace/common/dt_parser.c b/lib/libdtrace/common/dt_parser.c
index 05715894a7df..6ad30a9ac52a 100644
--- a/lib/libdtrace/common/dt_parser.c
+++ b/lib/libdtrace/common/dt_parser.c
@@ -21,7 +21,6 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/*
@@ -720,19 +719,12 @@ dt_node_type_name(const dt_node_t *dnp, char *buf, size_t len)
size_t
dt_node_type_size(const dt_node_t *dnp)
{
- ctf_id_t base;
-
if (dnp->dn_kind == DT_NODE_STRING)
return (strlen(dnp->dn_string) + 1);
if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL)
return (dt_ident_size(dnp->dn_ident));
- base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type);
-
- if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD)
- return (0);
-
return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type));
}
diff --git a/lib/libdtrace/common/dt_pragma.c b/lib/libdtrace/common/dt_pragma.c
index 9fae5ac42c40..9cb3c3b8d615 100644
--- a/lib/libdtrace/common/dt_pragma.c
+++ b/lib/libdtrace/common/dt_pragma.c
@@ -21,19 +21,14 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <assert.h>
#include <strings.h>
#include <alloca.h>
-#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
#include <dt_parser.h>
#include <dt_impl.h>
#include <dt_provider.h>
@@ -201,29 +196,6 @@ dt_pragma_binding(const char *prname, dt_node_t *dnp)
dtp->dt_globals->dh_defer = &dt_pragma_apply;
}
-static void
-dt_pragma_depends_finddep(dtrace_hdl_t *dtp, const char *lname, char *lib,
- size_t len)
-{
- dt_dirpath_t *dirp;
- struct stat sbuf;
- int found = 0;
-
- for (dirp = dt_list_next(&dtp->dt_lib_path); dirp != NULL;
- dirp = dt_list_next(dirp)) {
- (void) snprintf(lib, len, "%s/%s", dirp->dir_path, lname);
-
- if (stat(lib, &sbuf) == 0) {
- found = 1;
- break;
- }
- }
-
- if (!found)
- xyerror(D_PRAGMA_DEPEND,
- "failed to find dependency in libpath: %s", lname);
-}
-
/*
* The #pragma depends_on directive can be used to express a dependency on a
* module, provider or library which if not present will cause processing to
@@ -253,13 +225,16 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
if (yypcb->pcb_cflags & DTRACE_C_CTL) {
assert(dtp->dt_filetag != NULL);
- dt_pragma_depends_finddep(dtp, nnp->dn_string, lib,
- sizeof (lib));
-
+ /*
+ * We have the file we are working on in dtp->dt_filetag
+ * so find that node and add the dependency in.
+ */
dld = dt_lib_depend_lookup(&dtp->dt_lib_dep,
dtp->dt_filetag);
assert(dld != NULL);
+ (void) snprintf(lib, sizeof (lib), "%s%s",
+ dld->dtld_libpath, nnp->dn_string);
if ((dt_lib_depend_add(dtp, &dld->dtld_dependencies,
lib)) != 0) {
xyerror(D_PRAGMA_DEPEND,
@@ -281,8 +256,8 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
dtp->dt_filetag);
assert(dld != NULL);
- dt_pragma_depends_finddep(dtp, nnp->dn_string, lib,
- sizeof (lib));
+ (void) snprintf(lib, sizeof (lib), "%s%s",
+ dld->dtld_libpath, nnp->dn_string);
dld = dt_lib_depend_lookup(&dtp->dt_lib_dep_sorted,
lib);
assert(dld != NULL);
diff --git a/lib/libdtrace/common/dt_print.c b/lib/libdtrace/common/dt_print.c
deleted file mode 100644
index 261fc8ced4d5..000000000000
--- a/lib/libdtrace/common/dt_print.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c) 2011 by Delphix. All rights reserved.
- */
-
-/*
- * DTrace print() action
- *
- * This file contains the post-processing logic for the print() action. The
- * print action behaves identically to trace() in that it generates a
- * DTRACEACT_DIFEXPR action, but the action argument field refers to a CTF type
- * string stored in the DOF string table (similar to printf formats). We
- * take the result of the trace action and post-process it in the fashion of
- * MDB's ::print dcmd.
- *
- * This implementation differs from MDB's in the following ways:
- *
- * - We do not expose any options or flags. The behavior of print() is
- * equivalent to "::print -tn".
- *
- * - MDB will display "holes" in structures (unused padding between
- * members).
- *
- * - When printing arrays of structures, MDB will leave a trailing ','
- * after the last element.
- *
- * - MDB will print time_t types as date and time.
- *
- * - MDB will detect when an enum is actually the OR of several flags,
- * and print it out with the constituent flags separated.
- *
- * - For large arrays, MDB will print the first few members and then
- * print a "..." continuation line.
- *
- * - MDB will break and wrap arrays at 80 columns.
- *
- * - MDB prints out floats and doubles by hand, as it must run in kmdb
- * context. We're able to leverage the printf() format strings,
- * but the result is a slightly different format.
- */
-
-#include <sys/sysmacros.h>
-#include <strings.h>
-#include <stdlib.h>
-#include <alloca.h>
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <dt_module.h>
-#include <dt_printf.h>
-#include <dt_string.h>
-#include <dt_impl.h>
-
-/* determines whether the given integer CTF encoding is a character */
-#define CTF_IS_CHAR(e) \
- (((e).cte_format & (CTF_INT_CHAR | CTF_INT_SIGNED)) == \
- (CTF_INT_CHAR | CTF_INT_SIGNED) && (e).cte_bits == NBBY)
-/* determines whether the given CTF kind is a struct or union */
-#define CTF_IS_STRUCTLIKE(k) \
- ((k) == CTF_K_STRUCT || (k) == CTF_K_UNION)
-
-/*
- * Print structure passed down recursively through printing algorithm.
- */
-typedef struct dt_printarg {
- caddr_t pa_addr; /* base address of trace data */
- ctf_file_t *pa_ctfp; /* CTF container */
- int pa_depth; /* member depth */
- int pa_nest; /* nested array depth */
- FILE *pa_file; /* output file */
-} dt_printarg_t;
-
-static int dt_print_member(const char *, ctf_id_t, ulong_t, int, void *);
-
-/*
- * Safe version of ctf_type_name() that will fall back to just "<ctfid>" if it
- * can't resolve the type.
- */
-static void
-dt_print_type_name(ctf_file_t *ctfp, ctf_id_t id, char *buf, size_t buflen)
-{
- if (ctf_type_name(ctfp, id, buf, buflen) == NULL)
- (void) snprintf(buf, buflen, "<%ld>", id);
-}
-
-/*
- * Print any necessary trailing braces for structures or unions. We don't get
- * invoked when a struct or union ends, so we infer the need to print braces
- * based on the depth the last time we printed something and the new depth.
- */
-static void
-dt_print_trailing_braces(dt_printarg_t *pap, int depth)
-{
- int d;
-
- for (d = pap->pa_depth; d > depth; d--) {
- (void) fprintf(pap->pa_file, "%*s}%s",
- (d + pap->pa_nest - 1) * 4, "",
- d == depth + 1 ? "" : "\n");
- }
-}
-
-/*
- * Print the appropriate amount of indentation given the current depth and
- * array nesting.
- */
-static void
-dt_print_indent(dt_printarg_t *pap)
-{
- (void) fprintf(pap->pa_file, "%*s",
- (pap->pa_depth + pap->pa_nest) * 4, "");
-}
-
-/*
- * Print a bitfield. It's worth noting that the D compiler support for
- * bitfields is currently broken; printing "D`user_desc_t" (pulled in by the
- * various D provider files) will produce incorrect results compared to
- * "genunix`user_desc_t".
- */
-static void
-print_bitfield(dt_printarg_t *pap, ulong_t off, ctf_encoding_t *ep)
-{
- FILE *fp = pap->pa_file;
- caddr_t addr = pap->pa_addr + off / NBBY;
- uint64_t mask = (1ULL << ep->cte_bits) - 1;
- uint64_t value = 0;
- size_t size = (ep->cte_bits + (NBBY - 1)) / NBBY;
- uint8_t *buf = (uint8_t *)&value;
- uint8_t shift;
-
- /*
- * On big-endian machines, we need to adjust the buf pointer to refer
- * to the lowest 'size' bytes in 'value', and we need to shift based on
- * the offset from the end of the data, not the offset of the start.
- */
-#ifdef _BIG_ENDIAN
- buf += sizeof (value) - size;
- off += ep->cte_bits;
-#endif
- bcopy(addr, buf, size);
- shift = off % NBBY;
-
- /*
- * Offsets are counted from opposite ends on little- and
- * big-endian machines.
- */
-#ifdef _BIG_ENDIAN
- shift = NBBY - shift;
-#endif
-
- /*
- * If the bits we want do not begin on a byte boundary, shift the data
- * right so that the value is in the lowest 'cte_bits' of 'value'.
- */
- if (off % NBBY != 0)
- value >>= shift;
- value &= mask;
-
- (void) fprintf(fp, "%#llx", (u_longlong_t)value);
-}
-
-/*
- * Dump the contents of memory as a fixed-size integer in hex.
- */
-static void
-dt_print_hex(FILE *fp, caddr_t addr, size_t size)
-{
- switch (size) {
- case sizeof (uint8_t):
- (void) fprintf(fp, "%#x", *(uint8_t *)addr);
- break;
- case sizeof (uint16_t):
- /* LINTED - alignment */
- (void) fprintf(fp, "%#x", *(uint16_t *)addr);
- break;
- case sizeof (uint32_t):
- /* LINTED - alignment */
- (void) fprintf(fp, "%#x", *(uint32_t *)addr);
- break;
- case sizeof (uint64_t):
- (void) fprintf(fp, "%#llx",
- /* LINTED - alignment */
- (unsigned long long)*(uint64_t *)addr);
- break;
- default:
- (void) fprintf(fp, "<invalid size %u>", (uint_t)size);
- }
-}
-
-/*
- * Print an integer type. Before dumping the contents via dt_print_hex(), we
- * first check the encoding to see if it's part of a bitfield or a character.
- */
-static void
-dt_print_int(ctf_id_t base, ulong_t off, dt_printarg_t *pap)
-{
- FILE *fp = pap->pa_file;
- ctf_file_t *ctfp = pap->pa_ctfp;
- ctf_encoding_t e;
- size_t size;
- caddr_t addr = pap->pa_addr + off / NBBY;
-
- if (ctf_type_encoding(ctfp, base, &e) == CTF_ERR) {
- (void) fprintf(fp, "<unknown encoding>");
- return;
- }
-
- /*
- * This comes from MDB - it's not clear under what circumstances this
- * would be found.
- */
- if (e.cte_format & CTF_INT_VARARGS) {
- (void) fprintf(fp, "...");
- return;
- }
-
- /*
- * We print this as a bitfield if the bit encoding indicates it's not
- * an even power of two byte size, or is larger than 8 bytes.
- */
- size = e.cte_bits / NBBY;
- if (size > 8 || (e.cte_bits % NBBY) != 0 || (size & (size - 1)) != 0) {
- print_bitfield(pap, off, &e);
- return;
- }
-
- /*
- * If this is a character, print it out as such.
- */
- if (CTF_IS_CHAR(e)) {
- char c = *(char *)addr;
- if (isprint(c))
- (void) fprintf(fp, "'%c'", c);
- else if (c == 0)
- (void) fprintf(fp, "'\\0'");
- else
- (void) fprintf(fp, "'\\%03o'", c);
- return;
- }
-
- dt_print_hex(fp, addr, size);
-}
-
-/*
- * Print a floating point (float, double, long double) value.
- */
-/* ARGSUSED */
-static void
-dt_print_float(ctf_id_t base, ulong_t off, dt_printarg_t *pap)
-{
- FILE *fp = pap->pa_file;
- ctf_file_t *ctfp = pap->pa_ctfp;
- ctf_encoding_t e;
- caddr_t addr = pap->pa_addr + off / NBBY;
-
- if (ctf_type_encoding(ctfp, base, &e) == 0) {
- if (e.cte_format == CTF_FP_SINGLE &&
- e.cte_bits == sizeof (float) * NBBY) {
- /* LINTED - alignment */
- (void) fprintf(fp, "%+.7e", *((float *)addr));
- } else if (e.cte_format == CTF_FP_DOUBLE &&
- e.cte_bits == sizeof (double) * NBBY) {
- /* LINTED - alignment */
- (void) fprintf(fp, "%+.7e", *((double *)addr));
- } else if (e.cte_format == CTF_FP_LDOUBLE &&
- e.cte_bits == sizeof (long double) * NBBY) {
- /* LINTED - alignment */
- (void) fprintf(fp, "%+.16LE", *((long double *)addr));
- } else {
- (void) fprintf(fp, "<unknown encoding>");
- }
- }
-}
-
-/*
- * A pointer is printed as a fixed-size integer. This is used both for
- * pointers and functions.
- */
-static void
-dt_print_ptr(ctf_id_t base, ulong_t off, dt_printarg_t *pap)
-{
- FILE *fp = pap->pa_file;
- ctf_file_t *ctfp = pap->pa_ctfp;
- caddr_t addr = pap->pa_addr + off / NBBY;
- size_t size = ctf_type_size(ctfp, base);
-
- dt_print_hex(fp, addr, size);
-}
-
-/*
- * Print out an array. This is somewhat complex, as we must manually visit
- * each member, and recursively invoke ctf_type_visit() for each member. If
- * the members are non-structs, then we print them out directly:
- *
- * [ 0x14, 0x2e, 0 ]
- *
- * If they are structs, then we print out the necessary leading and trailing
- * braces, to end up with:
- *
- * [
- * type {
- * ...
- * },
- * type {
- * ...
- * }
- * ]
- *
- * We also use a heuristic to detect whether the array looks like a character
- * array. If the encoding indicates it's a character, and we have all
- * printable characters followed by a null byte, then we display it as a
- * string:
- *
- * [ "string" ]
- */
-static void
-dt_print_array(ctf_id_t base, ulong_t off, dt_printarg_t *pap)
-{
- FILE *fp = pap->pa_file;
- ctf_file_t *ctfp = pap->pa_ctfp;
- caddr_t addr = pap->pa_addr + off / NBBY;
- ctf_arinfo_t car;
- ssize_t eltsize;
- ctf_encoding_t e;
- int i;
- boolean_t isstring;
- int kind;
- ctf_id_t rtype;
-
- if (ctf_array_info(ctfp, base, &car) == CTF_ERR) {
- (void) fprintf(fp, "0x%p", (void *)addr);
- return;
- }
-
- if ((eltsize = ctf_type_size(ctfp, car.ctr_contents)) < 0 ||
- (rtype = ctf_type_resolve(ctfp, car.ctr_contents)) == CTF_ERR ||
- (kind = ctf_type_kind(ctfp, rtype)) == CTF_ERR) {
- (void) fprintf(fp, "<invalid type %lu>", car.ctr_contents);
- return;
- }
-
- /* see if this looks like a string */
- isstring = B_FALSE;
- if (kind == CTF_K_INTEGER &&
- ctf_type_encoding(ctfp, rtype, &e) != CTF_ERR && CTF_IS_CHAR(e)) {
- char c;
- for (i = 0; i < car.ctr_nelems; i++) {
- c = *((char *)addr + eltsize * i);
- if (!isprint(c) || c == '\0')
- break;
- }
-
- if (i != car.ctr_nelems && c == '\0')
- isstring = B_TRUE;
- }
-
- /*
- * As a slight aesthetic optimization, if we are a top-level type, then
- * don't bother printing out the brackets. This lets print("foo") look
- * like:
- *
- * string "foo"
- *
- * As D will internally represent this as a char[256] array.
- */
- if (!isstring || pap->pa_depth != 0)
- (void) fprintf(fp, "[ ");
-
- if (isstring)
- (void) fprintf(fp, "\"");
-
- for (i = 0; i < car.ctr_nelems; i++) {
- if (isstring) {
- char c = *((char *)addr + eltsize * i);
- if (c == '\0')
- break;
- (void) fprintf(fp, "%c", c);
- } else {
- /*
- * Recursively invoke ctf_type_visit() on each member.
- * We setup a new printarg struct with 'pa_nest' set to
- * indicate that we are within a nested array.
- */
- dt_printarg_t pa = *pap;
- pa.pa_nest += pap->pa_depth + 1;
- pa.pa_depth = 0;
- pa.pa_addr = addr + eltsize * i;
- (void) ctf_type_visit(ctfp, car.ctr_contents,
- dt_print_member, &pa);
-
- dt_print_trailing_braces(&pa, 0);
- if (i != car.ctr_nelems - 1)
- (void) fprintf(fp, ", ");
- else if (CTF_IS_STRUCTLIKE(kind))
- (void) fprintf(fp, "\n");
- }
- }
-
- if (isstring)
- (void) fprintf(fp, "\"");
-
- if (!isstring || pap->pa_depth != 0) {
- if (CTF_IS_STRUCTLIKE(kind))
- dt_print_indent(pap);
- else
- (void) fprintf(fp, " ");
- (void) fprintf(fp, "]");
- }
-}
-
-/*
- * This isued by both structs and unions to print the leading brace.
- */
-/* ARGSUSED */
-static void
-dt_print_structlike(ctf_id_t id, ulong_t off, dt_printarg_t *pap)
-{
- (void) fprintf(pap->pa_file, "{");
-}
-
-/*
- * For enums, we try to print the enum name, and fall back to the value if it
- * can't be determined. We do not do any fancy flag processing like mdb.
- */
-/* ARGSUSED */
-static void
-dt_print_enum(ctf_id_t base, ulong_t off, dt_printarg_t *pap)
-{
- FILE *fp = pap->pa_file;
- ctf_file_t *ctfp = pap->pa_ctfp;
- const char *ename;
- int value = 0;
-
- if ((ename = ctf_enum_name(ctfp, base, value)) != NULL)
- (void) fprintf(fp, "%s", ename);
- else
- (void) fprintf(fp, "%d", value);
-}
-
-/*
- * Forward declaration. There's not much to do here without the complete
- * type information, so just print out this fact and drive on.
- */
-/* ARGSUSED */
-static void
-dt_print_tag(ctf_id_t base, ulong_t off, dt_printarg_t *pap)
-{
- (void) fprintf(pap->pa_file, "<forward decl>");
-}
-
-typedef void dt_printarg_f(ctf_id_t, ulong_t, dt_printarg_t *);
-
-static dt_printarg_f *const dt_printfuncs[] = {
- dt_print_int, /* CTF_K_INTEGER */
- dt_print_float, /* CTF_K_FLOAT */
- dt_print_ptr, /* CTF_K_POINTER */
- dt_print_array, /* CTF_K_ARRAY */
- dt_print_ptr, /* CTF_K_FUNCTION */
- dt_print_structlike, /* CTF_K_STRUCT */
- dt_print_structlike, /* CTF_K_UNION */
- dt_print_enum, /* CTF_K_ENUM */
- dt_print_tag /* CTF_K_FORWARD */
-};
-
-/*
- * Print one member of a structure. This callback is invoked from
- * ctf_type_visit() recursively.
- */
-static int
-dt_print_member(const char *name, ctf_id_t id, ulong_t off, int depth,
- void *data)
-{
- char type[DT_TYPE_NAMELEN];
- int kind;
- dt_printarg_t *pap = data;
- FILE *fp = pap->pa_file;
- ctf_file_t *ctfp = pap->pa_ctfp;
- boolean_t arraymember;
- boolean_t brief;
- ctf_encoding_t e;
- ctf_id_t rtype;
-
- dt_print_trailing_braces(pap, depth);
- /*
- * dt_print_trailing_braces() doesn't include the trailing newline; add
- * it here if necessary.
- */
- if (depth < pap->pa_depth)
- (void) fprintf(fp, "\n");
- pap->pa_depth = depth;
-
- if ((rtype = ctf_type_resolve(ctfp, id)) == CTF_ERR ||
- (kind = ctf_type_kind(ctfp, rtype)) == CTF_ERR ||
- kind < CTF_K_INTEGER || kind > CTF_K_FORWARD) {
- dt_print_indent(pap);
- (void) fprintf(fp, "%s = <invalid type %lu>", name, id);
- return (0);
- }
-
- dt_print_type_name(ctfp, id, type, sizeof (type));
-
- arraymember = (pap->pa_nest != 0 && depth == 0);
- brief = (arraymember && !CTF_IS_STRUCTLIKE(kind));
-
- if (!brief) {
- /*
- * If this is a direct array member and a struct (otherwise
- * brief would be true), then print a trailing newline, as the
- * array printing code doesn't include it because it might be a
- * simple type.
- */
- if (arraymember)
- (void) fprintf(fp, "\n");
- dt_print_indent(pap);
-
- /* always print the type */
- (void) fprintf(fp, "%s", type);
- if (name[0] != '\0') {
- /*
- * For aesthetics, we don't include a space between the
- * type name and member name if the type is a pointer.
- * This will give us "void *foo =" instead of "void *
- * foo =". Unions also have the odd behavior that the
- * type name is returned as "union ", with a trailing
- * space, so we also avoid printing a space if the type
- * name already ends with a space.
- */
- if (type[strlen(type) - 1] != '*' &&
- type[strlen(type) -1] != ' ') {
- (void) fprintf(fp, " ");
- }
- (void) fprintf(fp, "%s", name);
-
- /*
- * If this looks like a bitfield, or is an integer not
- * aligned on a byte boundary, print the number of
- * bits after the name.
- */
- if (kind == CTF_K_INTEGER &&
- ctf_type_encoding(ctfp, id, &e) == 0) {
- ulong_t bits = e.cte_bits;
- ulong_t size = bits / NBBY;
-
- if (bits % NBBY != 0 ||
- off % NBBY != 0 ||
- size > 8 ||
- size != ctf_type_size(ctfp, id)) {
- (void) fprintf(fp, " :%lu", bits);
- }
- }
-
- (void) fprintf(fp, " =");
- }
- (void) fprintf(fp, " ");
- }
-
- dt_printfuncs[kind - 1](rtype, off, pap);
-
- /* direct simple array members are not separated by newlines */
- if (!brief)
- (void) fprintf(fp, "\n");
-
- return (0);
-}
-
-/*
- * Main print function invoked by dt_consume_cpu().
- */
-int
-dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename,
- caddr_t addr, size_t len)
-{
- const char *s;
- char *object;
- dt_printarg_t pa;
- ctf_id_t id;
- dt_module_t *dmp;
-
- /*
- * Split the fully-qualified type ID (module`id). This should
- * always be the format, but if for some reason we don't find the
- * expected value, return 0 to fall back to the generic trace()
- * behavior.
- */
- for (s = typename; *s != '\0' && *s != '`'; s++)
- ;
-
- if (*s != '`')
- return (0);
-
- object = alloca(s - typename + 1);
- bcopy(typename, object, s - typename);
- object[s - typename] = '\0';
- id = atoi(s + 1);
-
- /*
- * Try to get the CTF kind for this id. If something has gone horribly
- * wrong and we can't resolve the ID, bail out and let trace() do the
- * work.
- */
- dmp = dt_module_lookup_by_name(dtp, object);
- if (dmp == NULL || ctf_type_kind(dt_module_getctf(dtp, dmp),
- id) == CTF_ERR) {
- return (0);
- }
-
- /* setup the print structure and kick off the main print routine */
- pa.pa_addr = addr;
- pa.pa_ctfp = dt_module_getctf(dtp, dmp);
- pa.pa_nest = 0;
- pa.pa_depth = 0;
- pa.pa_file = fp;
- (void) ctf_type_visit(pa.pa_ctfp, id, dt_print_member, &pa);
-
- dt_print_trailing_braces(&pa, 0);
-
- return (len);
-}
diff --git a/lib/libdtrace/common/dt_printf.c b/lib/libdtrace/common/dt_printf.c
index eabc42338bcc..52904789bc7e 100644
--- a/lib/libdtrace/common/dt_printf.c
+++ b/lib/libdtrace/common/dt_printf.c
@@ -21,7 +21,6 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#include <sys/sysmacros.h>
@@ -1301,14 +1300,6 @@ pfprint_lquantize(dtrace_hdl_t *dtp, FILE *fp, const char *format,
return (dt_print_lquantize(dtp, fp, addr, size, normal));
}
-/*ARGSUSED*/
-static int
-pfprint_llquantize(dtrace_hdl_t *dtp, FILE *fp, const char *format,
- const dt_pfargd_t *pfd, const void *addr, size_t size, uint64_t normal)
-{
- return (dt_print_llquantize(dtp, fp, addr, size, normal));
-}
-
static int
dt_printf_format(dtrace_hdl_t *dtp, FILE *fp, const dt_pfargv_t *pfv,
const dtrace_recdesc_t *recs, uint_t nrecs, const void *buf,
@@ -1494,9 +1485,6 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE *fp, const dt_pfargv_t *pfv,
case DTRACEAGG_LQUANTIZE:
func = pfprint_lquantize;
break;
- case DTRACEAGG_LLQUANTIZE:
- func = pfprint_llquantize;
- break;
case DTRACEACT_MOD:
func = pfprint_mod;
break;
diff --git a/lib/libdtrace/common/dt_program.c b/lib/libdtrace/common/dt_program.c
index 7d725bd0af86..19f377de26ac 100644
--- a/lib/libdtrace/common/dt_program.c
+++ b/lib/libdtrace/common/dt_program.c
@@ -21,7 +21,6 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
*/
#include <unistd.h>
@@ -348,7 +347,6 @@ dtrace_stmt_destroy(dtrace_hdl_t *dtp, dtrace_stmtdesc_t *sdp)
if (sdp->dtsd_fmtdata != NULL)
dt_printf_destroy(sdp->dtsd_fmtdata);
- dt_free(dtp, sdp->dtsd_strdata);
dt_ecbdesc_release(dtp, sdp->dtsd_ecbdesc);
dt_free(dtp, sdp);
diff --git a/lib/libdtrace/common/dtrace.h b/lib/libdtrace/common/dtrace.h
index 87df1ca4402a..1c041207c0ae 100644
--- a/lib/libdtrace/common/dtrace.h
+++ b/lib/libdtrace/common/dtrace.h
@@ -24,13 +24,11 @@
* Use is subject to license terms.
*/
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
#ifndef _DTRACE_H
#define _DTRACE_H
+#pragma ident "%Z%%M% %I% %E% SMI"
+
#include <sys/dtrace.h>
#include <stdarg.h>
#include <stdio.h>
@@ -150,7 +148,6 @@ typedef struct dtrace_stmtdesc {
dtrace_actdesc_t *dtsd_action_last; /* last action in action list */
void *dtsd_aggdata; /* aggregation data */
void *dtsd_fmtdata; /* type-specific output data */
- void *dtsd_strdata; /* type-specific string data */
void (*dtsd_callback)(); /* callback function for EPID */
void *dtsd_data; /* callback data pointer */
dtrace_attribute_t dtsd_descattr; /* probedesc attributes */
@@ -243,18 +240,6 @@ extern int dtrace_freopen(dtrace_hdl_t *, FILE *, void *,
const void *, size_t);
/*
- * Type-specific output printing
- *
- * The print() action will associate a string data record that is actually the
- * fully-qualified type name of the data traced by the DIFEXPR action. This is
- * stored in the same 'format' record from the kernel, but we know by virtue of
- * the fact that the action is still DIFEXPR that it is actually a reference to
- * plain string data.
- */
-extern int dtrace_print(dtrace_hdl_t *, FILE *, const char *,
- caddr_t, size_t);
-
-/*
* DTrace Work Interface
*/
typedef enum {
diff --git a/lib/libdtrace/i386/regs.d.in b/lib/libdtrace/i386/regs.d.in
index d18c5f7ff1fb..3328f33515b0 100644
--- a/lib/libdtrace/i386/regs.d.in
+++ b/lib/libdtrace/i386/regs.d.in
@@ -23,9 +23,8 @@
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-/*
- * Copyright 2011 Joyent, Inc. All rights reserved.
- */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
inline int R_GS = @GS@;
#pragma D binding "1.0" R_GS
@@ -116,149 +115,3 @@ inline int R_R14 = @REG_R14@;
inline int R_R15 = @REG_R15@;
#pragma D binding "1.0" R_R15
-enum vmregs_vmx {
- VMX_VIRTUAL_PROCESSOR_ID = 0x00000000,
- VMX_GUEST_ES_SELECTOR = 0x00000800,
- VMX_GUEST_CS_SELECTOR = 0x00000802,
- VMX_GUEST_SS_SELECTOR = 0x00000804,
- VMX_GUEST_DS_SELECTOR = 0x00000806,
- VMX_GUEST_FS_SELECTOR = 0x00000808,
- VMX_GUEST_GS_SELECTOR = 0x0000080a,
- VMX_GUEST_LDTR_SELECTOR = 0x0000080c,
- VMX_GUEST_TR_SELECTOR = 0x0000080e,
- VMX_HOST_ES_SELECTOR = 0x00000c00,
- VMX_HOST_CS_SELECTOR = 0x00000c02,
- VMX_HOST_SS_SELECTOR = 0x00000c04,
- VMX_HOST_DS_SELECTOR = 0x00000c06,
- VMX_HOST_FS_SELECTOR = 0x00000c08,
- VMX_HOST_GS_SELECTOR = 0x00000c0a,
- VMX_HOST_TR_SELECTOR = 0x00000c0c,
- VMX_IO_BITMAP_A = 0x00002000,
- VMX_IO_BITMAP_A_HIGH = 0x00002001,
- VMX_IO_BITMAP_B = 0x00002002,
- VMX_IO_BITMAP_B_HIGH = 0x00002003,
- VMX_MSR_BITMAP = 0x00002004,
- VMX_MSR_BITMAP_HIGH = 0x00002005,
- VMX_VM_EXIT_MSR_STORE_ADDR = 0x00002006,
- VMX_VM_EXIT_MSR_STORE_ADDR_HIGH = 0x00002007,
- VMX_VM_EXIT_MSR_LOAD_ADDR = 0x00002008,
- VMX_VM_EXIT_MSR_LOAD_ADDR_HIGH = 0x00002009,
- VMX_VM_ENTRY_MSR_LOAD_ADDR = 0x0000200a,
- VMX_VM_ENTRY_MSR_LOAD_ADDR_HIGH = 0x0000200b,
- VMX_TSC_OFFSET = 0x00002010,
- VMX_TSC_OFFSET_HIGH = 0x00002011,
- VMX_VIRTUAL_APIC_PAGE_ADDR = 0x00002012,
- VMX_VIRTUAL_APIC_PAGE_ADDR_HIGH = 0x00002013,
- VMX_APIC_ACCESS_ADDR = 0x00002014,
- VMX_APIC_ACCESS_ADDR_HIGH = 0x00002015,
- VMX_EPT_POINTER = 0x0000201a,
- VMX_EPT_POINTER_HIGH = 0x0000201b,
- VMX_GUEST_PHYSICAL_ADDRESS = 0x00002400,
- VMX_GUEST_PHYSICAL_ADDRESS_HIGH = 0x00002401,
- VMX_VMCS_LINK_POINTER = 0x00002800,
- VMX_VMCS_LINK_POINTER_HIGH = 0x00002801,
- VMX_GUEST_IA32_DEBUGCTL = 0x00002802,
- VMX_GUEST_IA32_DEBUGCTL_HIGH = 0x00002803,
- VMX_GUEST_IA32_PAT = 0x00002804,
- VMX_GUEST_IA32_PAT_HIGH = 0x00002805,
- VMX_GUEST_PDPTR0 = 0x0000280a,
- VMX_GUEST_PDPTR0_HIGH = 0x0000280b,
- VMX_GUEST_PDPTR1 = 0x0000280c,
- VMX_GUEST_PDPTR1_HIGH = 0x0000280d,
- VMX_GUEST_PDPTR2 = 0x0000280e,
- VMX_GUEST_PDPTR2_HIGH = 0x0000280f,
- VMX_GUEST_PDPTR3 = 0x00002810,
- VMX_GUEST_PDPTR3_HIGH = 0x00002811,
- VMX_HOST_IA32_PAT = 0x00002c00,
- VMX_HOST_IA32_PAT_HIGH = 0x00002c01,
- VMX_PIN_BASED_VM_EXEC_CONTROL = 0x00004000,
- VMX_CPU_BASED_VM_EXEC_CONTROL = 0x00004002,
- VMX_EXCEPTION_BITMAP = 0x00004004,
- VMX_PAGE_FAULT_ERROR_CODE_MASK = 0x00004006,
- VMX_PAGE_FAULT_ERROR_CODE_MATCH = 0x00004008,
- VMX_CR3_TARGET_COUNT = 0x0000400a,
- VMX_VM_EXIT_CONTROLS = 0x0000400c,
- VMX_VM_EXIT_MSR_STORE_COUNT = 0x0000400e,
- VMX_VM_EXIT_MSR_LOAD_COUNT = 0x00004010,
- VMX_VM_ENTRY_CONTROLS = 0x00004012,
- VMX_VM_ENTRY_MSR_LOAD_COUNT = 0x00004014,
- VMX_VM_ENTRY_INTR_INFO_FIELD = 0x00004016,
- VMX_VM_ENTRY_EXCEPTION_ERROR_CODE = 0x00004018,
- VMX_VM_ENTRY_INSTRUCTION_LEN = 0x0000401a,
- VMX_TPR_THRESHOLD = 0x0000401c,
- VMX_SECONDARY_VM_EXEC_CONTROL = 0x0000401e,
- VMX_PLE_GAP = 0x00004020,
- VMX_PLE_WINDOW = 0x00004022,
- VMX_VM_INSTRUCTION_ERROR = 0x00004400,
- VMX_VM_EXIT_REASON = 0x00004402,
- VMX_VM_EXIT_INTR_INFO = 0x00004404,
- VMX_VM_EXIT_INTR_ERROR_CODE = 0x00004406,
- VMX_IDT_VECTORING_INFO_FIELD = 0x00004408,
- VMX_IDT_VECTORING_ERROR_CODE = 0x0000440a,
- VMX_VM_EXIT_INSTRUCTION_LEN = 0x0000440c,
- VMX_VMX_INSTRUCTION_INFO = 0x0000440e,
- VMX_GUEST_ES_LIMIT = 0x00004800,
- VMX_GUEST_CS_LIMIT = 0x00004802,
- VMX_GUEST_SS_LIMIT = 0x00004804,
- VMX_GUEST_DS_LIMIT = 0x00004806,
- VMX_GUEST_FS_LIMIT = 0x00004808,
- VMX_GUEST_GS_LIMIT = 0x0000480a,
- VMX_GUEST_LDTR_LIMIT = 0x0000480c,
- VMX_GUEST_TR_LIMIT = 0x0000480e,
- VMX_GUEST_GDTR_LIMIT = 0x00004810,
- VMX_GUEST_IDTR_LIMIT = 0x00004812,
- VMX_GUEST_ES_AR_BYTES = 0x00004814,
- VMX_GUEST_CS_AR_BYTES = 0x00004816,
- VMX_GUEST_SS_AR_BYTES = 0x00004818,
- VMX_GUEST_DS_AR_BYTES = 0x0000481a,
- VMX_GUEST_FS_AR_BYTES = 0x0000481c,
- VMX_GUEST_GS_AR_BYTES = 0x0000481e,
- VMX_GUEST_LDTR_AR_BYTES = 0x00004820,
- VMX_GUEST_TR_AR_BYTES = 0x00004822,
- VMX_GUEST_INTERRUPTIBILITY_INFO = 0x00004824,
- VMX_GUEST_ACTIVITY_STATE = 0X00004826,
- VMX_GUEST_SYSENTER_CS = 0x0000482A,
- VMX_HOST_IA32_SYSENTER_CS = 0x00004c00,
- VMX_CR0_GUEST_HOST_MASK = 0x00006000,
- VMX_CR4_GUEST_HOST_MASK = 0x00006002,
- VMX_CR0_READ_SHADOW = 0x00006004,
- VMX_CR4_READ_SHADOW = 0x00006006,
- VMX_CR3_TARGET_VALUE0 = 0x00006008,
- VMX_CR3_TARGET_VALUE1 = 0x0000600a,
- VMX_CR3_TARGET_VALUE2 = 0x0000600c,
- VMX_CR3_TARGET_VALUE3 = 0x0000600e,
- VMX_EXIT_QUALIFICATION = 0x00006400,
- VMX_GUEST_LINEAR_ADDRESS = 0x0000640a,
- VMX_GUEST_CR0 = 0x00006800,
- VMX_GUEST_CR3 = 0x00006802,
- VMX_GUEST_CR4 = 0x00006804,
- VMX_GUEST_ES_BASE = 0x00006806,
- VMX_GUEST_CS_BASE = 0x00006808,
- VMX_GUEST_SS_BASE = 0x0000680a,
- VMX_GUEST_DS_BASE = 0x0000680c,
- VMX_GUEST_FS_BASE = 0x0000680e,
- VMX_GUEST_GS_BASE = 0x00006810,
- VMX_GUEST_LDTR_BASE = 0x00006812,
- VMX_GUEST_TR_BASE = 0x00006814,
- VMX_GUEST_GDTR_BASE = 0x00006816,
- VMX_GUEST_IDTR_BASE = 0x00006818,
- VMX_GUEST_DR7 = 0x0000681a,
- VMX_GUEST_RSP = 0x0000681c,
- VMX_GUEST_RIP = 0x0000681e,
- VMX_GUEST_RFLAGS = 0x00006820,
- VMX_GUEST_PENDING_DBG_EXCEPTIONS = 0x00006822,
- VMX_GUEST_SYSENTER_ESP = 0x00006824,
- VMX_GUEST_SYSENTER_EIP = 0x00006826,
- VMX_HOST_CR0 = 0x00006c00,
- VMX_HOST_CR3 = 0x00006c02,
- VMX_HOST_CR4 = 0x00006c04,
- VMX_HOST_FS_BASE = 0x00006c06,
- VMX_HOST_GS_BASE = 0x00006c08,
- VMX_HOST_TR_BASE = 0x00006c0a,
- VMX_HOST_GDTR_BASE = 0x00006c0c,
- VMX_HOST_IDTR_BASE = 0x00006c0e,
- VMX_HOST_IA32_SYSENTER_ESP = 0x00006c10,
- VMX_HOST_IA32_SYSENTER_EIP = 0x00006c12,
- VMX_HOST_RSP = 0x00006c14,
- VMX_HOST_RIP = 0x00006c16
-};
diff --git a/lib/libnvpair/libnvpair.c b/lib/libnvpair/libnvpair.c
index c2e5a1b46dad..16bce483bee5 100644
--- a/lib/libnvpair/libnvpair.c
+++ b/lib/libnvpair/libnvpair.c
@@ -20,7 +20,6 @@
*/
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <unistd.h>
@@ -804,10 +803,6 @@ dump_nvlist(nvlist_t *list, int indent)
while ((elem = nvlist_next_nvpair(list, elem)) != NULL) {
switch (nvpair_type(elem)) {
- case DATA_TYPE_BOOLEAN:
- (void) printf("%*s%s\n", indent, "", nvpair_name(elem));
- break;
-
case DATA_TYPE_BOOLEAN_VALUE:
(void) nvpair_value_boolean_value(elem, &bool_value);
(void) printf("%*s%s: %s\n", indent, "",
diff --git a/lib/libuutil/common/uu_list.c b/lib/libuutil/common/uu_list.c
index 93795e5289b2..35c7ba800103 100644
--- a/lib/libuutil/common/uu_list.c
+++ b/lib/libuutil/common/uu_list.c
@@ -18,14 +18,13 @@
*
* CDDL HEADER END
*/
-
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * Copyright 2011 Jason King. All rights reserved.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
#include "libuutil_common.h"
#include <stdlib.h>
@@ -319,8 +318,6 @@ uu_list_find(uu_list_t *lp, void *elem, void *private, uu_list_index_t *out)
uu_compare_fn_t *func = lp->ul_pool->ulp_cmp;
uu_list_node_impl_t *np;
- uu_set_error(UU_ERROR_NONE);
-
if (func == NULL) {
if (out != NULL)
*out = 0;
diff --git a/lib/libzfs/common/libzfs.h b/lib/libzfs/common/libzfs.h
index 56ebf530daf5..ea34cc9efa31 100644
--- a/lib/libzfs/common/libzfs.h
+++ b/lib/libzfs/common/libzfs.h
@@ -21,9 +21,6 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBZFS_H
@@ -54,8 +51,7 @@ extern "C" {
/*
* libzfs errors
*/
-typedef enum zfs_error {
- EZFS_SUCCESS = 0, /* no error -- success */
+enum {
EZFS_NOMEM = 2000, /* out of memory */
EZFS_BADPROP, /* invalid property value */
EZFS_PROPREADONLY, /* cannot set readonly property */
@@ -127,7 +123,7 @@ typedef enum zfs_error {
EZFS_DIFFDATA, /* bad zfs diff data */
EZFS_POOLREADONLY, /* pool is in read-only mode */
EZFS_UNKNOWN
-} zfs_error_t;
+};
/*
* The following data structures are all part
@@ -183,9 +179,6 @@ extern libzfs_handle_t *zfs_get_handle(zfs_handle_t *);
extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t);
-extern void zfs_save_arguments(int argc, char **, char *, int);
-extern int zpool_log_history(libzfs_handle_t *, const char *);
-
extern int libzfs_errno(libzfs_handle_t *);
extern const char *libzfs_error_action(libzfs_handle_t *);
extern const char *libzfs_error_description(libzfs_handle_t *);
@@ -220,7 +213,7 @@ extern int zpool_iter(libzfs_handle_t *, zpool_iter_f, void *);
*/
extern int zpool_create(libzfs_handle_t *, const char *, nvlist_t *,
nvlist_t *, nvlist_t *);
-extern int zpool_destroy(zpool_handle_t *, const char *);
+extern int zpool_destroy(zpool_handle_t *);
extern int zpool_add(zpool_handle_t *, nvlist_t *);
typedef struct splitflags {
@@ -236,8 +229,6 @@ typedef struct splitflags {
*/
extern int zpool_scan(zpool_handle_t *, pool_scan_func_t);
extern int zpool_clear(zpool_handle_t *, const char *, nvlist_t *);
-extern int zpool_reguid(zpool_handle_t *);
-extern int zpool_reopen(zpool_handle_t *);
extern int zpool_vdev_online(zpool_handle_t *, const char *, int,
vdev_state_t *);
@@ -295,15 +286,6 @@ typedef enum {
ZPOOL_STATUS_BAD_LOG, /* cannot read log chain(s) */
/*
- * If the pool has unsupported features but can still be opened in
- * read-only mode, its status is ZPOOL_STATUS_UNSUP_FEAT_WRITE. If the
- * pool has unsupported features but cannot be opened at all, its
- * status is ZPOOL_STATUS_UNSUP_FEAT_READ.
- */
- ZPOOL_STATUS_UNSUP_FEAT_READ, /* unsupported features for read */
- ZPOOL_STATUS_UNSUP_FEAT_WRITE, /* unsupported features for write */
-
- /*
* These faults have no corresponding message ID. At the time we are
* checking the status, the original reason for the FMA fault (I/O or
* checksum errors) has been lost.
@@ -335,20 +317,18 @@ extern void zpool_dump_ddt(const ddt_stat_t *dds, const ddt_histogram_t *ddh);
* Statistics and configuration functions.
*/
extern nvlist_t *zpool_get_config(zpool_handle_t *, nvlist_t **);
-extern nvlist_t *zpool_get_features(zpool_handle_t *);
extern int zpool_refresh_stats(zpool_handle_t *, boolean_t *);
extern int zpool_get_errlog(zpool_handle_t *, nvlist_t **);
/*
* Import and export functions
*/
-extern int zpool_export(zpool_handle_t *, boolean_t, const char *);
-extern int zpool_export_force(zpool_handle_t *, const char *);
+extern int zpool_export(zpool_handle_t *, boolean_t);
+extern int zpool_export_force(zpool_handle_t *);
extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *,
char *altroot);
extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *,
nvlist_t *, int);
-extern void zpool_print_unsup_feat(nvlist_t *config);
/*
* Search for pools to import
@@ -377,7 +357,7 @@ extern nvlist_t *zpool_find_import_cached(libzfs_handle_t *, const char *,
*/
struct zfs_cmd;
-extern const char *zfs_history_event_names[];
+extern const char *zfs_history_event_names[LOG_END];
extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *,
boolean_t verbose);
@@ -385,6 +365,9 @@ extern int zpool_upgrade(zpool_handle_t *, uint64_t);
extern int zpool_get_history(zpool_handle_t *, nvlist_t **);
extern int zpool_history_unpack(char *, uint64_t, uint64_t *,
nvlist_t ***, uint_t *);
+extern void zpool_set_history_str(const char *subcommand, int argc,
+ char **argv, char *history_str);
+extern int zpool_stage_history(libzfs_handle_t *, const char *);
extern void zpool_obj_to_path(zpool_handle_t *, uint64_t, uint64_t, char *,
size_t len);
extern int zfs_ioctl(libzfs_handle_t *, int, struct zfs_cmd *);
@@ -397,7 +380,6 @@ extern void zpool_explain_recover(libzfs_handle_t *, const char *, int,
* underlying datasets, only the references to them.
*/
extern zfs_handle_t *zfs_open(libzfs_handle_t *, const char *, int);
-extern zfs_handle_t *zfs_handle_dup(zfs_handle_t *);
extern void zfs_close(zfs_handle_t *);
extern zfs_type_t zfs_get_type(const zfs_handle_t *);
extern const char *zfs_get_name(const zfs_handle_t *);
@@ -431,20 +413,12 @@ extern int zfs_prop_get_userquota_int(zfs_handle_t *zhp, const char *propname,
uint64_t *propvalue);
extern int zfs_prop_get_userquota(zfs_handle_t *zhp, const char *propname,
char *propbuf, int proplen, boolean_t literal);
-extern int zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname,
- uint64_t *propvalue);
-extern int zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
- char *propbuf, int proplen, boolean_t literal);
-extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname,
- char *buf, size_t len);
extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t);
extern const char *zfs_prop_values(zfs_prop_t);
extern int zfs_prop_is_string(zfs_prop_t prop);
extern nvlist_t *zfs_get_user_props(zfs_handle_t *);
extern nvlist_t *zfs_get_recvd_props(zfs_handle_t *);
-extern nvlist_t *zfs_get_clones_nvl(zfs_handle_t *);
-
typedef struct zprop_list {
int pl_prop;
@@ -462,19 +436,10 @@ extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *);
#define ZFS_MOUNTPOINT_NONE "none"
#define ZFS_MOUNTPOINT_LEGACY "legacy"
-#define ZFS_FEATURE_DISABLED "disabled"
-#define ZFS_FEATURE_ENABLED "enabled"
-#define ZFS_FEATURE_ACTIVE "active"
-
-#define ZFS_UNSUPPORTED_INACTIVE "inactive"
-#define ZFS_UNSUPPORTED_READONLY "readonly"
-
/*
* zpool property management
*/
extern int zpool_expand_proplist(zpool_handle_t *, zprop_list_t **);
-extern int zpool_prop_get_feature(zpool_handle_t *, const char *, char *,
- size_t);
extern const char *zpool_prop_default_string(zpool_prop_t);
extern uint64_t zpool_prop_default_numeric(zpool_prop_t);
extern const char *zpool_prop_column_name(zpool_prop_t);
@@ -528,7 +493,6 @@ extern int zfs_iter_dependents(zfs_handle_t *, boolean_t, zfs_iter_f, void *);
extern int zfs_iter_filesystems(zfs_handle_t *, zfs_iter_f, void *);
extern int zfs_iter_snapshots(zfs_handle_t *, zfs_iter_f, void *);
extern int zfs_iter_snapshots_sorted(zfs_handle_t *, zfs_iter_f, void *);
-extern int zfs_iter_snapspec(zfs_handle_t *, const char *, zfs_iter_f, void *);
typedef struct get_all_cb {
zfs_handle_t **cb_handles;
@@ -549,94 +513,79 @@ extern int zfs_create(libzfs_handle_t *, const char *, zfs_type_t,
extern int zfs_create_ancestors(libzfs_handle_t *, const char *);
extern int zfs_destroy(zfs_handle_t *, boolean_t);
extern int zfs_destroy_snaps(zfs_handle_t *, char *, boolean_t);
-extern int zfs_destroy_snaps_nvl(zfs_handle_t *, nvlist_t *, boolean_t);
extern int zfs_clone(zfs_handle_t *, const char *, nvlist_t *);
extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *);
-extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps,
- nvlist_t *props);
extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t);
-extern int zfs_rename(zfs_handle_t *, const char *, boolean_t, boolean_t);
+extern int zfs_rename(zfs_handle_t *, const char *, boolean_t);
typedef struct sendflags {
/* print informational messages (ie, -v was specified) */
- boolean_t verbose;
+ int verbose : 1;
/* recursive send (ie, -R) */
- boolean_t replicate;
+ int replicate : 1;
/* for incrementals, do all intermediate snapshots */
- boolean_t doall;
+ int doall : 1; /* (ie, -I) */
/* if dataset is a clone, do incremental from its origin */
- boolean_t fromorigin;
+ int fromorigin : 1;
/* do deduplication */
- boolean_t dedup;
+ int dedup : 1;
/* send properties (ie, -p) */
- boolean_t props;
-
- /* do not send (no-op, ie. -n) */
- boolean_t dryrun;
-
- /* parsable verbose output (ie. -P) */
- boolean_t parsable;
-
- /* show progress (ie. -v) */
- boolean_t progress;
+ int props : 1;
} sendflags_t;
typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *);
-extern int zfs_send(zfs_handle_t *, const char *, const char *,
- sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **);
+extern int zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
+ sendflags_t flags, int outfd, snapfilter_cb_t filter_func,
+ void *cb_arg, nvlist_t **debugnvp);
extern int zfs_promote(zfs_handle_t *);
extern int zfs_hold(zfs_handle_t *, const char *, const char *, boolean_t,
boolean_t, boolean_t, int, uint64_t, uint64_t);
extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t);
-extern int zfs_get_holds(zfs_handle_t *, nvlist_t **);
extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *);
typedef int (*zfs_userspace_cb_t)(void *arg, const char *domain,
uid_t rid, uint64_t space);
-extern int zfs_userspace(zfs_handle_t *, zfs_userquota_prop_t,
- zfs_userspace_cb_t, void *);
-
-extern int zfs_get_fsacl(zfs_handle_t *, nvlist_t **);
-extern int zfs_set_fsacl(zfs_handle_t *, boolean_t, nvlist_t *);
+extern int zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type,
+ zfs_userspace_cb_t func, void *arg);
typedef struct recvflags {
/* print informational messages (ie, -v was specified) */
- boolean_t verbose;
+ int verbose : 1;
/* the destination is a prefix, not the exact fs (ie, -d) */
- boolean_t isprefix;
+ int isprefix : 1;
/*
* Only the tail of the sent snapshot path is appended to the
* destination to determine the received snapshot name (ie, -e).
*/
- boolean_t istail;
+ int istail : 1;
/* do not actually do the recv, just check if it would work (ie, -n) */
- boolean_t dryrun;
+ int dryrun : 1;
/* rollback/destroy filesystems as necessary (eg, -F) */
- boolean_t force;
+ int force : 1;
/* set "canmount=off" on all modified filesystems */
- boolean_t canmountoff;
+ int canmountoff : 1;
/* byteswap flag is used internally; callers need not specify */
- boolean_t byteswap;
+ int byteswap : 1;
/* do not mount file systems as they are extracted (private) */
- boolean_t nomount;
+ int nomount : 1;
} recvflags_t;
-extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t *,
+extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t,
int, avl_tree_t *);
typedef enum diff_flags {
diff --git a/lib/libzfs/common/libzfs_config.c b/lib/libzfs/common/libzfs_config.c
index d5ba20fde0cf..dc27238c9cf3 100644
--- a/lib/libzfs/common/libzfs_config.c
+++ b/lib/libzfs/common/libzfs_config.c
@@ -18,17 +18,12 @@
*
* CDDL HEADER END
*/
-
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-/*
* The pool configuration repository is stored in /etc/zfs/zpool.cache as a
* single packed nvlist. While it would be nice to just read in this
* file from userland, this wouldn't work from a local zone. So we have to have
@@ -223,36 +218,6 @@ zpool_get_config(zpool_handle_t *zhp, nvlist_t **oldconfig)
}
/*
- * Retrieves a list of enabled features and their refcounts and caches it in
- * the pool handle.
- */
-nvlist_t *
-zpool_get_features(zpool_handle_t *zhp)
-{
- nvlist_t *config, *features;
-
- config = zpool_get_config(zhp, NULL);
-
- if (config == NULL || !nvlist_exists(config,
- ZPOOL_CONFIG_FEATURE_STATS)) {
- int error;
- boolean_t missing = B_FALSE;
-
- error = zpool_refresh_stats(zhp, &missing);
-
- if (error != 0 || missing)
- return (NULL);
-
- config = zpool_get_config(zhp, NULL);
- }
-
- verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS,
- &features) == 0);
-
- return (features);
-}
-
-/*
* Refresh the vdev statistics associated with the given pool. This is used in
* iostat to show configuration changes and determine the delta from the last
* time the function was called. This function can fail, in case the pool has
@@ -337,48 +302,6 @@ zpool_refresh_stats(zpool_handle_t *zhp, boolean_t *missing)
}
/*
- * If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over
- * pools it lists.
- *
- * This is an undocumented feature for use during testing only.
- *
- * This function returns B_TRUE if the pool should be skipped
- * during iteration.
- */
-static boolean_t
-check_restricted(const char *poolname)
-{
- static boolean_t initialized = B_FALSE;
- static char *restricted = NULL;
-
- const char *cur, *end;
- int len, namelen;
-
- if (!initialized) {
- initialized = B_TRUE;
- restricted = getenv("__ZFS_POOL_RESTRICT");
- }
-
- if (NULL == restricted)
- return (B_FALSE);
-
- cur = restricted;
- namelen = strlen(poolname);
- do {
- end = strchr(cur, ' ');
- len = (NULL == end) ? strlen(cur) : (end - cur);
-
- if (len == namelen && 0 == strncmp(cur, poolname, len)) {
- return (B_FALSE);
- }
-
- cur += (len + 1);
- } while (NULL != end);
-
- return (B_TRUE);
-}
-
-/*
* Iterate over all pools in the system.
*/
int
@@ -401,9 +324,6 @@ zpool_iter(libzfs_handle_t *hdl, zpool_iter_f func, void *data)
for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL;
cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) {
- if (check_restricted(cn->cn_name))
- continue;
-
if (zpool_open_silent(hdl, cn->cn_name, &zhp) != 0) {
hdl->libzfs_pool_iter--;
return (-1);
@@ -439,9 +359,6 @@ zfs_iter_root(libzfs_handle_t *hdl, zfs_iter_f func, void *data)
for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL;
cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) {
- if (check_restricted(cn->cn_name))
- continue;
-
if ((zhp = make_dataset_handle(hdl, cn->cn_name)) == NULL)
continue;
diff --git a/lib/libzfs/common/libzfs_dataset.c b/lib/libzfs/common/libzfs_dataset.c
index cc2603cf890b..b7c1360db4b7 100644
--- a/lib/libzfs/common/libzfs_dataset.c
+++ b/lib/libzfs/common/libzfs_dataset.c
@@ -21,9 +21,6 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved.
*/
#include <ctype.h>
@@ -135,7 +132,6 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,
namecheck_err_t why;
char what;
- (void) zfs_prop_get_table();
if (dataset_namecheck(path, &why, &what) != 0) {
if (hdl != NULL) {
switch (why) {
@@ -497,7 +493,7 @@ make_dataset_handle(libzfs_handle_t *hdl, const char *path)
return (zhp);
}
-zfs_handle_t *
+static zfs_handle_t *
make_dataset_handle_zc(libzfs_handle_t *hdl, zfs_cmd_t *zc)
{
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
@@ -514,53 +510,6 @@ make_dataset_handle_zc(libzfs_handle_t *hdl, zfs_cmd_t *zc)
return (zhp);
}
-zfs_handle_t *
-zfs_handle_dup(zfs_handle_t *zhp_orig)
-{
- zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
-
- if (zhp == NULL)
- return (NULL);
-
- zhp->zfs_hdl = zhp_orig->zfs_hdl;
- zhp->zpool_hdl = zhp_orig->zpool_hdl;
- (void) strlcpy(zhp->zfs_name, zhp_orig->zfs_name,
- sizeof (zhp->zfs_name));
- zhp->zfs_type = zhp_orig->zfs_type;
- zhp->zfs_head_type = zhp_orig->zfs_head_type;
- zhp->zfs_dmustats = zhp_orig->zfs_dmustats;
- if (zhp_orig->zfs_props != NULL) {
- if (nvlist_dup(zhp_orig->zfs_props, &zhp->zfs_props, 0) != 0) {
- (void) no_memory(zhp->zfs_hdl);
- zfs_close(zhp);
- return (NULL);
- }
- }
- if (zhp_orig->zfs_user_props != NULL) {
- if (nvlist_dup(zhp_orig->zfs_user_props,
- &zhp->zfs_user_props, 0) != 0) {
- (void) no_memory(zhp->zfs_hdl);
- zfs_close(zhp);
- return (NULL);
- }
- }
- if (zhp_orig->zfs_recvd_props != NULL) {
- if (nvlist_dup(zhp_orig->zfs_recvd_props,
- &zhp->zfs_recvd_props, 0)) {
- (void) no_memory(zhp->zfs_hdl);
- zfs_close(zhp);
- return (NULL);
- }
- }
- zhp->zfs_mntcheck = zhp_orig->zfs_mntcheck;
- if (zhp_orig->zfs_mntopts != NULL) {
- zhp->zfs_mntopts = zfs_strdup(zhp_orig->zfs_hdl,
- zhp_orig->zfs_mntopts);
- }
- zhp->zfs_props_table = zhp_orig->zfs_props_table;
- return (zhp);
-}
-
/*
* Opens the given snapshot, filesystem, or volume. The 'types'
* argument is a mask of acceptable types. The function will print an
@@ -924,12 +873,6 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
goto error;
}
continue;
- } else if (prop == ZPROP_INVAL && zfs_prop_written(propname)) {
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "'%s' is readonly"),
- propname);
- (void) zfs_error(hdl, EZFS_PROPREADONLY, errbuf);
- goto error;
}
if (prop == ZPROP_INVAL) {
@@ -1407,7 +1350,8 @@ zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval)
libzfs_handle_t *hdl = zhp->zfs_hdl;
nvlist_t *nvl = NULL, *realprops;
zfs_prop_t prop;
- boolean_t do_prefix = B_TRUE;
+ boolean_t do_prefix;
+ uint64_t idx;
int added_resv;
(void) snprintf(errbuf, sizeof (errbuf),
@@ -1446,17 +1390,12 @@ zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval)
}
/*
- * We don't want to unmount & remount the dataset when changing
- * its canmount property to 'on' or 'noauto'. We only use
- * the changelist logic to unmount when setting canmount=off.
+ * If the dataset's canmount property is being set to noauto,
+ * then we want to prevent unmounting & remounting it.
*/
- if (prop == ZFS_PROP_CANMOUNT) {
- uint64_t idx;
- int err = zprop_string_to_index(prop, propval, &idx,
- ZFS_TYPE_DATASET);
- if (err == 0 && idx != ZFS_CANMOUNT_OFF)
- do_prefix = B_FALSE;
- }
+ do_prefix = !((prop == ZFS_PROP_CANMOUNT) &&
+ (zprop_string_to_index(prop, propval, &idx,
+ ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO));
if (do_prefix && (ret = changelist_prefix(cl)) != 0)
goto error;
@@ -1907,6 +1846,8 @@ zfs_prop_get_recvd(zfs_handle_t *zhp, const char *propname, char *propbuf,
err = zfs_prop_get(zhp, prop, propbuf, proplen,
NULL, NULL, 0, literal);
zfs_unset_recvd_props_mode(zhp, &cookie);
+ } else if (zfs_prop_userquota(propname)) {
+ return (-1);
} else {
nvlist_t *propval;
char *recvdval;
@@ -1921,120 +1862,6 @@ zfs_prop_get_recvd(zfs_handle_t *zhp, const char *propname, char *propbuf,
return (err == 0 ? 0 : -1);
}
-static int
-get_clones_string(zfs_handle_t *zhp, char *propbuf, size_t proplen)
-{
- nvlist_t *value;
- nvpair_t *pair;
-
- value = zfs_get_clones_nvl(zhp);
- if (value == NULL)
- return (-1);
-
- propbuf[0] = '\0';
- for (pair = nvlist_next_nvpair(value, NULL); pair != NULL;
- pair = nvlist_next_nvpair(value, pair)) {
- if (propbuf[0] != '\0')
- (void) strlcat(propbuf, ",", proplen);
- (void) strlcat(propbuf, nvpair_name(pair), proplen);
- }
-
- return (0);
-}
-
-struct get_clones_arg {
- uint64_t numclones;
- nvlist_t *value;
- const char *origin;
- char buf[ZFS_MAXNAMELEN];
-};
-
-int
-get_clones_cb(zfs_handle_t *zhp, void *arg)
-{
- struct get_clones_arg *gca = arg;
-
- if (gca->numclones == 0) {
- zfs_close(zhp);
- return (0);
- }
-
- if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, gca->buf, sizeof (gca->buf),
- NULL, NULL, 0, B_TRUE) != 0)
- goto out;
- if (strcmp(gca->buf, gca->origin) == 0) {
- if (nvlist_add_boolean(gca->value, zfs_get_name(zhp)) != 0) {
- zfs_close(zhp);
- return (no_memory(zhp->zfs_hdl));
- }
- gca->numclones--;
- }
-
-out:
- (void) zfs_iter_children(zhp, get_clones_cb, gca);
- zfs_close(zhp);
- return (0);
-}
-
-nvlist_t *
-zfs_get_clones_nvl(zfs_handle_t *zhp)
-{
- nvlist_t *nv, *value;
-
- if (nvlist_lookup_nvlist(zhp->zfs_props,
- zfs_prop_to_name(ZFS_PROP_CLONES), &nv) != 0) {
- struct get_clones_arg gca;
-
- /*
- * if this is a snapshot, then the kernel wasn't able
- * to get the clones. Do it by slowly iterating.
- */
- if (zhp->zfs_type != ZFS_TYPE_SNAPSHOT)
- return (NULL);
- if (nvlist_alloc(&nv, NV_UNIQUE_NAME, 0) != 0)
- return (NULL);
- if (nvlist_alloc(&value, NV_UNIQUE_NAME, 0) != 0) {
- nvlist_free(nv);
- return (NULL);
- }
-
- gca.numclones = zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES);
- gca.value = value;
- gca.origin = zhp->zfs_name;
-
- if (gca.numclones != 0) {
- zfs_handle_t *root;
- char pool[ZFS_MAXNAMELEN];
- char *cp = pool;
-
- /* get the pool name */
- (void) strlcpy(pool, zhp->zfs_name, sizeof (pool));
- (void) strsep(&cp, "/@");
- root = zfs_open(zhp->zfs_hdl, pool,
- ZFS_TYPE_FILESYSTEM);
-
- (void) get_clones_cb(root, &gca);
- }
-
- if (gca.numclones != 0 ||
- nvlist_add_nvlist(nv, ZPROP_VALUE, value) != 0 ||
- nvlist_add_nvlist(zhp->zfs_props,
- zfs_prop_to_name(ZFS_PROP_CLONES), nv) != 0) {
- nvlist_free(nv);
- nvlist_free(value);
- return (NULL);
- }
- nvlist_free(nv);
- nvlist_free(value);
- verify(0 == nvlist_lookup_nvlist(zhp->zfs_props,
- zfs_prop_to_name(ZFS_PROP_CLONES), &nv));
- }
-
- verify(nvlist_lookup_nvlist(nv, ZPROP_VALUE, &value) == 0);
-
- return (value);
-}
-
/*
* Retrieve a property from the given object. If 'literal' is specified, then
* numbers are left as exact values. Otherwise, numbers are converted to a
@@ -2163,11 +1990,6 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
return (-1);
break;
- case ZFS_PROP_CLONES:
- if (get_clones_string(zhp, propbuf, proplen) != 0)
- return (-1);
- break;
-
case ZFS_PROP_QUOTA:
case ZFS_PROP_REFQUOTA:
case ZFS_PROP_RESERVATION:
@@ -2196,7 +2018,6 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
}
break;
- case ZFS_PROP_REFRATIO:
case ZFS_PROP_COMPRESSRATIO:
if (get_numeric_property(zhp, prop, src, &source, &val) != 0)
return (-1);
@@ -2285,17 +2106,6 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
}
break;
- case ZFS_PROP_GUID:
- /*
- * GUIDs are stored as numbers, but they are identifiers.
- * We don't want them to be pretty printed, because pretty
- * printing mangles the ID into a truncated and useless value.
- */
- if (get_numeric_property(zhp, prop, src, &source, &val) != 0)
- return (-1);
- (void) snprintf(propbuf, proplen, "%llu", (u_longlong_t)val);
- break;
-
default:
switch (zfs_prop_get_type(prop)) {
case PROP_TYPE_NUMBER:
@@ -2539,7 +2349,7 @@ zfs_prop_get_userquota_common(zfs_handle_t *zhp, const char *propname,
int err;
zfs_cmd_t zc = { 0 };
- (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
+ (void) strncpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
err = userquota_propname_decode(propname,
zfs_prop_get_int(zhp, ZFS_PROP_ZONED),
@@ -2591,76 +2401,144 @@ zfs_prop_get_userquota(zfs_handle_t *zhp, const char *propname,
return (0);
}
-int
-zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname,
- uint64_t *propvalue)
+/*
+ * Returns the name of the given zfs handle.
+ */
+const char *
+zfs_get_name(const zfs_handle_t *zhp)
{
- int err;
- zfs_cmd_t zc = { 0 };
- const char *snapname;
+ return (zhp->zfs_name);
+}
- (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
+/*
+ * Returns the type of the given zfs handle.
+ */
+zfs_type_t
+zfs_get_type(const zfs_handle_t *zhp)
+{
+ return (zhp->zfs_type);
+}
- snapname = strchr(propname, '@') + 1;
- if (strchr(snapname, '@')) {
- (void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
- } else {
- /* snapname is the short name, append it to zhp's fsname */
- char *cp;
-
- (void) strlcpy(zc.zc_value, zhp->zfs_name,
- sizeof (zc.zc_value));
- cp = strchr(zc.zc_value, '@');
- if (cp != NULL)
- *cp = '\0';
- (void) strlcat(zc.zc_value, "@", sizeof (zc.zc_value));
- (void) strlcat(zc.zc_value, snapname, sizeof (zc.zc_value));
- }
+static int
+zfs_do_list_ioctl(zfs_handle_t *zhp, int arg, zfs_cmd_t *zc)
+{
+ int rc;
+ uint64_t orig_cookie;
- err = ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_SPACE_WRITTEN, &zc);
- if (err)
- return (err);
+ orig_cookie = zc->zc_cookie;
+top:
+ (void) strlcpy(zc->zc_name, zhp->zfs_name, sizeof (zc->zc_name));
+ rc = ioctl(zhp->zfs_hdl->libzfs_fd, arg, zc);
- *propvalue = zc.zc_cookie;
- return (0);
+ if (rc == -1) {
+ switch (errno) {
+ case ENOMEM:
+ /* expand nvlist memory and try again */
+ if (zcmd_expand_dst_nvlist(zhp->zfs_hdl, zc) != 0) {
+ zcmd_free_nvlists(zc);
+ return (-1);
+ }
+ zc->zc_cookie = orig_cookie;
+ goto top;
+ /*
+ * An errno value of ESRCH indicates normal completion.
+ * If ENOENT is returned, then the underlying dataset
+ * has been removed since we obtained the handle.
+ */
+ case ESRCH:
+ case ENOENT:
+ rc = 1;
+ break;
+ default:
+ rc = zfs_standard_error(zhp->zfs_hdl, errno,
+ dgettext(TEXT_DOMAIN,
+ "cannot iterate filesystems"));
+ break;
+ }
+ }
+ return (rc);
}
+/*
+ * Iterate over all child filesystems
+ */
int
-zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
- char *propbuf, int proplen, boolean_t literal)
+zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
{
- int err;
- uint64_t propvalue;
+ zfs_cmd_t zc = { 0 };
+ zfs_handle_t *nzhp;
+ int ret;
- err = zfs_prop_get_written_int(zhp, propname, &propvalue);
+ if (zhp->zfs_type != ZFS_TYPE_FILESYSTEM)
+ return (0);
- if (err)
- return (err);
+ if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
+ return (-1);
- if (literal) {
- (void) snprintf(propbuf, proplen, "%llu", propvalue);
- } else {
- zfs_nicenum(propvalue, propbuf, proplen);
+ while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_DATASET_LIST_NEXT,
+ &zc)) == 0) {
+ /*
+ * Silently ignore errors, as the only plausible explanation is
+ * that the pool has since been removed.
+ */
+ if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl,
+ &zc)) == NULL) {
+ continue;
+ }
+
+ if ((ret = func(nzhp, data)) != 0) {
+ zcmd_free_nvlists(&zc);
+ return (ret);
+ }
}
- return (0);
+ zcmd_free_nvlists(&zc);
+ return ((ret < 0) ? ret : 0);
}
/*
- * Returns the name of the given zfs handle.
+ * Iterate over all snapshots
*/
-const char *
-zfs_get_name(const zfs_handle_t *zhp)
+int
+zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data)
{
- return (zhp->zfs_name);
+ zfs_cmd_t zc = { 0 };
+ zfs_handle_t *nzhp;
+ int ret;
+
+ if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT)
+ return (0);
+
+ if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
+ return (-1);
+ while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_SNAPSHOT_LIST_NEXT,
+ &zc)) == 0) {
+
+ if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl,
+ &zc)) == NULL) {
+ continue;
+ }
+
+ if ((ret = func(nzhp, data)) != 0) {
+ zcmd_free_nvlists(&zc);
+ return (ret);
+ }
+ }
+ zcmd_free_nvlists(&zc);
+ return ((ret < 0) ? ret : 0);
}
/*
- * Returns the type of the given zfs handle.
+ * Iterate over all children, snapshots and filesystems
*/
-zfs_type_t
-zfs_get_type(const zfs_handle_t *zhp)
+int
+zfs_iter_children(zfs_handle_t *zhp, zfs_iter_f func, void *data)
{
- return (zhp->zfs_type);
+ int ret;
+
+ if ((ret = zfs_iter_filesystems(zhp, func, data)) != 0)
+ return (ret);
+
+ return (zfs_iter_snapshots(zhp, func, data));
}
/*
@@ -2686,19 +2564,18 @@ is_descendant(const char *ds1, const char *ds2)
/*
* Given a complete name, return just the portion that refers to the parent.
- * Will return -1 if there is no parent (path is just the name of the
- * pool).
+ * Can return NULL if this is a pool.
*/
static int
parent_name(const char *path, char *buf, size_t buflen)
{
- char *slashp;
-
- (void) strlcpy(buf, path, buflen);
+ char *loc;
- if ((slashp = strrchr(buf, '/')) == NULL)
+ if ((loc = strrchr(path, '/')) == NULL)
return (-1);
- *slashp = '\0';
+
+ (void) strncpy(buf, path, MIN(buflen, loc - path));
+ buf[loc - path] = '\0';
return (0);
}
@@ -2845,6 +2722,7 @@ create_parents(libzfs_handle_t *hdl, char *target, int prefixlen)
*/
for (cp = target + prefixlen + 1;
cp = strchr(cp, '/'); *cp = '/', cp++) {
+ char *logstr;
*cp = '\0';
@@ -2855,12 +2733,16 @@ create_parents(libzfs_handle_t *hdl, char *target, int prefixlen)
continue;
}
+ logstr = hdl->libzfs_log_str;
+ hdl->libzfs_log_str = NULL;
if (zfs_create(hdl, target, ZFS_TYPE_FILESYSTEM,
NULL) != 0) {
+ hdl->libzfs_log_str = logstr;
opname = dgettext(TEXT_DOMAIN, "create");
goto ancestorerr;
}
+ hdl->libzfs_log_str = logstr;
h = zfs_open(hdl, target, ZFS_TYPE_FILESYSTEM);
if (h == NULL) {
opname = dgettext(TEXT_DOMAIN, "open");
@@ -2918,12 +2800,12 @@ int
zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
nvlist_t *props)
{
+ zfs_cmd_t zc = { 0 };
int ret;
uint64_t size = 0;
uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE);
char errbuf[1024];
uint64_t zoned;
- dmu_objset_type_t ost;
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot create '%s'"), path);
@@ -2943,16 +2825,17 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
* will return ENOENT, not EEXIST. To prevent this from happening, we
* first try to see if the dataset exists.
*/
- if (zfs_dataset_exists(hdl, path, ZFS_TYPE_DATASET)) {
+ (void) strlcpy(zc.zc_name, path, sizeof (zc.zc_name));
+ if (zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"dataset already exists"));
return (zfs_error(hdl, EZFS_EXISTS, errbuf));
}
if (type == ZFS_TYPE_VOLUME)
- ost = DMU_OST_ZVOL;
+ zc.zc_objset_type = DMU_OST_ZVOL;
else
- ost = DMU_OST_ZFS;
+ zc.zc_objset_type = DMU_OST_ZFS;
if (props && (props = zfs_valid_proplist(hdl, type, props,
zoned, NULL, errbuf)) == 0)
@@ -3004,10 +2887,15 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
}
}
- /* create the dataset */
- ret = lzc_create(path, ost, props);
+ if (props && zcmd_write_src_nvlist(hdl, &zc, props) != 0)
+ return (-1);
nvlist_free(props);
+ /* create the dataset */
+ ret = zfs_ioctl(hdl, ZFS_IOC_CREATE, &zc);
+
+ zcmd_free_nvlists(&zc);
+
/* check for failure */
if (ret != 0) {
char parent[ZFS_MAXNAMELEN];
@@ -3058,8 +2946,7 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
/*
* Destroys the given dataset. The caller must make sure that the filesystem
- * isn't mounted, and that there are no active dependents. If the file system
- * does not exist this function does nothing.
+ * isn't mounted, and that there are no active dependents.
*/
int
zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
@@ -3075,8 +2962,7 @@ zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
}
zc.zc_defer_destroy = defer;
- if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY, &zc) != 0 &&
- errno != ENOENT) {
+ if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY, &zc) != 0) {
return (zfs_standard_error_fmt(zhp->zfs_hdl, errno,
dgettext(TEXT_DOMAIN, "cannot destroy '%s'"),
zhp->zfs_name));
@@ -3088,8 +2974,9 @@ zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
}
struct destroydata {
- nvlist_t *nvl;
- const char *snapname;
+ char *snapname;
+ boolean_t gotone;
+ boolean_t closezhp;
};
static int
@@ -3098,19 +2985,24 @@ zfs_check_snap_cb(zfs_handle_t *zhp, void *arg)
struct destroydata *dd = arg;
zfs_handle_t *szhp;
char name[ZFS_MAXNAMELEN];
+ boolean_t closezhp = dd->closezhp;
int rv = 0;
- (void) snprintf(name, sizeof (name),
- "%s@%s", zhp->zfs_name, dd->snapname);
+ (void) strlcpy(name, zhp->zfs_name, sizeof (name));
+ (void) strlcat(name, "@", sizeof (name));
+ (void) strlcat(name, dd->snapname, sizeof (name));
szhp = make_dataset_handle(zhp->zfs_hdl, name);
if (szhp) {
- verify(nvlist_add_boolean(dd->nvl, name) == 0);
+ dd->gotone = B_TRUE;
zfs_close(szhp);
}
- rv = zfs_iter_filesystems(zhp, zfs_check_snap_cb, dd);
- zfs_close(zhp);
+ dd->closezhp = B_TRUE;
+ if (!dd->gotone)
+ rv = zfs_iter_filesystems(zhp, zfs_check_snap_cb, arg);
+ if (closezhp)
+ zfs_close(zhp);
return (rv);
}
@@ -3120,61 +3012,43 @@ zfs_check_snap_cb(zfs_handle_t *zhp, void *arg)
int
zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname, boolean_t defer)
{
+ zfs_cmd_t zc = { 0 };
int ret;
struct destroydata dd = { 0 };
dd.snapname = snapname;
- verify(nvlist_alloc(&dd.nvl, NV_UNIQUE_NAME, 0) == 0);
- (void) zfs_check_snap_cb(zfs_handle_dup(zhp), &dd);
+ (void) zfs_check_snap_cb(zhp, &dd);
- if (nvlist_next_nvpair(dd.nvl, NULL) == NULL) {
- ret = zfs_standard_error_fmt(zhp->zfs_hdl, ENOENT,
+ if (!dd.gotone) {
+ return (zfs_standard_error_fmt(zhp->zfs_hdl, ENOENT,
dgettext(TEXT_DOMAIN, "cannot destroy '%s@%s'"),
- zhp->zfs_name, snapname);
- } else {
- ret = zfs_destroy_snaps_nvl(zhp, dd.nvl, defer);
+ zhp->zfs_name, snapname));
}
- nvlist_free(dd.nvl);
- return (ret);
-}
-/*
- * Destroys all the snapshots named in the nvlist. They must be underneath
- * the zhp (either snapshots of it, or snapshots of its descendants).
- */
-int
-zfs_destroy_snaps_nvl(zfs_handle_t *zhp, nvlist_t *snaps, boolean_t defer)
-{
- int ret;
- nvlist_t *errlist;
-
- ret = lzc_destroy_snaps(snaps, defer, &errlist);
+ (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
+ (void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
+ zc.zc_defer_destroy = defer;
+ ret = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY_SNAPS, &zc);
if (ret != 0) {
- for (nvpair_t *pair = nvlist_next_nvpair(errlist, NULL);
- pair != NULL; pair = nvlist_next_nvpair(errlist, pair)) {
- char errbuf[1024];
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN, "cannot destroy snapshot %s"),
- nvpair_name(pair));
-
- switch (fnvpair_value_int32(pair)) {
- case EEXIST:
- zfs_error_aux(zhp->zfs_hdl,
- dgettext(TEXT_DOMAIN,
- "snapshot is cloned"));
- ret = zfs_error(zhp->zfs_hdl, EZFS_EXISTS,
- errbuf);
- break;
- default:
- ret = zfs_standard_error(zhp->zfs_hdl, errno,
- errbuf);
- break;
- }
+ char errbuf[1024];
+
+ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
+ "cannot destroy '%s@%s'"), zc.zc_name, snapname);
+
+ switch (errno) {
+ case EEXIST:
+ zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
+ "snapshot is cloned"));
+ return (zfs_error(zhp->zfs_hdl, EZFS_EXISTS, errbuf));
+
+ default:
+ return (zfs_standard_error(zhp->zfs_hdl, errno,
+ errbuf));
}
}
- return (ret);
+ return (0);
}
/*
@@ -3183,10 +3057,12 @@ zfs_destroy_snaps_nvl(zfs_handle_t *zhp, nvlist_t *snaps, boolean_t defer)
int
zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props)
{
+ zfs_cmd_t zc = { 0 };
char parent[ZFS_MAXNAMELEN];
int ret;
char errbuf[1024];
libzfs_handle_t *hdl = zhp->zfs_hdl;
+ zfs_type_t type;
uint64_t zoned;
assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
@@ -3194,7 +3070,7 @@ zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props)
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot create '%s'"), target);
- /* validate the target/clone name */
+ /* validate the target name */
if (!zfs_validate_name(hdl, target, ZFS_TYPE_FILESYSTEM, B_TRUE))
return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
@@ -3205,21 +3081,32 @@ zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props)
(void) parent_name(target, parent, sizeof (parent));
/* do the clone */
+ if (ZFS_IS_VOLUME(zhp)) {
+ zc.zc_objset_type = DMU_OST_ZVOL;
+ type = ZFS_TYPE_VOLUME;
+ } else {
+ zc.zc_objset_type = DMU_OST_ZFS;
+ type = ZFS_TYPE_FILESYSTEM;
+ }
if (props) {
- zfs_type_t type;
- if (ZFS_IS_VOLUME(zhp)) {
- type = ZFS_TYPE_VOLUME;
- } else {
- type = ZFS_TYPE_FILESYSTEM;
- }
if ((props = zfs_valid_proplist(hdl, type, props, zoned,
zhp, errbuf)) == NULL)
return (-1);
+
+ if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) {
+ nvlist_free(props);
+ return (-1);
+ }
+
+ nvlist_free(props);
}
- ret = lzc_clone(target, zhp->zfs_name, props);
- nvlist_free(props);
+ (void) strlcpy(zc.zc_name, target, sizeof (zc.zc_name));
+ (void) strlcpy(zc.zc_value, zhp->zfs_name, sizeof (zc.zc_value));
+ ret = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_CREATE, &zc);
+
+ zcmd_free_nvlists(&zc);
if (ret != 0) {
switch (errno) {
@@ -3304,134 +3191,74 @@ zfs_promote(zfs_handle_t *zhp)
return (ret);
}
-typedef struct snapdata {
- nvlist_t *sd_nvl;
- const char *sd_snapname;
-} snapdata_t;
-
-static int
-zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
-{
- snapdata_t *sd = arg;
- char name[ZFS_MAXNAMELEN];
- int rv = 0;
-
- (void) snprintf(name, sizeof (name),
- "%s@%s", zfs_get_name(zhp), sd->sd_snapname);
-
- fnvlist_add_boolean(sd->sd_nvl, name);
-
- rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd);
- zfs_close(zhp);
- return (rv);
-}
-
/*
- * Creates snapshots. The keys in the snaps nvlist are the snapshots to be
- * created.
+ * Takes a snapshot of the given dataset.
*/
int
-zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, nvlist_t *props)
+zfs_snapshot(libzfs_handle_t *hdl, const char *path, boolean_t recursive,
+ nvlist_t *props)
{
+ const char *delim;
+ char parent[ZFS_MAXNAMELEN];
+ zfs_handle_t *zhp;
+ zfs_cmd_t zc = { 0 };
int ret;
char errbuf[1024];
- nvpair_t *elem;
- nvlist_t *errors;
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
- "cannot create snapshots "));
-
- elem = NULL;
- while ((elem = nvlist_next_nvpair(snaps, elem)) != NULL) {
- const char *snapname = nvpair_name(elem);
+ "cannot snapshot '%s'"), path);
- /* validate the target name */
- if (!zfs_validate_name(hdl, snapname, ZFS_TYPE_SNAPSHOT,
- B_TRUE)) {
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN,
- "cannot create snapshot '%s'"), snapname);
- return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
- }
- }
-
- if (props != NULL &&
- (props = zfs_valid_proplist(hdl, ZFS_TYPE_SNAPSHOT,
- props, B_FALSE, NULL, errbuf)) == NULL) {
- return (-1);
- }
+ /* validate the target name */
+ if (!zfs_validate_name(hdl, path, ZFS_TYPE_SNAPSHOT, B_TRUE))
+ return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
- ret = lzc_snapshot(snaps, props, &errors);
+ if (props) {
+ if ((props = zfs_valid_proplist(hdl, ZFS_TYPE_SNAPSHOT,
+ props, B_FALSE, NULL, errbuf)) == NULL)
+ return (-1);
- if (ret != 0) {
- boolean_t printed = B_FALSE;
- for (elem = nvlist_next_nvpair(errors, NULL);
- elem != NULL;
- elem = nvlist_next_nvpair(errors, elem)) {
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN,
- "cannot create snapshot '%s'"), nvpair_name(elem));
- (void) zfs_standard_error(hdl,
- fnvpair_value_int32(elem), errbuf);
- printed = B_TRUE;
+ if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) {
+ nvlist_free(props);
+ return (-1);
}
- if (!printed) {
- switch (ret) {
- case EXDEV:
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "multiple snapshots of same "
- "fs not allowed"));
- (void) zfs_error(hdl, EZFS_EXISTS, errbuf);
- break;
- default:
- (void) zfs_standard_error(hdl, ret, errbuf);
- }
- }
+ nvlist_free(props);
}
- nvlist_free(props);
- nvlist_free(errors);
- return (ret);
-}
-
-int
-zfs_snapshot(libzfs_handle_t *hdl, const char *path, boolean_t recursive,
- nvlist_t *props)
-{
- int ret;
- snapdata_t sd = { 0 };
- char fsname[ZFS_MAXNAMELEN];
- char *cp;
- zfs_handle_t *zhp;
- char errbuf[1024];
-
- (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
- "cannot snapshot %s"), path);
-
- if (!zfs_validate_name(hdl, path, ZFS_TYPE_SNAPSHOT, B_TRUE))
- return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-
- (void) strlcpy(fsname, path, sizeof (fsname));
- cp = strchr(fsname, '@');
- *cp = '\0';
- sd.sd_snapname = cp + 1;
+ /* make sure the parent exists and is of the appropriate type */
+ delim = strchr(path, '@');
+ (void) strncpy(parent, path, delim - path);
+ parent[delim - path] = '\0';
- if ((zhp = zfs_open(hdl, fsname, ZFS_TYPE_FILESYSTEM |
+ if ((zhp = zfs_open(hdl, parent, ZFS_TYPE_FILESYSTEM |
ZFS_TYPE_VOLUME)) == NULL) {
+ zcmd_free_nvlists(&zc);
return (-1);
}
- verify(nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) == 0);
- if (recursive) {
- (void) zfs_snapshot_cb(zfs_handle_dup(zhp), &sd);
- } else {
- fnvlist_add_boolean(sd.sd_nvl, path);
+ (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
+ (void) strlcpy(zc.zc_value, delim+1, sizeof (zc.zc_value));
+ if (ZFS_IS_VOLUME(zhp))
+ zc.zc_objset_type = DMU_OST_ZVOL;
+ else
+ zc.zc_objset_type = DMU_OST_ZFS;
+ zc.zc_cookie = recursive;
+ ret = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SNAPSHOT, &zc);
+
+ zcmd_free_nvlists(&zc);
+
+ /*
+ * if it was recursive, the one that actually failed will be in
+ * zc.zc_name.
+ */
+ if (ret != 0) {
+ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
+ "cannot create snapshot '%s@%s'"), zc.zc_name, zc.zc_value);
+ (void) zfs_standard_error(hdl, errno, errbuf);
}
- ret = zfs_snapshot_nvl(hdl, sd.sd_nvl, props);
- nvlist_free(sd.sd_nvl);
zfs_close(zhp);
+
return (ret);
}
@@ -3459,13 +3286,17 @@ rollback_destroy(zfs_handle_t *zhp, void *data)
zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT &&
zfs_prop_get_int(zhp, ZFS_PROP_CREATETXG) >
cbp->cb_create) {
+ char *logstr;
cbp->cb_dependent = B_TRUE;
cbp->cb_error |= zfs_iter_dependents(zhp, B_FALSE,
rollback_destroy, cbp);
cbp->cb_dependent = B_FALSE;
+ logstr = zhp->zfs_hdl->libzfs_log_str;
+ zhp->zfs_hdl->libzfs_log_str = NULL;
cbp->cb_error |= zfs_destroy(zhp, B_FALSE);
+ zhp->zfs_hdl->libzfs_log_str = logstr;
}
} else {
/* We must destroy this clone; first unmount it */
@@ -3576,11 +3407,46 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
}
/*
+ * Iterate over all dependents for a given dataset. This includes both
+ * hierarchical dependents (children) and data dependents (snapshots and
+ * clones). The bulk of the processing occurs in get_dependents() in
+ * libzfs_graph.c.
+ */
+int
+zfs_iter_dependents(zfs_handle_t *zhp, boolean_t allowrecursion,
+ zfs_iter_f func, void *data)
+{
+ char **dependents;
+ size_t count;
+ int i;
+ zfs_handle_t *child;
+ int ret = 0;
+
+ if (get_dependents(zhp->zfs_hdl, allowrecursion, zhp->zfs_name,
+ &dependents, &count) != 0)
+ return (-1);
+
+ for (i = 0; i < count; i++) {
+ if ((child = make_dataset_handle(zhp->zfs_hdl,
+ dependents[i])) == NULL)
+ continue;
+
+ if ((ret = func(child, data)) != 0)
+ break;
+ }
+
+ for (i = 0; i < count; i++)
+ free(dependents[i]);
+ free(dependents);
+
+ return (ret);
+}
+
+/*
* Renames the given dataset.
*/
int
-zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive,
- boolean_t force_unmount)
+zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
{
int ret;
zfs_cmd_t zc = { 0 };
@@ -3692,8 +3558,7 @@ zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive,
}
} else {
- if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, 0,
- force_unmount ? MS_FORCE : 0)) == NULL)
+ if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0)) == NULL)
return (-1);
if (changelist_haszonedchild(cl)) {
@@ -4026,7 +3891,7 @@ zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type,
int error;
zfs_useracct_t buf[100];
- (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
+ (void) strncpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
zc.zc_objset_type = type;
zc.zc_nvlist_dst = (uintptr_t)buf;
@@ -4154,193 +4019,6 @@ zfs_release(zfs_handle_t *zhp, const char *snapname, const char *tag,
return (0);
}
-int
-zfs_get_fsacl(zfs_handle_t *zhp, nvlist_t **nvl)
-{
- zfs_cmd_t zc = { 0 };
- libzfs_handle_t *hdl = zhp->zfs_hdl;
- int nvsz = 2048;
- void *nvbuf;
- int err = 0;
- char errbuf[ZFS_MAXNAMELEN+32];
-
- assert(zhp->zfs_type == ZFS_TYPE_VOLUME ||
- zhp->zfs_type == ZFS_TYPE_FILESYSTEM);
-
-tryagain:
-
- nvbuf = malloc(nvsz);
- if (nvbuf == NULL) {
- err = (zfs_error(hdl, EZFS_NOMEM, strerror(errno)));
- goto out;
- }
-
- zc.zc_nvlist_dst_size = nvsz;
- zc.zc_nvlist_dst = (uintptr_t)nvbuf;
-
- (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN);
-
- if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) {
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN, "cannot get permissions on '%s'"),
- zc.zc_name);
- switch (errno) {
- case ENOMEM:
- free(nvbuf);
- nvsz = zc.zc_nvlist_dst_size;
- goto tryagain;
-
- case ENOTSUP:
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "pool must be upgraded"));
- err = zfs_error(hdl, EZFS_BADVERSION, errbuf);
- break;
- case EINVAL:
- err = zfs_error(hdl, EZFS_BADTYPE, errbuf);
- break;
- case ENOENT:
- err = zfs_error(hdl, EZFS_NOENT, errbuf);
- break;
- default:
- err = zfs_standard_error_fmt(hdl, errno, errbuf);
- break;
- }
- } else {
- /* success */
- int rc = nvlist_unpack(nvbuf, zc.zc_nvlist_dst_size, nvl, 0);
- if (rc) {
- (void) snprintf(errbuf, sizeof (errbuf), dgettext(
- TEXT_DOMAIN, "cannot get permissions on '%s'"),
- zc.zc_name);
- err = zfs_standard_error_fmt(hdl, rc, errbuf);
- }
- }
-
- free(nvbuf);
-out:
- return (err);
-}
-
-int
-zfs_set_fsacl(zfs_handle_t *zhp, boolean_t un, nvlist_t *nvl)
-{
- zfs_cmd_t zc = { 0 };
- libzfs_handle_t *hdl = zhp->zfs_hdl;
- char *nvbuf;
- char errbuf[ZFS_MAXNAMELEN+32];
- size_t nvsz;
- int err;
-
- assert(zhp->zfs_type == ZFS_TYPE_VOLUME ||
- zhp->zfs_type == ZFS_TYPE_FILESYSTEM);
-
- err = nvlist_size(nvl, &nvsz, NV_ENCODE_NATIVE);
- assert(err == 0);
-
- nvbuf = malloc(nvsz);
-
- err = nvlist_pack(nvl, &nvbuf, &nvsz, NV_ENCODE_NATIVE, 0);
- assert(err == 0);
-
- zc.zc_nvlist_src_size = nvsz;
- zc.zc_nvlist_src = (uintptr_t)nvbuf;
- zc.zc_perm_action = un;
-
- (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
- if (zfs_ioctl(hdl, ZFS_IOC_SET_FSACL, &zc) != 0) {
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN, "cannot set permissions on '%s'"),
- zc.zc_name);
- switch (errno) {
- case ENOTSUP:
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "pool must be upgraded"));
- err = zfs_error(hdl, EZFS_BADVERSION, errbuf);
- break;
- case EINVAL:
- err = zfs_error(hdl, EZFS_BADTYPE, errbuf);
- break;
- case ENOENT:
- err = zfs_error(hdl, EZFS_NOENT, errbuf);
- break;
- default:
- err = zfs_standard_error_fmt(hdl, errno, errbuf);
- break;
- }
- }
-
- free(nvbuf);
-
- return (err);
-}
-
-int
-zfs_get_holds(zfs_handle_t *zhp, nvlist_t **nvl)
-{
- zfs_cmd_t zc = { 0 };
- libzfs_handle_t *hdl = zhp->zfs_hdl;
- int nvsz = 2048;
- void *nvbuf;
- int err = 0;
- char errbuf[ZFS_MAXNAMELEN+32];
-
- assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
-
-tryagain:
-
- nvbuf = malloc(nvsz);
- if (nvbuf == NULL) {
- err = (zfs_error(hdl, EZFS_NOMEM, strerror(errno)));
- goto out;
- }
-
- zc.zc_nvlist_dst_size = nvsz;
- zc.zc_nvlist_dst = (uintptr_t)nvbuf;
-
- (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN);
-
- if (zfs_ioctl(hdl, ZFS_IOC_GET_HOLDS, &zc) != 0) {
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN, "cannot get holds for '%s'"),
- zc.zc_name);
- switch (errno) {
- case ENOMEM:
- free(nvbuf);
- nvsz = zc.zc_nvlist_dst_size;
- goto tryagain;
-
- case ENOTSUP:
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "pool must be upgraded"));
- err = zfs_error(hdl, EZFS_BADVERSION, errbuf);
- break;
- case EINVAL:
- err = zfs_error(hdl, EZFS_BADTYPE, errbuf);
- break;
- case ENOENT:
- err = zfs_error(hdl, EZFS_NOENT, errbuf);
- break;
- default:
- err = zfs_standard_error_fmt(hdl, errno, errbuf);
- break;
- }
- } else {
- /* success */
- int rc = nvlist_unpack(nvbuf, zc.zc_nvlist_dst_size, nvl, 0);
- if (rc) {
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN, "cannot get holds for '%s'"),
- zc.zc_name);
- err = zfs_standard_error_fmt(hdl, rc, errbuf);
- }
- }
-
- free(nvbuf);
-out:
- return (err);
-}
-
uint64_t
zvol_volsize_to_reservation(uint64_t volsize, nvlist_t *props)
{
diff --git a/lib/libzfs/common/libzfs_graph.c b/lib/libzfs/common/libzfs_graph.c
new file mode 100644
index 000000000000..bc21c51ae26c
--- /dev/null
+++ b/lib/libzfs/common/libzfs_graph.c
@@ -0,0 +1,653 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Iterate over all children of the current object. This includes the normal
+ * dataset hierarchy, but also arbitrary hierarchies due to clones. We want to
+ * walk all datasets in the pool, and construct a directed graph of the form:
+ *
+ * home
+ * |
+ * +----+----+
+ * | |
+ * v v ws
+ * bar baz |
+ * | |
+ * v v
+ * @yesterday ----> foo
+ *
+ * In order to construct this graph, we have to walk every dataset in the pool,
+ * because the clone parent is stored as a property of the child, not the
+ * parent. The parent only keeps track of the number of clones.
+ *
+ * In the normal case (without clones) this would be rather expensive. To avoid
+ * unnecessary computation, we first try a walk of the subtree hierarchy
+ * starting from the initial node. At each dataset, we construct a node in the
+ * graph and an edge leading from its parent. If we don't see any snapshots
+ * with a non-zero clone count, then we are finished.
+ *
+ * If we do find a cloned snapshot, then we finish the walk of the current
+ * subtree, but indicate that we need to do a complete walk. We then perform a
+ * global walk of all datasets, avoiding the subtree we already processed.
+ *
+ * At the end of this, we'll end up with a directed graph of all relevant (and
+ * possible some irrelevant) datasets in the system. We need to both find our
+ * limiting subgraph and determine a safe ordering in which to destroy the
+ * datasets. We do a topological ordering of our graph starting at our target
+ * dataset, and then walk the results in reverse.
+ *
+ * It's possible for the graph to have cycles if, for example, the user renames
+ * a clone to be the parent of its origin snapshot. The user can request to
+ * generate an error in this case, or ignore the cycle and continue.
+ *
+ * When removing datasets, we want to destroy the snapshots in chronological
+ * order (because this is the most efficient method). In order to accomplish
+ * this, we store the creation transaction group with each vertex and keep each
+ * vertex's edges sorted according to this value. The topological sort will
+ * automatically walk the snapshots in the correct order.
+ */
+
+#include <assert.h>
+#include <libintl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <unistd.h>
+
+#include <libzfs.h>
+
+#include "libzfs_impl.h"
+#include "zfs_namecheck.h"
+
+#define MIN_EDGECOUNT 4
+
+/*
+ * Vertex structure. Indexed by dataset name, this structure maintains a list
+ * of edges to other vertices.
+ */
+struct zfs_edge;
+typedef struct zfs_vertex {
+ char zv_dataset[ZFS_MAXNAMELEN];
+ struct zfs_vertex *zv_next;
+ int zv_visited;
+ uint64_t zv_txg;
+ struct zfs_edge **zv_edges;
+ int zv_edgecount;
+ int zv_edgealloc;
+} zfs_vertex_t;
+
+enum {
+ VISIT_SEEN = 1,
+ VISIT_SORT_PRE,
+ VISIT_SORT_POST
+};
+
+/*
+ * Edge structure. Simply maintains a pointer to the destination vertex. There
+ * is no need to store the source vertex, since we only use edges in the context
+ * of the source vertex.
+ */
+typedef struct zfs_edge {
+ zfs_vertex_t *ze_dest;
+ struct zfs_edge *ze_next;
+} zfs_edge_t;
+
+#define ZFS_GRAPH_SIZE 1027 /* this could be dynamic some day */
+
+/*
+ * Graph structure. Vertices are maintained in a hash indexed by dataset name.
+ */
+typedef struct zfs_graph {
+ zfs_vertex_t **zg_hash;
+ size_t zg_size;
+ size_t zg_nvertex;
+ const char *zg_root;
+ int zg_clone_count;
+} zfs_graph_t;
+
+/*
+ * Allocate a new edge pointing to the target vertex.
+ */
+static zfs_edge_t *
+zfs_edge_create(libzfs_handle_t *hdl, zfs_vertex_t *dest)
+{
+ zfs_edge_t *zep = zfs_alloc(hdl, sizeof (zfs_edge_t));
+
+ if (zep == NULL)
+ return (NULL);
+
+ zep->ze_dest = dest;
+
+ return (zep);
+}
+
+/*
+ * Destroy an edge.
+ */
+static void
+zfs_edge_destroy(zfs_edge_t *zep)
+{
+ free(zep);
+}
+
+/*
+ * Allocate a new vertex with the given name.
+ */
+static zfs_vertex_t *
+zfs_vertex_create(libzfs_handle_t *hdl, const char *dataset)
+{
+ zfs_vertex_t *zvp = zfs_alloc(hdl, sizeof (zfs_vertex_t));
+
+ if (zvp == NULL)
+ return (NULL);
+
+ assert(strlen(dataset) < ZFS_MAXNAMELEN);
+
+ (void) strlcpy(zvp->zv_dataset, dataset, sizeof (zvp->zv_dataset));
+
+ if ((zvp->zv_edges = zfs_alloc(hdl,
+ MIN_EDGECOUNT * sizeof (void *))) == NULL) {
+ free(zvp);
+ return (NULL);
+ }
+
+ zvp->zv_edgealloc = MIN_EDGECOUNT;
+
+ return (zvp);
+}
+
+/*
+ * Destroy a vertex. Frees up any associated edges.
+ */
+static void
+zfs_vertex_destroy(zfs_vertex_t *zvp)
+{
+ int i;
+
+ for (i = 0; i < zvp->zv_edgecount; i++)
+ zfs_edge_destroy(zvp->zv_edges[i]);
+
+ free(zvp->zv_edges);
+ free(zvp);
+}
+
+/*
+ * Given a vertex, add an edge to the destination vertex.
+ */
+static int
+zfs_vertex_add_edge(libzfs_handle_t *hdl, zfs_vertex_t *zvp,
+ zfs_vertex_t *dest)
+{
+ zfs_edge_t *zep = zfs_edge_create(hdl, dest);
+
+ if (zep == NULL)
+ return (-1);
+
+ if (zvp->zv_edgecount == zvp->zv_edgealloc) {
+ void *ptr;
+
+ if ((ptr = zfs_realloc(hdl, zvp->zv_edges,
+ zvp->zv_edgealloc * sizeof (void *),
+ zvp->zv_edgealloc * 2 * sizeof (void *))) == NULL)
+ return (-1);
+
+ zvp->zv_edges = ptr;
+ zvp->zv_edgealloc *= 2;
+ }
+
+ zvp->zv_edges[zvp->zv_edgecount++] = zep;
+
+ return (0);
+}
+
+static int
+zfs_edge_compare(const void *a, const void *b)
+{
+ const zfs_edge_t *ea = *((zfs_edge_t **)a);
+ const zfs_edge_t *eb = *((zfs_edge_t **)b);
+
+ if (ea->ze_dest->zv_txg < eb->ze_dest->zv_txg)
+ return (-1);
+ if (ea->ze_dest->zv_txg > eb->ze_dest->zv_txg)
+ return (1);
+ return (0);
+}
+
+/*
+ * Sort the given vertex edges according to the creation txg of each vertex.
+ */
+static void
+zfs_vertex_sort_edges(zfs_vertex_t *zvp)
+{
+ if (zvp->zv_edgecount == 0)
+ return;
+
+ qsort(zvp->zv_edges, zvp->zv_edgecount, sizeof (void *),
+ zfs_edge_compare);
+}
+
+/*
+ * Construct a new graph object. We allow the size to be specified as a
+ * parameter so in the future we can size the hash according to the number of
+ * datasets in the pool.
+ */
+static zfs_graph_t *
+zfs_graph_create(libzfs_handle_t *hdl, const char *dataset, size_t size)
+{
+ zfs_graph_t *zgp = zfs_alloc(hdl, sizeof (zfs_graph_t));
+
+ if (zgp == NULL)
+ return (NULL);
+
+ zgp->zg_size = size;
+ if ((zgp->zg_hash = zfs_alloc(hdl,
+ size * sizeof (zfs_vertex_t *))) == NULL) {
+ free(zgp);
+ return (NULL);
+ }
+
+ zgp->zg_root = dataset;
+ zgp->zg_clone_count = 0;
+
+ return (zgp);
+}
+
+/*
+ * Destroy a graph object. We have to iterate over all the hash chains,
+ * destroying each vertex in the process.
+ */
+static void
+zfs_graph_destroy(zfs_graph_t *zgp)
+{
+ int i;
+ zfs_vertex_t *current, *next;
+
+ for (i = 0; i < zgp->zg_size; i++) {
+ current = zgp->zg_hash[i];
+ while (current != NULL) {
+ next = current->zv_next;
+ zfs_vertex_destroy(current);
+ current = next;
+ }
+ }
+
+ free(zgp->zg_hash);
+ free(zgp);
+}
+
+/*
+ * Graph hash function. Classic bernstein k=33 hash function, taken from
+ * usr/src/cmd/sgs/tools/common/strhash.c
+ */
+static size_t
+zfs_graph_hash(zfs_graph_t *zgp, const char *str)
+{
+ size_t hash = 5381;
+ int c;
+
+ while ((c = *str++) != 0)
+ hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
+
+ return (hash % zgp->zg_size);
+}
+
+/*
+ * Given a dataset name, finds the associated vertex, creating it if necessary.
+ */
+static zfs_vertex_t *
+zfs_graph_lookup(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset,
+ uint64_t txg)
+{
+ size_t idx = zfs_graph_hash(zgp, dataset);
+ zfs_vertex_t *zvp;
+
+ for (zvp = zgp->zg_hash[idx]; zvp != NULL; zvp = zvp->zv_next) {
+ if (strcmp(zvp->zv_dataset, dataset) == 0) {
+ if (zvp->zv_txg == 0)
+ zvp->zv_txg = txg;
+ return (zvp);
+ }
+ }
+
+ if ((zvp = zfs_vertex_create(hdl, dataset)) == NULL)
+ return (NULL);
+
+ zvp->zv_next = zgp->zg_hash[idx];
+ zvp->zv_txg = txg;
+ zgp->zg_hash[idx] = zvp;
+ zgp->zg_nvertex++;
+
+ return (zvp);
+}
+
+/*
+ * Given two dataset names, create an edge between them. For the source vertex,
+ * mark 'zv_visited' to indicate that we have seen this vertex, and not simply
+ * created it as a destination of another edge. If 'dest' is NULL, then this
+ * is an individual vertex (i.e. the starting vertex), so don't add an edge.
+ */
+static int
+zfs_graph_add(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *source,
+ const char *dest, uint64_t txg)
+{
+ zfs_vertex_t *svp, *dvp;
+
+ if ((svp = zfs_graph_lookup(hdl, zgp, source, 0)) == NULL)
+ return (-1);
+ svp->zv_visited = VISIT_SEEN;
+ if (dest != NULL) {
+ dvp = zfs_graph_lookup(hdl, zgp, dest, txg);
+ if (dvp == NULL)
+ return (-1);
+ if (zfs_vertex_add_edge(hdl, svp, dvp) != 0)
+ return (-1);
+ }
+
+ return (0);
+}
+
+/*
+ * Iterate over all children of the given dataset, adding any vertices
+ * as necessary. Returns -1 if there was an error, or 0 otherwise.
+ * This is a simple recursive algorithm - the ZFS namespace typically
+ * is very flat. We manually invoke the necessary ioctl() calls to
+ * avoid the overhead and additional semantics of zfs_open().
+ */
+static int
+iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset)
+{
+ zfs_cmd_t zc = { 0 };
+ zfs_vertex_t *zvp;
+
+ /*
+ * Look up the source vertex, and avoid it if we've seen it before.
+ */
+ zvp = zfs_graph_lookup(hdl, zgp, dataset, 0);
+ if (zvp == NULL)
+ return (-1);
+ if (zvp->zv_visited == VISIT_SEEN)
+ return (0);
+
+ /*
+ * Iterate over all children
+ */
+ for ((void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
+ ioctl(hdl->libzfs_fd, ZFS_IOC_DATASET_LIST_NEXT, &zc) == 0;
+ (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name))) {
+ /*
+ * Get statistics for this dataset, to determine the type of the
+ * dataset and clone statistics. If this fails, the dataset has
+ * since been removed, and we're pretty much screwed anyway.
+ */
+ zc.zc_objset_stats.dds_origin[0] = '\0';
+ if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0)
+ continue;
+
+ if (zc.zc_objset_stats.dds_origin[0] != '\0') {
+ if (zfs_graph_add(hdl, zgp,
+ zc.zc_objset_stats.dds_origin, zc.zc_name,
+ zc.zc_objset_stats.dds_creation_txg) != 0)
+ return (-1);
+ /*
+ * Count origins only if they are contained in the graph
+ */
+ if (isa_child_of(zc.zc_objset_stats.dds_origin,
+ zgp->zg_root))
+ zgp->zg_clone_count--;
+ }
+
+ /*
+ * Add an edge between the parent and the child.
+ */
+ if (zfs_graph_add(hdl, zgp, dataset, zc.zc_name,
+ zc.zc_objset_stats.dds_creation_txg) != 0)
+ return (-1);
+
+ /*
+ * Recursively visit child
+ */
+ if (iterate_children(hdl, zgp, zc.zc_name))
+ return (-1);
+ }
+
+ /*
+ * Now iterate over all snapshots.
+ */
+ bzero(&zc, sizeof (zc));
+
+ for ((void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
+ ioctl(hdl->libzfs_fd, ZFS_IOC_SNAPSHOT_LIST_NEXT, &zc) == 0;
+ (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name))) {
+
+ /*
+ * Get statistics for this dataset, to determine the type of the
+ * dataset and clone statistics. If this fails, the dataset has
+ * since been removed, and we're pretty much screwed anyway.
+ */
+ if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0)
+ continue;
+
+ /*
+ * Add an edge between the parent and the child.
+ */
+ if (zfs_graph_add(hdl, zgp, dataset, zc.zc_name,
+ zc.zc_objset_stats.dds_creation_txg) != 0)
+ return (-1);
+
+ zgp->zg_clone_count += zc.zc_objset_stats.dds_num_clones;
+ }
+
+ zvp->zv_visited = VISIT_SEEN;
+
+ return (0);
+}
+
+/*
+ * Returns false if there are no snapshots with dependent clones in this
+ * subtree or if all of those clones are also in this subtree. Returns
+ * true if there is an error or there are external dependents.
+ */
+static boolean_t
+external_dependents(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset)
+{
+ zfs_cmd_t zc = { 0 };
+
+ /*
+ * Check whether this dataset is a clone or has clones since
+ * iterate_children() only checks the children.
+ */
+ (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
+ if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0)
+ return (B_TRUE);
+
+ if (zc.zc_objset_stats.dds_origin[0] != '\0') {
+ if (zfs_graph_add(hdl, zgp,
+ zc.zc_objset_stats.dds_origin, zc.zc_name,
+ zc.zc_objset_stats.dds_creation_txg) != 0)
+ return (B_TRUE);
+ if (isa_child_of(zc.zc_objset_stats.dds_origin, dataset))
+ zgp->zg_clone_count--;
+ }
+
+ if ((zc.zc_objset_stats.dds_num_clones) ||
+ iterate_children(hdl, zgp, dataset))
+ return (B_TRUE);
+
+ return (zgp->zg_clone_count != 0);
+}
+
+/*
+ * Construct a complete graph of all necessary vertices. First, iterate over
+ * only our object's children. If no cloned snapshots are found, or all of
+ * the cloned snapshots are in this subtree then return a graph of the subtree.
+ * Otherwise, start at the root of the pool and iterate over all datasets.
+ */
+static zfs_graph_t *
+construct_graph(libzfs_handle_t *hdl, const char *dataset)
+{
+ zfs_graph_t *zgp = zfs_graph_create(hdl, dataset, ZFS_GRAPH_SIZE);
+ int ret = 0;
+
+ if (zgp == NULL)
+ return (zgp);
+
+ if ((strchr(dataset, '/') == NULL) ||
+ (external_dependents(hdl, zgp, dataset))) {
+ /*
+ * Determine pool name and try again.
+ */
+ int len = strcspn(dataset, "/@") + 1;
+ char *pool = zfs_alloc(hdl, len);
+
+ if (pool == NULL) {
+ zfs_graph_destroy(zgp);
+ return (NULL);
+ }
+ (void) strlcpy(pool, dataset, len);
+
+ if (iterate_children(hdl, zgp, pool) == -1 ||
+ zfs_graph_add(hdl, zgp, pool, NULL, 0) != 0) {
+ free(pool);
+ zfs_graph_destroy(zgp);
+ return (NULL);
+ }
+ free(pool);
+ }
+
+ if (ret == -1 || zfs_graph_add(hdl, zgp, dataset, NULL, 0) != 0) {
+ zfs_graph_destroy(zgp);
+ return (NULL);
+ }
+
+ return (zgp);
+}
+
+/*
+ * Given a graph, do a recursive topological sort into the given array. This is
+ * really just a depth first search, so that the deepest nodes appear first.
+ * hijack the 'zv_visited' marker to avoid visiting the same vertex twice.
+ */
+static int
+topo_sort(libzfs_handle_t *hdl, boolean_t allowrecursion, char **result,
+ size_t *idx, zfs_vertex_t *zgv)
+{
+ int i;
+
+ if (zgv->zv_visited == VISIT_SORT_PRE && !allowrecursion) {
+ /*
+ * If we've already seen this vertex as part of our depth-first
+ * search, then we have a cyclic dependency, and we must return
+ * an error.
+ */
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "recursive dependency at '%s'"),
+ zgv->zv_dataset);
+ return (zfs_error(hdl, EZFS_RECURSIVE,
+ dgettext(TEXT_DOMAIN,
+ "cannot determine dependent datasets")));
+ } else if (zgv->zv_visited >= VISIT_SORT_PRE) {
+ /*
+ * If we've already processed this as part of the topological
+ * sort, then don't bother doing so again.
+ */
+ return (0);
+ }
+
+ zgv->zv_visited = VISIT_SORT_PRE;
+
+ /* avoid doing a search if we don't have to */
+ zfs_vertex_sort_edges(zgv);
+ for (i = 0; i < zgv->zv_edgecount; i++) {
+ if (topo_sort(hdl, allowrecursion, result, idx,
+ zgv->zv_edges[i]->ze_dest) != 0)
+ return (-1);
+ }
+
+ /* we may have visited this in the course of the above */
+ if (zgv->zv_visited == VISIT_SORT_POST)
+ return (0);
+
+ if ((result[*idx] = zfs_alloc(hdl,
+ strlen(zgv->zv_dataset) + 1)) == NULL)
+ return (-1);
+
+ (void) strcpy(result[*idx], zgv->zv_dataset);
+ *idx += 1;
+ zgv->zv_visited = VISIT_SORT_POST;
+ return (0);
+}
+
+/*
+ * The only public interface for this file. Do the dirty work of constructing a
+ * child list for the given object. Construct the graph, do the toplogical
+ * sort, and then return the array of strings to the caller.
+ *
+ * The 'allowrecursion' parameter controls behavior when cycles are found. If
+ * it is set, the the cycle is ignored and the results returned as if the cycle
+ * did not exist. If it is not set, then the routine will generate an error if
+ * a cycle is found.
+ */
+int
+get_dependents(libzfs_handle_t *hdl, boolean_t allowrecursion,
+ const char *dataset, char ***result, size_t *count)
+{
+ zfs_graph_t *zgp;
+ zfs_vertex_t *zvp;
+
+ if ((zgp = construct_graph(hdl, dataset)) == NULL)
+ return (-1);
+
+ if ((*result = zfs_alloc(hdl,
+ zgp->zg_nvertex * sizeof (char *))) == NULL) {
+ zfs_graph_destroy(zgp);
+ return (-1);
+ }
+
+ if ((zvp = zfs_graph_lookup(hdl, zgp, dataset, 0)) == NULL) {
+ free(*result);
+ zfs_graph_destroy(zgp);
+ return (-1);
+ }
+
+ *count = 0;
+ if (topo_sort(hdl, allowrecursion, *result, count, zvp) != 0) {
+ free(*result);
+ zfs_graph_destroy(zgp);
+ return (-1);
+ }
+
+ /*
+ * Get rid of the last entry, which is our starting vertex and not
+ * strictly a dependent.
+ */
+ assert(*count > 0);
+ free((*result)[*count - 1]);
+ (*count)--;
+
+ zfs_graph_destroy(zgp);
+
+ return (0);
+}
diff --git a/lib/libzfs/common/libzfs_impl.h b/lib/libzfs/common/libzfs_impl.h
index 576b2af5d2c2..c9b09a205024 100644
--- a/lib/libzfs/common/libzfs_impl.h
+++ b/lib/libzfs/common/libzfs_impl.h
@@ -21,11 +21,10 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
*/
-#ifndef _LIBZFS_IMPL_H
-#define _LIBZFS_IMPL_H
+#ifndef _LIBFS_IMPL_H
+#define _LIBFS_IMPL_H
#include <sys/dmu.h>
#include <sys/fs/zfs.h>
@@ -36,7 +35,6 @@
#include <libuutil.h>
#include <libzfs.h>
#include <libshare.h>
-#include <libzfs_core.h>
#include <fm/libtopo.h>
@@ -68,6 +66,7 @@ struct libzfs_handle {
int libzfs_desc_active;
char libzfs_action[1024];
char libzfs_desc[1024];
+ char *libzfs_log_str;
int libzfs_printerr;
int libzfs_storeerr; /* stuff error messages into buffer */
void *libzfs_sharehdl; /* libshare handle */
@@ -116,7 +115,7 @@ struct zpool_handle {
diskaddr_t zpool_start_block;
};
-typedef enum {
+typedef enum {
PROTO_NFS = 0,
PROTO_SMB = 1,
PROTO_END = 2
@@ -148,7 +147,6 @@ int zpool_standard_error_fmt(libzfs_handle_t *, int, const char *, ...);
int get_dependents(libzfs_handle_t *, boolean_t, const char *, char ***,
size_t *);
-zfs_handle_t *make_dataset_handle_zc(libzfs_handle_t *, zfs_cmd_t *);
int zprop_parse_value(libzfs_handle_t *, nvpair_t *, int, zfs_type_t,
@@ -213,4 +211,4 @@ extern void libzfs_fru_clear(libzfs_handle_t *, boolean_t);
}
#endif
-#endif /* _LIBZFS_IMPL_H */
+#endif /* _LIBFS_IMPL_H */
diff --git a/lib/libzfs/common/libzfs_import.c b/lib/libzfs/common/libzfs_import.c
index 414aa2f747b1..e1370350fd52 100644
--- a/lib/libzfs/common/libzfs_import.c
+++ b/lib/libzfs/common/libzfs_import.c
@@ -20,8 +20,6 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
*/
/*
@@ -439,7 +437,7 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
uint_t i, nspares, nl2cache;
boolean_t config_seen;
uint64_t best_txg;
- char *name, *hostname, *comment;
+ char *name, *hostname;
uint64_t version, guid;
uint_t children = 0;
nvlist_t **child = NULL;
@@ -528,7 +526,6 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
* version
* pool guid
* name
- * comment (if available)
* pool state
* hostid (if available)
* hostname (if available)
@@ -550,24 +547,11 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
if (nvlist_add_string(config,
ZPOOL_CONFIG_POOL_NAME, name) != 0)
goto nomem;
-
- /*
- * COMMENT is optional, don't bail if it's not
- * there, instead, set it to NULL.
- */
- if (nvlist_lookup_string(tmp,
- ZPOOL_CONFIG_COMMENT, &comment) != 0)
- comment = NULL;
- else if (nvlist_add_string(config,
- ZPOOL_CONFIG_COMMENT, comment) != 0)
- goto nomem;
-
verify(nvlist_lookup_uint64(tmp,
ZPOOL_CONFIG_POOL_STATE, &state) == 0);
if (nvlist_add_uint64(config,
ZPOOL_CONFIG_POOL_STATE, state) != 0)
goto nomem;
-
hostid = 0;
if (nvlist_lookup_uint64(tmp,
ZPOOL_CONFIG_HOSTID, &hostid) == 0) {
diff --git a/lib/libzfs/common/libzfs_iter.c b/lib/libzfs/common/libzfs_iter.c
deleted file mode 100644
index be5767f542d6..000000000000
--- a/lib/libzfs/common/libzfs_iter.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <stddef.h>
-#include <libintl.h>
-#include <libzfs.h>
-
-#include "libzfs_impl.h"
-
-int
-zfs_iter_clones(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
- nvlist_t *nvl = zfs_get_clones_nvl(zhp);
- nvpair_t *pair;
-
- if (nvl == NULL)
- return (0);
-
- for (pair = nvlist_next_nvpair(nvl, NULL); pair != NULL;
- pair = nvlist_next_nvpair(nvl, pair)) {
- zfs_handle_t *clone = zfs_open(zhp->zfs_hdl, nvpair_name(pair),
- ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
- if (clone != NULL) {
- int err = func(clone, data);
- if (err != 0)
- return (err);
- }
- }
- return (0);
-}
-
-static int
-zfs_do_list_ioctl(zfs_handle_t *zhp, int arg, zfs_cmd_t *zc)
-{
- int rc;
- uint64_t orig_cookie;
-
- orig_cookie = zc->zc_cookie;
-top:
- (void) strlcpy(zc->zc_name, zhp->zfs_name, sizeof (zc->zc_name));
- rc = ioctl(zhp->zfs_hdl->libzfs_fd, arg, zc);
-
- if (rc == -1) {
- switch (errno) {
- case ENOMEM:
- /* expand nvlist memory and try again */
- if (zcmd_expand_dst_nvlist(zhp->zfs_hdl, zc) != 0) {
- zcmd_free_nvlists(zc);
- return (-1);
- }
- zc->zc_cookie = orig_cookie;
- goto top;
- /*
- * An errno value of ESRCH indicates normal completion.
- * If ENOENT is returned, then the underlying dataset
- * has been removed since we obtained the handle.
- */
- case ESRCH:
- case ENOENT:
- rc = 1;
- break;
- default:
- rc = zfs_standard_error(zhp->zfs_hdl, errno,
- dgettext(TEXT_DOMAIN,
- "cannot iterate filesystems"));
- break;
- }
- }
- return (rc);
-}
-
-/*
- * Iterate over all child filesystems
- */
-int
-zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
- zfs_cmd_t zc = { 0 };
- zfs_handle_t *nzhp;
- int ret;
-
- if (zhp->zfs_type != ZFS_TYPE_FILESYSTEM)
- return (0);
-
- if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
- return (-1);
-
- while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_DATASET_LIST_NEXT,
- &zc)) == 0) {
- /*
- * Silently ignore errors, as the only plausible explanation is
- * that the pool has since been removed.
- */
- if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl,
- &zc)) == NULL) {
- continue;
- }
-
- if ((ret = func(nzhp, data)) != 0) {
- zcmd_free_nvlists(&zc);
- return (ret);
- }
- }
- zcmd_free_nvlists(&zc);
- return ((ret < 0) ? ret : 0);
-}
-
-/*
- * Iterate over all snapshots
- */
-int
-zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
- zfs_cmd_t zc = { 0 };
- zfs_handle_t *nzhp;
- int ret;
-
- if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT)
- return (0);
-
- if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
- return (-1);
- while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_SNAPSHOT_LIST_NEXT,
- &zc)) == 0) {
-
- if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl,
- &zc)) == NULL) {
- continue;
- }
-
- if ((ret = func(nzhp, data)) != 0) {
- zcmd_free_nvlists(&zc);
- return (ret);
- }
- }
- zcmd_free_nvlists(&zc);
- return ((ret < 0) ? ret : 0);
-}
-
-/*
- * Routines for dealing with the sorted snapshot functionality
- */
-typedef struct zfs_node {
- zfs_handle_t *zn_handle;
- avl_node_t zn_avlnode;
-} zfs_node_t;
-
-static int
-zfs_sort_snaps(zfs_handle_t *zhp, void *data)
-{
- avl_tree_t *avl = data;
- zfs_node_t *node;
- zfs_node_t search;
-
- search.zn_handle = zhp;
- node = avl_find(avl, &search, NULL);
- if (node) {
- /*
- * If this snapshot was renamed while we were creating the
- * AVL tree, it's possible that we already inserted it under
- * its old name. Remove the old handle before adding the new
- * one.
- */
- zfs_close(node->zn_handle);
- avl_remove(avl, node);
- free(node);
- }
-
- node = zfs_alloc(zhp->zfs_hdl, sizeof (zfs_node_t));
- node->zn_handle = zhp;
- avl_add(avl, node);
-
- return (0);
-}
-
-static int
-zfs_snapshot_compare(const void *larg, const void *rarg)
-{
- zfs_handle_t *l = ((zfs_node_t *)larg)->zn_handle;
- zfs_handle_t *r = ((zfs_node_t *)rarg)->zn_handle;
- uint64_t lcreate, rcreate;
-
- /*
- * Sort them according to creation time. We use the hidden
- * CREATETXG property to get an absolute ordering of snapshots.
- */
- lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG);
- rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG);
-
- if (lcreate < rcreate)
- return (-1);
- else if (lcreate > rcreate)
- return (+1);
- else
- return (0);
-}
-
-int
-zfs_iter_snapshots_sorted(zfs_handle_t *zhp, zfs_iter_f callback, void *data)
-{
- int ret = 0;
- zfs_node_t *node;
- avl_tree_t avl;
- void *cookie = NULL;
-
- avl_create(&avl, zfs_snapshot_compare,
- sizeof (zfs_node_t), offsetof(zfs_node_t, zn_avlnode));
-
- ret = zfs_iter_snapshots(zhp, zfs_sort_snaps, &avl);
-
- for (node = avl_first(&avl); node != NULL; node = AVL_NEXT(&avl, node))
- ret |= callback(node->zn_handle, data);
-
- while ((node = avl_destroy_nodes(&avl, &cookie)) != NULL)
- free(node);
-
- avl_destroy(&avl);
-
- return (ret);
-}
-
-typedef struct {
- char *ssa_first;
- char *ssa_last;
- boolean_t ssa_seenfirst;
- boolean_t ssa_seenlast;
- zfs_iter_f ssa_func;
- void *ssa_arg;
-} snapspec_arg_t;
-
-static int
-snapspec_cb(zfs_handle_t *zhp, void *arg) {
- snapspec_arg_t *ssa = arg;
- char *shortsnapname;
- int err = 0;
-
- if (ssa->ssa_seenlast)
- return (0);
- shortsnapname = zfs_strdup(zhp->zfs_hdl,
- strchr(zfs_get_name(zhp), '@') + 1);
-
- if (!ssa->ssa_seenfirst && strcmp(shortsnapname, ssa->ssa_first) == 0)
- ssa->ssa_seenfirst = B_TRUE;
-
- if (ssa->ssa_seenfirst) {
- err = ssa->ssa_func(zhp, ssa->ssa_arg);
- } else {
- zfs_close(zhp);
- }
-
- if (strcmp(shortsnapname, ssa->ssa_last) == 0)
- ssa->ssa_seenlast = B_TRUE;
- free(shortsnapname);
-
- return (err);
-}
-
-/*
- * spec is a string like "A,B%C,D"
- *
- * <snaps>, where <snaps> can be:
- * <snap> (single snapshot)
- * <snap>%<snap> (range of snapshots, inclusive)
- * %<snap> (range of snapshots, starting with earliest)
- * <snap>% (range of snapshots, ending with last)
- * % (all snapshots)
- * <snaps>[,...] (comma separated list of the above)
- *
- * If a snapshot can not be opened, continue trying to open the others, but
- * return ENOENT at the end.
- */
-int
-zfs_iter_snapspec(zfs_handle_t *fs_zhp, const char *spec_orig,
- zfs_iter_f func, void *arg)
-{
- char *buf, *comma_separated, *cp;
- int err = 0;
- int ret = 0;
-
- buf = zfs_strdup(fs_zhp->zfs_hdl, spec_orig);
- cp = buf;
-
- while ((comma_separated = strsep(&cp, ",")) != NULL) {
- char *pct = strchr(comma_separated, '%');
- if (pct != NULL) {
- snapspec_arg_t ssa = { 0 };
- ssa.ssa_func = func;
- ssa.ssa_arg = arg;
-
- if (pct == comma_separated)
- ssa.ssa_seenfirst = B_TRUE;
- else
- ssa.ssa_first = comma_separated;
- *pct = '\0';
- ssa.ssa_last = pct + 1;
-
- /*
- * If there is a lastname specified, make sure it
- * exists.
- */
- if (ssa.ssa_last[0] != '\0') {
- char snapname[ZFS_MAXNAMELEN];
- (void) snprintf(snapname, sizeof (snapname),
- "%s@%s", zfs_get_name(fs_zhp),
- ssa.ssa_last);
- if (!zfs_dataset_exists(fs_zhp->zfs_hdl,
- snapname, ZFS_TYPE_SNAPSHOT)) {
- ret = ENOENT;
- continue;
- }
- }
-
- err = zfs_iter_snapshots_sorted(fs_zhp,
- snapspec_cb, &ssa);
- if (ret == 0)
- ret = err;
- if (ret == 0 && (!ssa.ssa_seenfirst ||
- (ssa.ssa_last[0] != '\0' && !ssa.ssa_seenlast))) {
- ret = ENOENT;
- }
- } else {
- char snapname[ZFS_MAXNAMELEN];
- zfs_handle_t *snap_zhp;
- (void) snprintf(snapname, sizeof (snapname), "%s@%s",
- zfs_get_name(fs_zhp), comma_separated);
- snap_zhp = make_dataset_handle(fs_zhp->zfs_hdl,
- snapname);
- if (snap_zhp == NULL) {
- ret = ENOENT;
- continue;
- }
- err = func(snap_zhp, arg);
- if (ret == 0)
- ret = err;
- }
- }
-
- free(buf);
- return (ret);
-}
-
-/*
- * Iterate over all children, snapshots and filesystems
- */
-int
-zfs_iter_children(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
- int ret;
-
- if ((ret = zfs_iter_filesystems(zhp, func, data)) != 0)
- return (ret);
-
- return (zfs_iter_snapshots(zhp, func, data));
-}
-
-
-typedef struct iter_stack_frame {
- struct iter_stack_frame *next;
- zfs_handle_t *zhp;
-} iter_stack_frame_t;
-
-typedef struct iter_dependents_arg {
- boolean_t first;
- boolean_t allowrecursion;
- iter_stack_frame_t *stack;
- zfs_iter_f func;
- void *data;
-} iter_dependents_arg_t;
-
-static int
-iter_dependents_cb(zfs_handle_t *zhp, void *arg)
-{
- iter_dependents_arg_t *ida = arg;
- int err;
- boolean_t first = ida->first;
- ida->first = B_FALSE;
-
- if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
- err = zfs_iter_clones(zhp, iter_dependents_cb, ida);
- } else {
- iter_stack_frame_t isf;
- iter_stack_frame_t *f;
-
- /*
- * check if there is a cycle by seeing if this fs is already
- * on the stack.
- */
- for (f = ida->stack; f != NULL; f = f->next) {
- if (f->zhp->zfs_dmustats.dds_guid ==
- zhp->zfs_dmustats.dds_guid) {
- if (ida->allowrecursion) {
- zfs_close(zhp);
- return (0);
- } else {
- zfs_error_aux(zhp->zfs_hdl,
- dgettext(TEXT_DOMAIN,
- "recursive dependency at '%s'"),
- zfs_get_name(zhp));
- err = zfs_error(zhp->zfs_hdl,
- EZFS_RECURSIVE,
- dgettext(TEXT_DOMAIN,
- "cannot determine dependent "
- "datasets"));
- zfs_close(zhp);
- return (err);
- }
- }
- }
-
- isf.zhp = zhp;
- isf.next = ida->stack;
- ida->stack = &isf;
- err = zfs_iter_filesystems(zhp, iter_dependents_cb, ida);
- if (err == 0)
- err = zfs_iter_snapshots(zhp, iter_dependents_cb, ida);
- ida->stack = isf.next;
- }
- if (!first && err == 0)
- err = ida->func(zhp, ida->data);
- return (err);
-}
-
-int
-zfs_iter_dependents(zfs_handle_t *zhp, boolean_t allowrecursion,
- zfs_iter_f func, void *data)
-{
- iter_dependents_arg_t ida;
- ida.allowrecursion = allowrecursion;
- ida.stack = NULL;
- ida.func = func;
- ida.data = data;
- ida.first = B_TRUE;
- return (iter_dependents_cb(zfs_handle_dup(zhp), &ida));
-}
diff --git a/lib/libzfs/common/libzfs_pool.c b/lib/libzfs/common/libzfs_pool.c
index 1c6fb371e3bc..7df7e910ddc5 100644
--- a/lib/libzfs/common/libzfs_pool.c
+++ b/lib/libzfs/common/libzfs_pool.c
@@ -21,8 +21,6 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <ctype.h>
@@ -34,7 +32,6 @@
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
-#include <libgen.h>
#include <sys/efi_partition.h>
#include <sys/vtoc.h>
#include <sys/zfs_ioctl.h>
@@ -44,7 +41,6 @@
#include "zfs_prop.h"
#include "libzfs_impl.h"
#include "zfs_comutil.h"
-#include "zfeature_common.h"
static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
@@ -237,7 +233,6 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
case ZPOOL_PROP_ALTROOT:
case ZPOOL_PROP_CACHEFILE:
- case ZPOOL_PROP_COMMENT:
if (zhp->zpool_props != NULL ||
zpool_get_all_props(zhp) == 0) {
(void) strlcpy(buf,
@@ -275,8 +270,6 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
case ZPOOL_PROP_SIZE:
case ZPOOL_PROP_ALLOCATED:
case ZPOOL_PROP_FREE:
- case ZPOOL_PROP_FREEING:
- case ZPOOL_PROP_EXPANDSZ:
(void) zfs_nicenum(intval, buf, len);
break;
@@ -301,12 +294,6 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
(void) strlcpy(buf, zpool_state_to_name(intval,
vs->vs_aux), len);
break;
- case ZPOOL_PROP_VERSION:
- if (intval >= SPA_VERSION_FEATURES) {
- (void) snprintf(buf, len, "-");
- break;
- }
- /* FALLTHROUGH */
default:
(void) snprintf(buf, len, "%llu", intval);
}
@@ -370,8 +357,8 @@ pool_uses_efi(nvlist_t *config)
return (B_FALSE);
}
-boolean_t
-zpool_is_bootable(zpool_handle_t *zhp)
+static boolean_t
+pool_is_bootable(zpool_handle_t *zhp)
{
char bootfs[ZPOOL_MAXNAMELEN];
@@ -395,7 +382,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
zpool_prop_t prop;
char *strval;
uint64_t intval;
- char *slash, *check;
+ char *slash;
struct stat64 statbuf;
zpool_handle_t *zhp;
nvlist_t *nvroot;
@@ -409,48 +396,10 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
while ((elem = nvlist_next_nvpair(props, elem)) != NULL) {
const char *propname = nvpair_name(elem);
- prop = zpool_name_to_prop(propname);
- if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) {
- int err;
- zfeature_info_t *feature;
- char *fname = strchr(propname, '@') + 1;
-
- err = zfeature_lookup_name(fname, &feature);
- if (err != 0) {
- ASSERT3U(err, ==, ENOENT);
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "invalid feature '%s'"), fname);
- (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
- goto error;
- }
-
- if (nvpair_type(elem) != DATA_TYPE_STRING) {
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "'%s' must be a string"), propname);
- (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
- goto error;
- }
-
- (void) nvpair_value_string(elem, &strval);
- if (strcmp(strval, ZFS_FEATURE_ENABLED) != 0) {
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "property '%s' can only be set to "
- "'enabled'"), propname);
- (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
- goto error;
- }
-
- if (nvlist_add_uint64(retprops, propname, 0) != 0) {
- (void) no_memory(hdl);
- goto error;
- }
- continue;
- }
-
/*
* Make sure this property is valid and applies to this type.
*/
- if (prop == ZPROP_INVAL) {
+ if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"invalid property '%s'"), propname);
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
@@ -473,8 +422,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
*/
switch (prop) {
case ZPOOL_PROP_VERSION:
- if (intval < version ||
- !SPA_VERSION_IS_SUPPORTED(intval)) {
+ if (intval < version || intval > SPA_VERSION) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"property '%s' number %d is invalid."),
propname, intval);
@@ -593,26 +541,6 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
*slash = '/';
break;
- case ZPOOL_PROP_COMMENT:
- for (check = strval; *check != '\0'; check++) {
- if (!isprint(*check)) {
- zfs_error_aux(hdl,
- dgettext(TEXT_DOMAIN,
- "comment may only have printable "
- "characters"));
- (void) zfs_error(hdl, EZFS_BADPROP,
- errbuf);
- goto error;
- }
- }
- if (strlen(strval) > ZPROP_MAX_COMMENT) {
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "comment must not exceed %d characters"),
- ZPROP_MAX_COMMENT);
- (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
- goto error;
- }
- break;
case ZPOOL_PROP_READONLY:
if (!flags.import) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
@@ -696,77 +624,10 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
libzfs_handle_t *hdl = zhp->zpool_hdl;
zprop_list_t *entry;
char buf[ZFS_MAXPROPLEN];
- nvlist_t *features = NULL;
- zprop_list_t **last;
- boolean_t firstexpand = (NULL == *plp);
if (zprop_expand_list(hdl, plp, ZFS_TYPE_POOL) != 0)
return (-1);
- last = plp;
- while (*last != NULL)
- last = &(*last)->pl_next;
-
- if ((*plp)->pl_all)
- features = zpool_get_features(zhp);
-
- if ((*plp)->pl_all && firstexpand) {
- for (int i = 0; i < SPA_FEATURES; i++) {
- zprop_list_t *entry = zfs_alloc(hdl,
- sizeof (zprop_list_t));
- entry->pl_prop = ZPROP_INVAL;
- entry->pl_user_prop = zfs_asprintf(hdl, "feature@%s",
- spa_feature_table[i].fi_uname);
- entry->pl_width = strlen(entry->pl_user_prop);
- entry->pl_all = B_TRUE;
-
- *last = entry;
- last = &entry->pl_next;
- }
- }
-
- /* add any unsupported features */
- for (nvpair_t *nvp = nvlist_next_nvpair(features, NULL);
- nvp != NULL; nvp = nvlist_next_nvpair(features, nvp)) {
- char *propname;
- boolean_t found;
- zprop_list_t *entry;
-
- if (zfeature_is_supported(nvpair_name(nvp)))
- continue;
-
- propname = zfs_asprintf(hdl, "unsupported@%s",
- nvpair_name(nvp));
-
- /*
- * Before adding the property to the list make sure that no
- * other pool already added the same property.
- */
- found = B_FALSE;
- entry = *plp;
- while (entry != NULL) {
- if (entry->pl_user_prop != NULL &&
- strcmp(propname, entry->pl_user_prop) == 0) {
- found = B_TRUE;
- break;
- }
- entry = entry->pl_next;
- }
- if (found) {
- free(propname);
- continue;
- }
-
- entry = zfs_alloc(hdl, sizeof (zprop_list_t));
- entry->pl_prop = ZPROP_INVAL;
- entry->pl_user_prop = propname;
- entry->pl_width = strlen(entry->pl_user_prop);
- entry->pl_all = B_TRUE;
-
- *last = entry;
- last = &entry->pl_next;
- }
-
for (entry = *plp; entry != NULL; entry = entry->pl_next) {
if (entry->pl_fixed)
@@ -783,66 +644,6 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
return (0);
}
-/*
- * Get the state for the given feature on the given ZFS pool.
- */
-int
-zpool_prop_get_feature(zpool_handle_t *zhp, const char *propname, char *buf,
- size_t len)
-{
- uint64_t refcount;
- boolean_t found = B_FALSE;
- nvlist_t *features = zpool_get_features(zhp);
- boolean_t supported;
- const char *feature = strchr(propname, '@') + 1;
-
- supported = zpool_prop_feature(propname);
- ASSERT(supported || zfs_prop_unsupported(propname));
-
- /*
- * Convert from feature name to feature guid. This conversion is
- * unecessary for unsupported@... properties because they already
- * use guids.
- */
- if (supported) {
- int ret;
- zfeature_info_t *fi;
-
- ret = zfeature_lookup_name(feature, &fi);
- if (ret != 0) {
- (void) strlcpy(buf, "-", len);
- return (ENOTSUP);
- }
- feature = fi->fi_guid;
- }
-
- if (nvlist_lookup_uint64(features, feature, &refcount) == 0)
- found = B_TRUE;
-
- if (supported) {
- if (!found) {
- (void) strlcpy(buf, ZFS_FEATURE_DISABLED, len);
- } else {
- if (refcount == 0)
- (void) strlcpy(buf, ZFS_FEATURE_ENABLED, len);
- else
- (void) strlcpy(buf, ZFS_FEATURE_ACTIVE, len);
- }
- } else {
- if (found) {
- if (refcount == 0) {
- (void) strcpy(buf, ZFS_UNSUPPORTED_INACTIVE);
- } else {
- (void) strcpy(buf, ZFS_UNSUPPORTED_READONLY);
- }
- } else {
- (void) strlcpy(buf, "-", len);
- return (ENOTSUP);
- }
- }
-
- return (0);
-}
/*
* Don't start the slice at the default block of 34; many storage
@@ -1206,7 +1007,7 @@ create_failed:
* datasets left in the pool.
*/
int
-zpool_destroy(zpool_handle_t *zhp, const char *log_str)
+zpool_destroy(zpool_handle_t *zhp)
{
zfs_cmd_t zc = { 0 };
zfs_handle_t *zfp = NULL;
@@ -1218,7 +1019,6 @@ zpool_destroy(zpool_handle_t *zhp, const char *log_str)
return (-1);
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
- zc.zc_history = (uint64_t)(uintptr_t)log_str;
if (zfs_ioctl(hdl, ZFS_IOC_POOL_DESTROY, &zc) != 0) {
(void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
@@ -1271,7 +1071,7 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
return (zfs_error(hdl, EZFS_BADVERSION, msg));
}
- if (zpool_is_bootable(zhp) && nvlist_lookup_nvlist_array(nvroot,
+ if (pool_is_bootable(zhp) && nvlist_lookup_nvlist_array(nvroot,
ZPOOL_CONFIG_SPARES, &spares, &nspares) == 0) {
uint64_t s;
@@ -1373,9 +1173,8 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
* Exports the pool from the system. The caller must ensure that there are no
* mounted datasets in the pool.
*/
-static int
-zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
- const char *log_str)
+int
+zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce)
{
zfs_cmd_t zc = { 0 };
char msg[1024];
@@ -1386,7 +1185,6 @@ zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
zc.zc_cookie = force;
zc.zc_guid = hardforce;
- zc.zc_history = (uint64_t)(uintptr_t)log_str;
if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) {
switch (errno) {
@@ -1408,15 +1206,15 @@ zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
}
int
-zpool_export(zpool_handle_t *zhp, boolean_t force, const char *log_str)
+zpool_export(zpool_handle_t *zhp, boolean_t force)
{
- return (zpool_export_common(zhp, force, B_FALSE, log_str));
+ return (zpool_export_common(zhp, force, B_FALSE));
}
int
-zpool_export_force(zpool_handle_t *zhp, const char *log_str)
+zpool_export_force(zpool_handle_t *zhp)
{
- return (zpool_export_common(zhp, B_TRUE, B_TRUE, log_str));
+ return (zpool_export_common(zhp, B_TRUE, B_TRUE));
}
static void
@@ -1432,10 +1230,8 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun,
if (!hdl->libzfs_printerr || config == NULL)
return;
- if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0 ||
- nvlist_lookup_nvlist(nv, ZPOOL_CONFIG_REWIND_INFO, &nv) != 0) {
+ if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0)
return;
- }
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_LOAD_TIME, &rewindto) != 0)
return;
@@ -1491,7 +1287,6 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason,
/* All attempted rewinds failed if ZPOOL_CONFIG_LOAD_TIME missing */
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0 ||
- nvlist_lookup_nvlist(nv, ZPOOL_CONFIG_REWIND_INFO, &nv) != 0 ||
nvlist_lookup_uint64(nv, ZPOOL_CONFIG_LOAD_TIME, &rewindto) != 0)
goto no_info;
@@ -1614,30 +1409,6 @@ print_vdev_tree(libzfs_handle_t *hdl, const char *name, nvlist_t *nv,
}
}
-void
-zpool_print_unsup_feat(nvlist_t *config)
-{
- nvlist_t *nvinfo, *unsup_feat;
-
- verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nvinfo) ==
- 0);
- verify(nvlist_lookup_nvlist(nvinfo, ZPOOL_CONFIG_UNSUP_FEAT,
- &unsup_feat) == 0);
-
- for (nvpair_t *nvp = nvlist_next_nvpair(unsup_feat, NULL); nvp != NULL;
- nvp = nvlist_next_nvpair(unsup_feat, nvp)) {
- char *desc;
-
- verify(nvpair_type(nvp) == DATA_TYPE_STRING);
- verify(nvpair_value_string(nvp, &desc) == 0);
-
- if (strlen(desc) > 0)
- (void) printf("\t%s (%s)\n", nvpair_name(nvp), desc);
- else
- (void) printf("\t%s\n", nvpair_name(nvp));
- }
-}
-
/*
* Import the given pool using the known configuration and a list of
* properties to be set. The configuration should have come from
@@ -1744,22 +1515,6 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
switch (error) {
case ENOTSUP:
- if (nv != NULL && nvlist_lookup_nvlist(nv,
- ZPOOL_CONFIG_LOAD_INFO, &nvinfo) == 0 &&
- nvlist_exists(nvinfo, ZPOOL_CONFIG_UNSUP_FEAT)) {
- (void) printf(dgettext(TEXT_DOMAIN, "This "
- "pool uses the following feature(s) not "
- "supported by this system:\n"));
- zpool_print_unsup_feat(nv);
- if (nvlist_exists(nvinfo,
- ZPOOL_CONFIG_CAN_RDONLY)) {
- (void) printf(dgettext(TEXT_DOMAIN,
- "All unsupported features are only "
- "required for writing to the pool."
- "\nThe pool can be imported using "
- "'-o readonly=on'.\n"));
- }
- }
/*
* Unsupported version.
*/
@@ -2600,7 +2355,7 @@ zpool_vdev_attach(zpool_handle_t *zhp,
uint_t children;
nvlist_t *config_root;
libzfs_handle_t *hdl = zhp->zpool_hdl;
- boolean_t rootpool = zpool_is_bootable(zhp);
+ boolean_t rootpool = pool_is_bootable(zhp);
if (replacing)
(void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
@@ -3212,46 +2967,6 @@ zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid)
}
/*
- * Change the GUID for a pool.
- */
-int
-zpool_reguid(zpool_handle_t *zhp)
-{
- char msg[1024];
- libzfs_handle_t *hdl = zhp->zpool_hdl;
- zfs_cmd_t zc = { 0 };
-
- (void) snprintf(msg, sizeof (msg),
- dgettext(TEXT_DOMAIN, "cannot reguid '%s'"), zhp->zpool_name);
-
- (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
- if (zfs_ioctl(hdl, ZFS_IOC_POOL_REGUID, &zc) == 0)
- return (0);
-
- return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
- * Reopen the pool.
- */
-int
-zpool_reopen(zpool_handle_t *zhp)
-{
- zfs_cmd_t zc = { 0 };
- char msg[1024];
- libzfs_handle_t *hdl = zhp->zpool_hdl;
-
- (void) snprintf(msg, sizeof (msg),
- dgettext(TEXT_DOMAIN, "cannot reopen '%s'"),
- zhp->zpool_name);
-
- (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
- if (zfs_ioctl(hdl, ZFS_IOC_POOL_REOPEN, &zc) == 0)
- return (0);
- return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
* Convert from a devid string to a path.
*/
static char *
@@ -3578,30 +3293,40 @@ zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version)
}
void
-zfs_save_arguments(int argc, char **argv, char *string, int len)
+zpool_set_history_str(const char *subcommand, int argc, char **argv,
+ char *history_str)
{
- (void) strlcpy(string, basename(argv[0]), len);
- for (int i = 1; i < argc; i++) {
- (void) strlcat(string, " ", len);
- (void) strlcat(string, argv[i], len);
+ int i;
+
+ (void) strlcpy(history_str, subcommand, HIS_MAX_RECORD_LEN);
+ for (i = 1; i < argc; i++) {
+ if (strlen(history_str) + 1 + strlen(argv[i]) >
+ HIS_MAX_RECORD_LEN)
+ break;
+ (void) strlcat(history_str, " ", HIS_MAX_RECORD_LEN);
+ (void) strlcat(history_str, argv[i], HIS_MAX_RECORD_LEN);
}
}
+/*
+ * Stage command history for logging.
+ */
int
-zpool_log_history(libzfs_handle_t *hdl, const char *message)
+zpool_stage_history(libzfs_handle_t *hdl, const char *history_str)
{
- zfs_cmd_t zc = { 0 };
- nvlist_t *args;
- int err;
-
- args = fnvlist_alloc();
- fnvlist_add_string(args, "message", message);
- err = zcmd_write_src_nvlist(hdl, &zc, args);
- if (err == 0)
- err = ioctl(hdl->libzfs_fd, ZFS_IOC_LOG_HISTORY, &zc);
- nvlist_free(args);
- zcmd_free_nvlists(&zc);
- return (err);
+ if (history_str == NULL)
+ return (EINVAL);
+
+ if (strlen(history_str) > HIS_MAX_RECORD_LEN)
+ return (EINVAL);
+
+ if (hdl->libzfs_log_str != NULL)
+ free(hdl->libzfs_log_str);
+
+ if ((hdl->libzfs_log_str = strdup(history_str)) == NULL)
+ return (no_memory(hdl));
+
+ return (0);
}
/*
@@ -3874,7 +3599,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
if (zhp) {
nvlist_t *nvroot;
- if (zpool_is_bootable(zhp)) {
+ if (pool_is_bootable(zhp)) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"EFI labeled devices are not supported on root "
"pools."));
diff --git a/lib/libzfs/common/libzfs_sendrecv.c b/lib/libzfs/common/libzfs_sendrecv.c
index ee6e64319e40..3093ab974d06 100644
--- a/lib/libzfs/common/libzfs_sendrecv.c
+++ b/lib/libzfs/common/libzfs_sendrecv.c
@@ -21,8 +21,6 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <assert.h>
@@ -38,7 +36,6 @@
#include <sys/mount.h>
#include <pthread.h>
#include <umem.h>
-#include <time.h>
#include <libzfs.h>
@@ -53,7 +50,7 @@
/* in libzfs_dataset.c */
extern void zfs_setprop_error(libzfs_handle_t *, zfs_prop_t, int, char *);
-static int zfs_receive_impl(libzfs_handle_t *, const char *, recvflags_t *,
+static int zfs_receive_impl(libzfs_handle_t *, const char *, recvflags_t,
int, const char *, nvlist_t *, avl_tree_t *, char **, int, uint64_t *);
static const zio_cksum_t zero_cksum = { 0 };
@@ -64,12 +61,6 @@ typedef struct dedup_arg {
libzfs_handle_t *dedup_hdl;
} dedup_arg_t;
-typedef struct progress_arg {
- zfs_handle_t *pa_zhp;
- int pa_fd;
- boolean_t pa_parsable;
-} progress_arg_t;
-
typedef struct dataref {
uint64_t ref_guid;
uint64_t ref_object;
@@ -780,6 +771,88 @@ gather_nvlist(libzfs_handle_t *hdl, const char *fsname, const char *fromsnap,
}
/*
+ * Routines for dealing with the sorted snapshot functionality
+ */
+typedef struct zfs_node {
+ zfs_handle_t *zn_handle;
+ avl_node_t zn_avlnode;
+} zfs_node_t;
+
+static int
+zfs_sort_snaps(zfs_handle_t *zhp, void *data)
+{
+ avl_tree_t *avl = data;
+ zfs_node_t *node;
+ zfs_node_t search;
+
+ search.zn_handle = zhp;
+ node = avl_find(avl, &search, NULL);
+ if (node) {
+ /*
+ * If this snapshot was renamed while we were creating the
+ * AVL tree, it's possible that we already inserted it under
+ * its old name. Remove the old handle before adding the new
+ * one.
+ */
+ zfs_close(node->zn_handle);
+ avl_remove(avl, node);
+ free(node);
+ }
+
+ node = zfs_alloc(zhp->zfs_hdl, sizeof (zfs_node_t));
+ node->zn_handle = zhp;
+ avl_add(avl, node);
+
+ return (0);
+}
+
+static int
+zfs_snapshot_compare(const void *larg, const void *rarg)
+{
+ zfs_handle_t *l = ((zfs_node_t *)larg)->zn_handle;
+ zfs_handle_t *r = ((zfs_node_t *)rarg)->zn_handle;
+ uint64_t lcreate, rcreate;
+
+ /*
+ * Sort them according to creation time. We use the hidden
+ * CREATETXG property to get an absolute ordering of snapshots.
+ */
+ lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG);
+ rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG);
+
+ if (lcreate < rcreate)
+ return (-1);
+ else if (lcreate > rcreate)
+ return (+1);
+ else
+ return (0);
+}
+
+int
+zfs_iter_snapshots_sorted(zfs_handle_t *zhp, zfs_iter_f callback, void *data)
+{
+ int ret = 0;
+ zfs_node_t *node;
+ avl_tree_t avl;
+ void *cookie = NULL;
+
+ avl_create(&avl, zfs_snapshot_compare,
+ sizeof (zfs_node_t), offsetof(zfs_node_t, zn_avlnode));
+
+ ret = zfs_iter_snapshots(zhp, zfs_sort_snaps, &avl);
+
+ for (node = avl_first(&avl); node != NULL; node = AVL_NEXT(&avl, node))
+ ret |= callback(node->zn_handle, data);
+
+ while ((node = avl_destroy_nodes(&avl, &cookie)) != NULL)
+ free(node);
+
+ avl_destroy(&avl);
+
+ return (ret);
+}
+
+/*
* Routines specific to "zfs send"
*/
typedef struct send_dump_data {
@@ -789,7 +862,7 @@ typedef struct send_dump_data {
char prevsnap[ZFS_MAXNAMELEN];
uint64_t prevsnap_obj;
boolean_t seenfrom, seento, replicate, doall, fromorigin;
- boolean_t verbose, dryrun, parsable, progress;
+ boolean_t verbose;
int outfd;
boolean_t err;
nvlist_t *fss;
@@ -799,69 +872,8 @@ typedef struct send_dump_data {
nvlist_t *debugnv;
char holdtag[ZFS_MAXNAMELEN];
int cleanup_fd;
- uint64_t size;
} send_dump_data_t;
-static int
-estimate_ioctl(zfs_handle_t *zhp, uint64_t fromsnap_obj,
- boolean_t fromorigin, uint64_t *sizep)
-{
- zfs_cmd_t zc = { 0 };
- libzfs_handle_t *hdl = zhp->zfs_hdl;
-
- assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
- assert(fromsnap_obj == 0 || !fromorigin);
-
- (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
- zc.zc_obj = fromorigin;
- zc.zc_sendobj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
- zc.zc_fromobj = fromsnap_obj;
- zc.zc_guid = 1; /* estimate flag */
-
- if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND, &zc) != 0) {
- char errbuf[1024];
- (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
- "warning: cannot estimate space for '%s'"), zhp->zfs_name);
-
- switch (errno) {
- case EXDEV:
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "not an earlier snapshot from the same fs"));
- return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf));
-
- case ENOENT:
- if (zfs_dataset_exists(hdl, zc.zc_name,
- ZFS_TYPE_SNAPSHOT)) {
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "incremental source (@%s) does not exist"),
- zc.zc_value);
- }
- return (zfs_error(hdl, EZFS_NOENT, errbuf));
-
- case EDQUOT:
- case EFBIG:
- case EIO:
- case ENOLINK:
- case ENOSPC:
- case ENOSTR:
- case ENXIO:
- case EPIPE:
- case ERANGE:
- case EFAULT:
- case EROFS:
- zfs_error_aux(hdl, strerror(errno));
- return (zfs_error(hdl, EZFS_BADBACKUP, errbuf));
-
- default:
- return (zfs_standard_error(hdl, errno, errbuf));
- }
- }
-
- *sizep = zc.zc_objset_type;
-
- return (0);
-}
-
/*
* Dumps a backup of the given snapshot (incremental from fromsnap if it's not
* NULL) to the file descriptor specified by outfd.
@@ -889,7 +901,7 @@ dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj,
"fromsnap", fromsnap));
}
- if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND, &zc) != 0) {
+ if (ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_SEND, &zc) != 0) {
char errbuf[1024];
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"warning: cannot send '%s'"), zhp->zfs_name);
@@ -902,6 +914,7 @@ dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj,
nvlist_free(thisdbg);
switch (errno) {
+
case EXDEV:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"not an earlier snapshot from the same fs"));
@@ -951,9 +964,6 @@ hold_for_send(zfs_handle_t *zhp, send_dump_data_t *sdd)
assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
- if (sdd->dryrun)
- return (0);
-
/*
* zfs_send() only opens a cleanup_fd for sends that need it,
* e.g. replication and doall.
@@ -981,63 +991,13 @@ hold_for_send(zfs_handle_t *zhp, send_dump_data_t *sdd)
return (error);
}
-static void *
-send_progress_thread(void *arg)
-{
- progress_arg_t *pa = arg;
-
- zfs_cmd_t zc = { 0 };
- zfs_handle_t *zhp = pa->pa_zhp;
- libzfs_handle_t *hdl = zhp->zfs_hdl;
- unsigned long long bytes;
- char buf[16];
-
- time_t t;
- struct tm *tm;
-
- assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
- (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
- if (!pa->pa_parsable)
- (void) fprintf(stderr, "TIME SENT SNAPSHOT\n");
-
- /*
- * Print the progress from ZFS_IOC_SEND_PROGRESS every second.
- */
- for (;;) {
- (void) sleep(1);
-
- zc.zc_cookie = pa->pa_fd;
- if (zfs_ioctl(hdl, ZFS_IOC_SEND_PROGRESS, &zc) != 0)
- return ((void *)-1);
-
- (void) time(&t);
- tm = localtime(&t);
- bytes = zc.zc_cookie;
-
- if (pa->pa_parsable) {
- (void) fprintf(stderr, "%02d:%02d:%02d\t%llu\t%s\n",
- tm->tm_hour, tm->tm_min, tm->tm_sec,
- bytes, zhp->zfs_name);
- } else {
- zfs_nicenum(bytes, buf, sizeof (buf));
- (void) fprintf(stderr, "%02d:%02d:%02d %5s %s\n",
- tm->tm_hour, tm->tm_min, tm->tm_sec,
- buf, zhp->zfs_name);
- }
- }
-}
-
static int
dump_snapshot(zfs_handle_t *zhp, void *arg)
{
send_dump_data_t *sdd = arg;
- progress_arg_t pa = { 0 };
- pthread_t tid;
-
char *thissnap;
int err;
- boolean_t isfromsnap, istosnap, fromorigin;
+ boolean_t isfromsnap, istosnap;
boolean_t exclude = B_FALSE;
thissnap = strchr(zhp->zfs_name, '@') + 1;
@@ -1114,68 +1074,15 @@ dump_snapshot(zfs_handle_t *zhp, void *arg)
return (err);
}
- fromorigin = sdd->prevsnap[0] == '\0' &&
- (sdd->fromorigin || sdd->replicate);
-
+ /* send it */
if (sdd->verbose) {
- uint64_t size;
- err = estimate_ioctl(zhp, sdd->prevsnap_obj,
- fromorigin, &size);
-
- if (sdd->parsable) {
- if (sdd->prevsnap[0] != '\0') {
- (void) fprintf(stderr, "incremental\t%s\t%s",
- sdd->prevsnap, zhp->zfs_name);
- } else {
- (void) fprintf(stderr, "full\t%s",
- zhp->zfs_name);
- }
- } else {
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
- "send from @%s to %s"),
- sdd->prevsnap, zhp->zfs_name);
- }
- if (err == 0) {
- if (sdd->parsable) {
- (void) fprintf(stderr, "\t%llu\n",
- (longlong_t)size);
- } else {
- char buf[16];
- zfs_nicenum(size, buf, sizeof (buf));
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
- " estimated size is %s\n"), buf);
- }
- sdd->size += size;
- } else {
- (void) fprintf(stderr, "\n");
- }
+ (void) fprintf(stderr, "sending from @%s to %s\n",
+ sdd->prevsnap, zhp->zfs_name);
}
- if (!sdd->dryrun) {
- /*
- * If progress reporting is requested, spawn a new thread to
- * poll ZFS_IOC_SEND_PROGRESS at a regular interval.
- */
- if (sdd->progress) {
- pa.pa_zhp = zhp;
- pa.pa_fd = sdd->outfd;
- pa.pa_parsable = sdd->parsable;
-
- if (err = pthread_create(&tid, NULL,
- send_progress_thread, &pa)) {
- zfs_close(zhp);
- return (err);
- }
- }
-
- err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj,
- fromorigin, sdd->outfd, sdd->debugnv);
-
- if (sdd->progress) {
- (void) pthread_cancel(tid);
- (void) pthread_join(tid, NULL);
- }
- }
+ err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj,
+ sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate),
+ sdd->outfd, sdd->debugnv);
(void) strcpy(sdd->prevsnap, thissnap);
sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
@@ -1194,8 +1101,8 @@ dump_filesystem(zfs_handle_t *zhp, void *arg)
(void) snprintf(zc.zc_name, sizeof (zc.zc_name), "%s@%s",
zhp->zfs_name, sdd->tosnap);
if (ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0) {
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
- "WARNING: could not send %s@%s: does not exist\n"),
+ (void) fprintf(stderr, "WARNING: "
+ "could not send %s@%s: does not exist\n",
zhp->zfs_name, sdd->tosnap);
sdd->err = B_TRUE;
return (0);
@@ -1224,24 +1131,23 @@ dump_filesystem(zfs_handle_t *zhp, void *arg)
rv = zfs_iter_snapshots_sorted(zhp, dump_snapshot, arg);
if (!sdd->seenfrom) {
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
+ (void) fprintf(stderr,
"WARNING: could not send %s@%s:\n"
- "incremental source (%s@%s) does not exist\n"),
+ "incremental source (%s@%s) does not exist\n",
zhp->zfs_name, sdd->tosnap,
zhp->zfs_name, sdd->fromsnap);
sdd->err = B_TRUE;
} else if (!sdd->seento) {
if (sdd->fromsnap) {
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
+ (void) fprintf(stderr,
"WARNING: could not send %s@%s:\n"
"incremental source (%s@%s) "
- "is not earlier than it\n"),
+ "is not earlier than it\n",
zhp->zfs_name, sdd->tosnap,
zhp->zfs_name, sdd->fromsnap);
} else {
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
- "WARNING: "
- "could not send %s@%s: does not exist\n"),
+ (void) fprintf(stderr, "WARNING: "
+ "could not send %s@%s: does not exist\n",
zhp->zfs_name, sdd->tosnap);
}
sdd->err = B_TRUE;
@@ -1287,12 +1193,11 @@ again:
needagain = progress = B_FALSE;
for (fspair = nvlist_next_nvpair(sdd->fss, NULL); fspair;
fspair = nvlist_next_nvpair(sdd->fss, fspair)) {
- nvlist_t *fslist, *parent_nv;
+ nvlist_t *fslist;
char *fsname;
zfs_handle_t *zhp;
int err;
uint64_t origin_guid = 0;
- uint64_t parent_guid = 0;
VERIFY(nvpair_value_nvlist(fspair, &fslist) == 0);
if (nvlist_lookup_boolean(fslist, "sent") == 0)
@@ -1300,23 +1205,13 @@ again:
VERIFY(nvlist_lookup_string(fslist, "name", &fsname) == 0);
(void) nvlist_lookup_uint64(fslist, "origin", &origin_guid);
- (void) nvlist_lookup_uint64(fslist, "parentfromsnap",
- &parent_guid);
-
- if (parent_guid != 0) {
- parent_nv = fsavl_find(sdd->fsavl, parent_guid, NULL);
- if (!nvlist_exists(parent_nv, "sent")) {
- /* parent has not been sent; skip this one */
- needagain = B_TRUE;
- continue;
- }
- }
if (origin_guid != 0) {
nvlist_t *origin_nv = fsavl_find(sdd->fsavl,
origin_guid, NULL);
if (origin_nv != NULL &&
- !nvlist_exists(origin_nv, "sent")) {
+ nvlist_lookup_boolean(origin_nv,
+ "sent") == ENOENT) {
/*
* origin has not been sent yet;
* skip this clone.
@@ -1340,16 +1235,6 @@ again:
assert(progress);
goto again;
}
-
- /* clean out the sent flags in case we reuse this fss */
- for (fspair = nvlist_next_nvpair(sdd->fss, NULL); fspair;
- fspair = nvlist_next_nvpair(sdd->fss, fspair)) {
- nvlist_t *fslist;
-
- VERIFY(nvpair_value_nvlist(fspair, &fslist) == 0);
- (void) nvlist_remove_all(fslist, "sent");
- }
-
return (0);
}
@@ -1371,16 +1256,17 @@ again:
*/
int
zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
- sendflags_t *flags, int outfd, snapfilter_cb_t filter_func,
+ sendflags_t flags, int outfd, snapfilter_cb_t filter_func,
void *cb_arg, nvlist_t **debugnvp)
{
char errbuf[1024];
send_dump_data_t sdd = { 0 };
- int err = 0;
+ int err;
nvlist_t *fss = NULL;
avl_tree_t *fsavl = NULL;
static uint64_t holdseq;
int spa_version;
+ boolean_t holdsnaps = B_FALSE;
pthread_t tid;
int pipefd[2];
dedup_arg_t dda = { 0 };
@@ -1403,7 +1289,12 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
}
}
- if (flags->dedup && !flags->dryrun) {
+ if (zfs_spa_version(zhp, &spa_version) == 0 &&
+ spa_version >= SPA_VERSION_USERREFS &&
+ (flags.doall || flags.replicate))
+ holdsnaps = B_TRUE;
+
+ if (flags.dedup) {
featureflags |= (DMU_BACKUP_FEATURE_DEDUP |
DMU_BACKUP_FEATURE_DEDUPPROPS);
if (err = pipe(pipefd)) {
@@ -1423,13 +1314,13 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
}
}
- if (flags->replicate || flags->doall || flags->props) {
+ if (flags.replicate || flags.doall || flags.props) {
dmu_replay_record_t drr = { 0 };
char *packbuf = NULL;
size_t buflen = 0;
zio_cksum_t zc = { 0 };
- if (flags->replicate || flags->props) {
+ if (flags.replicate || flags.props) {
nvlist_t *hdrnv;
VERIFY(0 == nvlist_alloc(&hdrnv, NV_UNIQUE_NAME, 0));
@@ -1438,13 +1329,13 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
"fromsnap", fromsnap));
}
VERIFY(0 == nvlist_add_string(hdrnv, "tosnap", tosnap));
- if (!flags->replicate) {
+ if (!flags.replicate) {
VERIFY(0 == nvlist_add_boolean(hdrnv,
"not_recursive"));
}
err = gather_nvlist(zhp->zfs_hdl, zhp->zfs_name,
- fromsnap, tosnap, flags->replicate, &fss, &fsavl);
+ fromsnap, tosnap, flags.replicate, &fss, &fsavl);
if (err)
goto err_out;
VERIFY(0 == nvlist_add_nvlist(hdrnv, "fss", fss));
@@ -1461,34 +1352,33 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
}
}
- if (!flags->dryrun) {
- /* write first begin record */
- drr.drr_type = DRR_BEGIN;
- drr.drr_u.drr_begin.drr_magic = DMU_BACKUP_MAGIC;
- DMU_SET_STREAM_HDRTYPE(drr.drr_u.drr_begin.
- drr_versioninfo, DMU_COMPOUNDSTREAM);
- DMU_SET_FEATUREFLAGS(drr.drr_u.drr_begin.
- drr_versioninfo, featureflags);
- (void) snprintf(drr.drr_u.drr_begin.drr_toname,
- sizeof (drr.drr_u.drr_begin.drr_toname),
- "%s@%s", zhp->zfs_name, tosnap);
- drr.drr_payloadlen = buflen;
- err = cksum_and_write(&drr, sizeof (drr), &zc, outfd);
-
- /* write header nvlist */
- if (err != -1 && packbuf != NULL) {
- err = cksum_and_write(packbuf, buflen, &zc,
- outfd);
- }
- free(packbuf);
- if (err == -1) {
- fsavl_destroy(fsavl);
- nvlist_free(fss);
- err = errno;
- goto stderr_out;
- }
+ /* write first begin record */
+ drr.drr_type = DRR_BEGIN;
+ drr.drr_u.drr_begin.drr_magic = DMU_BACKUP_MAGIC;
+ DMU_SET_STREAM_HDRTYPE(drr.drr_u.drr_begin.drr_versioninfo,
+ DMU_COMPOUNDSTREAM);
+ DMU_SET_FEATUREFLAGS(drr.drr_u.drr_begin.drr_versioninfo,
+ featureflags);
+ (void) snprintf(drr.drr_u.drr_begin.drr_toname,
+ sizeof (drr.drr_u.drr_begin.drr_toname),
+ "%s@%s", zhp->zfs_name, tosnap);
+ drr.drr_payloadlen = buflen;
+ err = cksum_and_write(&drr, sizeof (drr), &zc, outfd);
+
+ /* write header nvlist */
+ if (err != -1 && packbuf != NULL) {
+ err = cksum_and_write(packbuf, buflen, &zc, outfd);
+ }
+ free(packbuf);
+ if (err == -1) {
+ fsavl_destroy(fsavl);
+ nvlist_free(fss);
+ err = errno;
+ goto stderr_out;
+ }
- /* write end record */
+ /* write end record */
+ if (err != -1) {
bzero(&drr, sizeof (drr));
drr.drr_type = DRR_END;
drr.drr_u.drr_end.drr_checksum = zc;
@@ -1499,43 +1389,27 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
err = errno;
goto stderr_out;
}
-
- err = 0;
}
}
/* dump each stream */
sdd.fromsnap = fromsnap;
sdd.tosnap = tosnap;
- if (flags->dedup)
+ if (flags.dedup)
sdd.outfd = pipefd[0];
else
sdd.outfd = outfd;
- sdd.replicate = flags->replicate;
- sdd.doall = flags->doall;
- sdd.fromorigin = flags->fromorigin;
+ sdd.replicate = flags.replicate;
+ sdd.doall = flags.doall;
+ sdd.fromorigin = flags.fromorigin;
sdd.fss = fss;
sdd.fsavl = fsavl;
- sdd.verbose = flags->verbose;
- sdd.parsable = flags->parsable;
- sdd.progress = flags->progress;
- sdd.dryrun = flags->dryrun;
+ sdd.verbose = flags.verbose;
sdd.filter_cb = filter_func;
sdd.filter_cb_arg = cb_arg;
if (debugnvp)
sdd.debugnv = *debugnvp;
-
- /*
- * Some flags require that we place user holds on the datasets that are
- * being sent so they don't get destroyed during the send. We can skip
- * this step if the pool is imported read-only since the datasets cannot
- * be destroyed.
- */
- if (!flags->dryrun && !zpool_get_prop_int(zfs_get_pool_handle(zhp),
- ZPOOL_PROP_READONLY, NULL) &&
- zfs_spa_version(zhp, &spa_version) == 0 &&
- spa_version >= SPA_VERSION_USERREFS &&
- (flags->doall || flags->replicate)) {
+ if (holdsnaps) {
++holdseq;
(void) snprintf(sdd.holdtag, sizeof (sdd.holdtag),
".send-%d-%llu", getpid(), (u_longlong_t)holdseq);
@@ -1547,31 +1421,11 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
} else {
sdd.cleanup_fd = -1;
}
- if (flags->verbose) {
- /*
- * Do a verbose no-op dry run to get all the verbose output
- * before generating any data. Then do a non-verbose real
- * run to generate the streams.
- */
- sdd.dryrun = B_TRUE;
- err = dump_filesystems(zhp, &sdd);
- sdd.dryrun = flags->dryrun;
- sdd.verbose = B_FALSE;
- if (flags->parsable) {
- (void) fprintf(stderr, "size\t%llu\n",
- (longlong_t)sdd.size);
- } else {
- char buf[16];
- zfs_nicenum(sdd.size, buf, sizeof (buf));
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
- "total estimated size is %s\n"), buf);
- }
- }
err = dump_filesystems(zhp, &sdd);
fsavl_destroy(fsavl);
nvlist_free(fss);
- if (flags->dedup) {
+ if (flags.dedup) {
(void) close(pipefd[0]);
(void) pthread_join(tid, NULL);
}
@@ -1581,8 +1435,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
sdd.cleanup_fd = -1;
}
- if (!flags->dryrun && (flags->replicate || flags->doall ||
- flags->props)) {
+ if (flags.replicate || flags.doall || flags.props) {
/*
* write final end record. NB: want to do this even if
* there was some error, because it might not be totally
@@ -1603,7 +1456,7 @@ stderr_out:
err_out:
if (sdd.cleanup_fd != -1)
VERIFY(0 == close(sdd.cleanup_fd));
- if (flags->dedup) {
+ if (flags.dedup) {
(void) pthread_cancel(tid);
(void) pthread_join(tid, NULL);
(void) close(pipefd[0]);
@@ -1674,7 +1527,7 @@ recv_read_nvlist(libzfs_handle_t *hdl, int fd, int len, nvlist_t **nvp,
static int
recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
- int baselen, char *newname, recvflags_t *flags)
+ int baselen, char *newname, recvflags_t flags)
{
static int seq;
zfs_cmd_t zc = { 0 };
@@ -1686,7 +1539,7 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
if (zhp == NULL)
return (-1);
clp = changelist_gather(zhp, ZFS_PROP_NAME, 0,
- flags->force ? MS_FORCE : 0);
+ flags.force ? MS_FORCE : 0);
zfs_close(zhp);
if (clp == NULL)
return (-1);
@@ -1702,7 +1555,7 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
(void) strlcpy(zc.zc_value, tryname, sizeof (zc.zc_value));
- if (flags->verbose) {
+ if (flags.verbose) {
(void) printf("attempting rename %s to %s\n",
zc.zc_name, zc.zc_value);
}
@@ -1721,19 +1574,19 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
"recv-%u-%u", getpid(), seq);
(void) strlcpy(zc.zc_value, newname, sizeof (zc.zc_value));
- if (flags->verbose) {
+ if (flags.verbose) {
(void) printf("failed - trying rename %s to %s\n",
zc.zc_name, zc.zc_value);
}
err = ioctl(hdl->libzfs_fd, ZFS_IOC_RENAME, &zc);
if (err == 0)
changelist_rename(clp, name, newname);
- if (err && flags->verbose) {
+ if (err && flags.verbose) {
(void) printf("failed (%u) - "
"will try again on next pass\n", errno);
}
err = EAGAIN;
- } else if (flags->verbose) {
+ } else if (flags.verbose) {
if (err == 0)
(void) printf("success\n");
else
@@ -1748,7 +1601,7 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
static int
recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen,
- char *newname, recvflags_t *flags)
+ char *newname, recvflags_t flags)
{
zfs_cmd_t zc = { 0 };
int err = 0;
@@ -1761,7 +1614,7 @@ recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen,
if (zhp == NULL)
return (-1);
clp = changelist_gather(zhp, ZFS_PROP_NAME, 0,
- flags->force ? MS_FORCE : 0);
+ flags.force ? MS_FORCE : 0);
if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT &&
zfs_spa_version(zhp, &spa_version) == 0 &&
spa_version >= SPA_VERSION_USERREFS)
@@ -1777,11 +1630,11 @@ recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen,
zc.zc_defer_destroy = defer;
(void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name));
- if (flags->verbose)
+ if (flags.verbose)
(void) printf("attempting destroy %s\n", zc.zc_name);
err = ioctl(hdl->libzfs_fd, ZFS_IOC_DESTROY, &zc);
if (err == 0) {
- if (flags->verbose)
+ if (flags.verbose)
(void) printf("success\n");
changelist_remove(clp, zc.zc_name);
}
@@ -1804,7 +1657,6 @@ recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen,
typedef struct guid_to_name_data {
uint64_t guid;
char *name;
- char *skip;
} guid_to_name_data_t;
static int
@@ -1813,35 +1665,21 @@ guid_to_name_cb(zfs_handle_t *zhp, void *arg)
guid_to_name_data_t *gtnd = arg;
int err;
- if (gtnd->skip != NULL &&
- strcmp(zhp->zfs_name, gtnd->skip) == 0) {
- return (0);
- }
-
if (zhp->zfs_dmustats.dds_guid == gtnd->guid) {
(void) strcpy(gtnd->name, zhp->zfs_name);
zfs_close(zhp);
return (EEXIST);
}
-
err = zfs_iter_children(zhp, guid_to_name_cb, gtnd);
zfs_close(zhp);
return (err);
}
-/*
- * Attempt to find the local dataset associated with this guid. In the case of
- * multiple matches, we attempt to find the "best" match by searching
- * progressively larger portions of the hierarchy. This allows one to send a
- * tree of datasets individually and guarantee that we will find the source
- * guid within that hierarchy, even if there are multiple matches elsewhere.
- */
static int
guid_to_name(libzfs_handle_t *hdl, const char *parent, uint64_t guid,
char *name)
{
/* exhaustive search all local snapshots */
- char pname[ZFS_MAXNAMELEN];
guid_to_name_data_t gtnd;
int err = 0;
zfs_handle_t *zhp;
@@ -1849,42 +1687,35 @@ guid_to_name(libzfs_handle_t *hdl, const char *parent, uint64_t guid,
gtnd.guid = guid;
gtnd.name = name;
- gtnd.skip = NULL;
- (void) strlcpy(pname, parent, sizeof (pname));
-
- /*
- * Search progressively larger portions of the hierarchy. This will
- * select the "most local" version of the origin snapshot in the case
- * that there are multiple matching snapshots in the system.
- */
- while ((cp = strrchr(pname, '/')) != NULL) {
+ if (strchr(parent, '@') == NULL) {
+ zhp = make_dataset_handle(hdl, parent);
+ if (zhp != NULL) {
+ err = zfs_iter_children(zhp, guid_to_name_cb, &gtnd);
+ zfs_close(zhp);
+ if (err == EEXIST)
+ return (0);
+ }
+ }
- /* Chop off the last component and open the parent */
+ cp = strchr(parent, '/');
+ if (cp)
*cp = '\0';
- zhp = make_dataset_handle(hdl, pname);
-
- if (zhp == NULL)
- continue;
+ zhp = make_dataset_handle(hdl, parent);
+ if (cp)
+ *cp = '/';
+ if (zhp) {
err = zfs_iter_children(zhp, guid_to_name_cb, &gtnd);
zfs_close(zhp);
- if (err == EEXIST)
- return (0);
-
- /*
- * Remember the dataset that we already searched, so we
- * skip it next time through.
- */
- gtnd.skip = pname;
}
- return (ENOENT);
+ return (err == EEXIST ? 0 : ENOENT);
+
}
/*
- * Return +1 if guid1 is before guid2, 0 if they are the same, and -1 if
- * guid1 is after guid2.
+ * Return true if dataset guid1 is created before guid2.
*/
static int
created_before(libzfs_handle_t *hdl, avl_tree_t *avl,
@@ -1894,8 +1725,7 @@ created_before(libzfs_handle_t *hdl, avl_tree_t *avl,
char *fsname, *snapname;
char buf[ZFS_MAXNAMELEN];
int rv;
- zfs_handle_t *guid1hdl, *guid2hdl;
- uint64_t create1, create2;
+ zfs_node_t zn1, zn2;
if (guid2 == 0)
return (0);
@@ -1905,38 +1735,30 @@ created_before(libzfs_handle_t *hdl, avl_tree_t *avl,
nvfs = fsavl_find(avl, guid1, &snapname);
VERIFY(0 == nvlist_lookup_string(nvfs, "name", &fsname));
(void) snprintf(buf, sizeof (buf), "%s@%s", fsname, snapname);
- guid1hdl = zfs_open(hdl, buf, ZFS_TYPE_SNAPSHOT);
- if (guid1hdl == NULL)
+ zn1.zn_handle = zfs_open(hdl, buf, ZFS_TYPE_SNAPSHOT);
+ if (zn1.zn_handle == NULL)
return (-1);
nvfs = fsavl_find(avl, guid2, &snapname);
VERIFY(0 == nvlist_lookup_string(nvfs, "name", &fsname));
(void) snprintf(buf, sizeof (buf), "%s@%s", fsname, snapname);
- guid2hdl = zfs_open(hdl, buf, ZFS_TYPE_SNAPSHOT);
- if (guid2hdl == NULL) {
- zfs_close(guid1hdl);
+ zn2.zn_handle = zfs_open(hdl, buf, ZFS_TYPE_SNAPSHOT);
+ if (zn2.zn_handle == NULL) {
+ zfs_close(zn2.zn_handle);
return (-1);
}
- create1 = zfs_prop_get_int(guid1hdl, ZFS_PROP_CREATETXG);
- create2 = zfs_prop_get_int(guid2hdl, ZFS_PROP_CREATETXG);
+ rv = (zfs_snapshot_compare(&zn1, &zn2) == -1);
- if (create1 < create2)
- rv = -1;
- else if (create1 > create2)
- rv = +1;
- else
- rv = 0;
-
- zfs_close(guid1hdl);
- zfs_close(guid2hdl);
+ zfs_close(zn1.zn_handle);
+ zfs_close(zn2.zn_handle);
return (rv);
}
static int
recv_incremental_replication(libzfs_handle_t *hdl, const char *tofs,
- recvflags_t *flags, nvlist_t *stream_nv, avl_tree_t *stream_avl,
+ recvflags_t flags, nvlist_t *stream_nv, avl_tree_t *stream_avl,
nvlist_t *renamed)
{
nvlist_t *local_nv;
@@ -1953,7 +1775,7 @@ recv_incremental_replication(libzfs_handle_t *hdl, const char *tofs,
recursive = (nvlist_lookup_boolean(stream_nv, "not_recursive") ==
ENOENT);
- if (flags->dryrun)
+ if (flags.dryrun)
return (0);
again:
@@ -2013,7 +1835,7 @@ again:
nvlist_t *origin_nvfs;
char *origin_fsname;
- if (flags->verbose)
+ if (flags.verbose)
(void) printf("promoting %s\n", fsname);
origin_nvfs = fsavl_find(local_avl, originguid,
@@ -2061,7 +1883,7 @@ again:
if (found == NULL) {
char name[ZFS_MAXNAMELEN];
- if (!flags->force)
+ if (!flags.force)
continue;
(void) snprintf(name, sizeof (name), "%s@%s",
@@ -2119,7 +1941,7 @@ again:
/* check for delete */
if (stream_nvfs == NULL) {
- if (!flags->force)
+ if (!flags.force)
continue;
error = recv_destroy(hdl, fsname, strlen(tofs)+1,
@@ -2132,7 +1954,7 @@ again:
}
if (fromguid == 0) {
- if (flags->verbose) {
+ if (flags.verbose) {
(void) printf("local fs %s does not have "
"fromsnap (%s in stream); must have "
"been deleted locally; ignoring\n",
@@ -2157,7 +1979,7 @@ again:
if ((stream_parent_fromsnap_guid != 0 &&
parent_fromsnap_guid != 0 &&
stream_parent_fromsnap_guid != parent_fromsnap_guid) ||
- ((flags->isprefix || strcmp(tofs, fsname) != 0) &&
+ ((flags.isprefix || strcmp(tofs, fsname) != 0) &&
(s1 != NULL) && (s2 != NULL) && strcmp(s1, s2) != 0)) {
nvlist_t *parent;
char tryname[ZFS_MAXNAMELEN];
@@ -2180,7 +2002,7 @@ again:
"%s%s", pname, strrchr(stream_fsname, '/'));
} else {
tryname[0] = '\0';
- if (flags->verbose) {
+ if (flags.verbose) {
(void) printf("local fs %s new parent "
"not found\n", fsname);
}
@@ -2208,7 +2030,7 @@ again:
if (needagain && progress) {
/* do another pass to fix up temporary names */
- if (flags->verbose)
+ if (flags.verbose)
(void) printf("another pass:\n");
goto again;
}
@@ -2218,7 +2040,7 @@ again:
static int
zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
- recvflags_t *flags, dmu_replay_record_t *drr, zio_cksum_t *zc,
+ recvflags_t flags, dmu_replay_record_t *drr, zio_cksum_t *zc,
char **top_zfs, int cleanup_fd, uint64_t *action_handlep)
{
nvlist_t *stream_nv = NULL;
@@ -2247,7 +2069,7 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
*/
if (drr->drr_payloadlen != 0) {
error = recv_read_nvlist(hdl, fd, drr->drr_payloadlen,
- &stream_nv, flags->byteswap, zc);
+ &stream_nv, flags.byteswap, zc);
if (error) {
error = zfs_error(hdl, EZFS_BADSTREAM, errbuf);
goto out;
@@ -2268,9 +2090,9 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
* Read in the end record and verify checksum.
*/
if (0 != (error = recv_read(hdl, fd, &drre, sizeof (drre),
- flags->byteswap, NULL)))
+ flags.byteswap, NULL)))
goto out;
- if (flags->byteswap) {
+ if (flags.byteswap) {
drre.drr_type = BSWAP_32(drre.drr_type);
drre.drr_u.drr_end.drr_checksum.zc_word[0] =
BSWAP_64(drre.drr_u.drr_end.drr_checksum.zc_word[0]);
@@ -2311,11 +2133,11 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
nvpair_t *pair = NULL;
(void) strlcpy(tofs, destname, ZFS_MAXNAMELEN);
- if (flags->isprefix) {
+ if (flags.isprefix) {
struct drr_begin *drrb = &drr->drr_u.drr_begin;
int i;
- if (flags->istail) {
+ if (flags.istail) {
cp = strrchr(drrb->drr_toname, '/');
if (cp == NULL) {
(void) strlcat(tofs, "/",
@@ -2333,7 +2155,7 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
*strchr(tofs, '@') = '\0';
}
- if (recursive && !flags->dryrun && !flags->nomount) {
+ if (recursive && !flags.dryrun && !flags.nomount) {
VERIFY(0 == nvlist_alloc(&renamed,
NV_UNIQUE_NAME, 0));
}
@@ -2507,7 +2329,7 @@ recv_skip(libzfs_handle_t *hdl, int fd, boolean_t byteswap)
*/
static int
zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
- recvflags_t *flags, dmu_replay_record_t *drr,
+ recvflags_t flags, dmu_replay_record_t *drr,
dmu_replay_record_t *drr_noswap, const char *sendfs,
nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd,
uint64_t *action_handlep)
@@ -2549,7 +2371,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
if (err)
VERIFY(0 == nvlist_alloc(&props, NV_UNIQUE_NAME, 0));
- if (flags->canmountoff) {
+ if (flags.canmountoff) {
VERIFY(0 == nvlist_add_uint64(props,
zfs_prop_to_name(ZFS_PROP_CANMOUNT), 0));
}
@@ -2576,7 +2398,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
* If they specified a snapshot, chop the entire name stored in
* the stream.
*/
- if (flags->istail) {
+ if (flags.istail) {
/*
* A filesystem was specified with -e. We want to tack on only
* the tail of the sent snapshot path.
@@ -2602,7 +2424,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
} else {
chopprefix = drrb->drr_toname + (chopprefix - sendfs);
}
- } else if (flags->isprefix) {
+ } else if (flags.isprefix) {
/*
* A filesystem was specified with -d. We want to tack on
* everything but the first element of the sent snapshot path
@@ -2656,7 +2478,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
* Determine the name of the origin snapshot, store in zc_string.
*/
if (drrb->drr_flags & DRR_FLAG_CLONE) {
- if (guid_to_name(hdl, zc.zc_value,
+ if (guid_to_name(hdl, tosnap,
drrb->drr_fromguid, zc.zc_string) != 0) {
zcmd_free_nvlists(&zc);
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
@@ -2664,7 +2486,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
zc.zc_value);
return (zfs_error(hdl, EZFS_NOENT, errbuf));
}
- if (flags->verbose)
+ if (flags.verbose)
(void) printf("found clone origin %s\n", zc.zc_string);
}
@@ -2687,7 +2509,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
!zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) {
char suffix[ZFS_MAXNAMELEN];
(void) strcpy(suffix, strrchr(zc.zc_value, '/'));
- if (guid_to_name(hdl, zc.zc_name, parent_snapguid,
+ if (guid_to_name(hdl, tosnap, parent_snapguid,
zc.zc_value) == 0) {
*strchr(zc.zc_value, '@') = '\0';
(void) strcat(zc.zc_value, suffix);
@@ -2709,12 +2531,12 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
* topmost path in the stream, then if the fs does not exist we
* should look no further.
*/
- if ((flags->isprefix || (*(chopprefix = drrb->drr_toname +
+ if ((flags.isprefix || (*(chopprefix = drrb->drr_toname +
strlen(sendfs)) != '\0' && *chopprefix != '@')) &&
!zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) {
char snap[ZFS_MAXNAMELEN];
(void) strcpy(snap, strchr(zc.zc_value, '@'));
- if (guid_to_name(hdl, zc.zc_name, drrb->drr_fromguid,
+ if (guid_to_name(hdl, tosnap, drrb->drr_fromguid,
zc.zc_value) == 0) {
*strchr(zc.zc_value, '@') = '\0';
(void) strcat(zc.zc_value, snap);
@@ -2736,7 +2558,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
* snapshots).
*/
if (stream_wantsnewfs) {
- if (!flags->force) {
+ if (!flags.force) {
zcmd_free_nvlists(&zc);
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"destination '%s' exists\n"
@@ -2772,7 +2594,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
return (zfs_error(hdl, EZFS_EXISTS, errbuf));
}
- if (!flags->dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM &&
+ if (!flags.dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM &&
stream_wantsnewfs) {
/* We can't do online recv in this case */
clp = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0);
@@ -2811,7 +2633,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
*/
*cp = '\0';
- if (flags->isprefix && !flags->istail && !flags->dryrun &&
+ if (flags.isprefix && !flags.istail && !flags.dryrun &&
create_parents(hdl, zc.zc_value, strlen(tosnap)) != 0) {
zcmd_free_nvlists(&zc);
return (zfs_error(hdl, EZFS_BADRESTORE, errbuf));
@@ -2822,18 +2644,18 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
zc.zc_begin_record = drr_noswap->drr_u.drr_begin;
zc.zc_cookie = infd;
- zc.zc_guid = flags->force;
- if (flags->verbose) {
+ zc.zc_guid = flags.force;
+ if (flags.verbose) {
(void) printf("%s %s stream of %s into %s\n",
- flags->dryrun ? "would receive" : "receiving",
+ flags.dryrun ? "would receive" : "receiving",
drrb->drr_fromguid ? "incremental" : "full",
drrb->drr_toname, zc.zc_value);
(void) fflush(stdout);
}
- if (flags->dryrun) {
+ if (flags.dryrun) {
zcmd_free_nvlists(&zc);
- return (recv_skip(hdl, infd, flags->byteswap));
+ return (recv_skip(hdl, infd, flags.byteswap));
}
zc.zc_nvlist_dst = (uint64_t)(uintptr_t)prop_errbuf;
@@ -2914,12 +2736,12 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
nvlist_free(local_nv);
if (fs != NULL) {
- if (flags->verbose) {
+ if (flags.verbose) {
(void) printf("snap %s already exists; "
"ignoring\n", zc.zc_value);
}
err = ioctl_err = recv_skip(hdl, infd,
- flags->byteswap);
+ flags.byteswap);
}
}
*cp = '@';
@@ -2971,7 +2793,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
case EDQUOT:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"destination %s space quota exceeded"), zc.zc_name);
- (void) zfs_error(hdl, EZFS_NOSPC, errbuf);
+ (void) zfs_error(hdl, EZFS_BADRESTORE, errbuf);
break;
default:
(void) zfs_standard_error(hdl, ioctl_errno, errbuf);
@@ -3029,7 +2851,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
*action_handlep = zc.zc_action_handle;
- if (flags->verbose) {
+ if (flags.verbose) {
char buf1[64];
char buf2[64];
uint64_t bytes = zc.zc_cookie;
@@ -3047,7 +2869,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
}
static int
-zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
+zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t flags,
int infd, const char *sendfs, nvlist_t *stream_nv, avl_tree_t *stream_avl,
char **top_zfs, int cleanup_fd, uint64_t *action_handlep)
{
@@ -3062,7 +2884,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot receive"));
- if (flags->isprefix &&
+ if (flags.isprefix &&
!zfs_dataset_exists(hdl, tosnap, ZFS_TYPE_DATASET)) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "specified fs "
"(%s) does not exist"), tosnap);
@@ -3082,7 +2904,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
/* the kernel needs the non-byteswapped begin record */
drr_noswap = drr;
- flags->byteswap = B_FALSE;
+ flags.byteswap = B_FALSE;
if (drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC)) {
/*
* We computed the checksum in the wrong byteorder in
@@ -3090,7 +2912,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
*/
bzero(&zcksum, sizeof (zio_cksum_t));
fletcher_4_incremental_byteswap(&drr, sizeof (drr), &zcksum);
- flags->byteswap = B_TRUE;
+ flags.byteswap = B_TRUE;
drr.drr_type = BSWAP_32(drr.drr_type);
drr.drr_payloadlen = BSWAP_32(drr.drr_payloadlen);
@@ -3158,7 +2980,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
* (-1 will override -2).
*/
int
-zfs_receive(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
+zfs_receive(libzfs_handle_t *hdl, const char *tosnap, recvflags_t flags,
int infd, avl_tree_t *stream_avl)
{
char *top_zfs = NULL;
@@ -3174,7 +2996,7 @@ zfs_receive(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
VERIFY(0 == close(cleanup_fd));
- if (err == 0 && !flags->nomount && top_zfs) {
+ if (err == 0 && !flags.nomount && top_zfs) {
zfs_handle_t *zhp;
prop_changelist_t *clp;
diff --git a/lib/libzfs/common/libzfs_status.c b/lib/libzfs/common/libzfs_status.c
index af0707a62058..24725ec044ec 100644
--- a/lib/libzfs/common/libzfs_status.c
+++ b/lib/libzfs/common/libzfs_status.c
@@ -18,10 +18,8 @@
*
* CDDL HEADER END
*/
-
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
*/
/*
@@ -216,20 +214,6 @@ check_status(nvlist_t *config, boolean_t isimport)
return (ZPOOL_STATUS_VERSION_NEWER);
/*
- * Unsupported feature(s).
- */
- if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
- vs->vs_aux == VDEV_AUX_UNSUP_FEAT) {
- nvlist_t *nvinfo;
-
- verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
- &nvinfo) == 0);
- if (nvlist_exists(nvinfo, ZPOOL_CONFIG_CAN_RDONLY))
- return (ZPOOL_STATUS_UNSUP_FEAT_WRITE);
- return (ZPOOL_STATUS_UNSUP_FEAT_READ);
- }
-
- /*
* Check that the config is complete.
*/
if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
@@ -316,7 +300,7 @@ check_status(nvlist_t *config, boolean_t isimport)
/*
* Outdated, but usable, version
*/
- if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION)
+ if (version < SPA_VERSION)
return (ZPOOL_STATUS_VERSION_OLDER);
return (ZPOOL_STATUS_OK);
diff --git a/lib/libzfs/common/libzfs_util.c b/lib/libzfs/common/libzfs_util.c
index 41e25e9100a0..01b7c8732efd 100644
--- a/lib/libzfs/common/libzfs_util.c
+++ b/lib/libzfs/common/libzfs_util.c
@@ -18,10 +18,8 @@
*
* CDDL HEADER END
*/
-
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
*/
/*
@@ -43,11 +41,9 @@
#include <sys/types.h>
#include <libzfs.h>
-#include <libzfs_core.h>
#include "libzfs_impl.h"
#include "zfs_prop.h"
-#include "zfeature_common.h"
int
libzfs_errno(libzfs_handle_t *hdl)
@@ -115,8 +111,7 @@ libzfs_error_description(libzfs_handle_t *hdl)
case EZFS_RESILVERING:
return (dgettext(TEXT_DOMAIN, "currently resilvering"));
case EZFS_BADVERSION:
- return (dgettext(TEXT_DOMAIN, "unsupported version or "
- "feature"));
+ return (dgettext(TEXT_DOMAIN, "unsupported version"));
case EZFS_POOLUNAVAIL:
return (dgettext(TEXT_DOMAIN, "pool is unavailable"));
case EZFS_DEVOVERFLOW:
@@ -349,7 +344,6 @@ zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
switch (error) {
case ENXIO:
case ENODEV:
- case EPIPE:
zfs_verror(hdl, EZFS_IO, fmt, ap);
break;
@@ -631,17 +625,8 @@ libzfs_init(void)
hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "r");
- if (libzfs_core_init() != 0) {
- (void) close(hdl->libzfs_fd);
- (void) fclose(hdl->libzfs_mnttab);
- (void) fclose(hdl->libzfs_sharetab);
- free(hdl);
- return (NULL);
- }
-
zfs_prop_init();
zpool_prop_init();
- zpool_feature_init();
libzfs_mnttab_init(hdl);
return (hdl);
@@ -656,11 +641,12 @@ libzfs_fini(libzfs_handle_t *hdl)
if (hdl->libzfs_sharetab)
(void) fclose(hdl->libzfs_sharetab);
zfs_uninit_libshare(hdl);
+ if (hdl->libzfs_log_str)
+ (void) free(hdl->libzfs_log_str);
zpool_free_handles(hdl);
libzfs_fru_clear(hdl, B_TRUE);
namespace_clear(hdl);
libzfs_mnttab_fini(hdl);
- libzfs_core_fini();
free(hdl);
}
@@ -822,7 +808,17 @@ zcmd_read_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc, nvlist_t **nvlp)
int
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
{
- return (ioctl(hdl->libzfs_fd, request, zc));
+ int error;
+
+ zc->zc_history = (uint64_t)(uintptr_t)hdl->libzfs_log_str;
+ error = ioctl(hdl->libzfs_fd, request, zc);
+ if (hdl->libzfs_log_str) {
+ free(hdl->libzfs_log_str);
+ hdl->libzfs_log_str = NULL;
+ }
+ zc->zc_history = 0;
+
+ return (error);
}
/*
@@ -1284,11 +1280,8 @@ addlist(libzfs_handle_t *hdl, char *propname, zprop_list_t **listp,
* this is a pool property or if this isn't a user-defined
* dataset property,
*/
- if (prop == ZPROP_INVAL && ((type == ZFS_TYPE_POOL &&
- !zpool_prop_feature(propname) &&
- !zpool_prop_unsupported(propname)) ||
- (type == ZFS_TYPE_DATASET && !zfs_prop_user(propname) &&
- !zfs_prop_userquota(propname) && !zfs_prop_written(propname)))) {
+ if (prop == ZPROP_INVAL && (type == ZFS_TYPE_POOL ||
+ (!zfs_prop_user(propname) && !zfs_prop_userquota(propname)))) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"invalid property '%s'"), propname);
return (zfs_error(hdl, EZFS_BADPROP,
@@ -1300,8 +1293,7 @@ addlist(libzfs_handle_t *hdl, char *propname, zprop_list_t **listp,
entry->pl_prop = prop;
if (prop == ZPROP_INVAL) {
- if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) ==
- NULL) {
+ if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) == NULL) {
free(entry);
return (-1);
}
diff --git a/lib/libzfs_core/common/libzfs_core.c b/lib/libzfs_core/common/libzfs_core.c
deleted file mode 100644
index 73afd50b8de2..000000000000
--- a/lib/libzfs_core/common/libzfs_core.c
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-/*
- * LibZFS_Core (lzc) is intended to replace most functionality in libzfs.
- * It has the following characteristics:
- *
- * - Thread Safe. libzfs_core is accessible concurrently from multiple
- * threads. This is accomplished primarily by avoiding global data
- * (e.g. caching). Since it's thread-safe, there is no reason for a
- * process to have multiple libzfs "instances". Therefore, we store
- * our few pieces of data (e.g. the file descriptor) in global
- * variables. The fd is reference-counted so that the libzfs_core
- * library can be "initialized" multiple times (e.g. by different
- * consumers within the same process).
- *
- * - Committed Interface. The libzfs_core interface will be committed,
- * therefore consumers can compile against it and be confident that
- * their code will continue to work on future releases of this code.
- * Currently, the interface is Evolving (not Committed), but we intend
- * to commit to it once it is more complete and we determine that it
- * meets the needs of all consumers.
- *
- * - Programatic Error Handling. libzfs_core communicates errors with
- * defined error numbers, and doesn't print anything to stdout/stderr.
- *
- * - Thin Layer. libzfs_core is a thin layer, marshaling arguments
- * to/from the kernel ioctls. There is generally a 1:1 correspondence
- * between libzfs_core functions and ioctls to /dev/zfs.
- *
- * - Clear Atomicity. Because libzfs_core functions are generally 1:1
- * with kernel ioctls, and kernel ioctls are general atomic, each
- * libzfs_core function is atomic. For example, creating multiple
- * snapshots with a single call to lzc_snapshot() is atomic -- it
- * can't fail with only some of the requested snapshots created, even
- * in the event of power loss or system crash.
- *
- * - Continued libzfs Support. Some higher-level operations (e.g.
- * support for "zfs send -R") are too complicated to fit the scope of
- * libzfs_core. This functionality will continue to live in libzfs.
- * Where appropriate, libzfs will use the underlying atomic operations
- * of libzfs_core. For example, libzfs may implement "zfs send -R |
- * zfs receive" by using individual "send one snapshot", rename,
- * destroy, and "receive one snapshot" operations in libzfs_core.
- * /sbin/zfs and /zbin/zpool will link with both libzfs and
- * libzfs_core. Other consumers should aim to use only libzfs_core,
- * since that will be the supported, stable interface going forwards.
- */
-
-#include <libzfs_core.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sys/nvpair.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/zfs_ioctl.h>
-
-static int g_fd;
-static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
-static int g_refcount;
-
-int
-libzfs_core_init(void)
-{
- (void) pthread_mutex_lock(&g_lock);
- if (g_refcount == 0) {
- g_fd = open("/dev/zfs", O_RDWR);
- if (g_fd < 0) {
- (void) pthread_mutex_unlock(&g_lock);
- return (errno);
- }
- }
- g_refcount++;
- (void) pthread_mutex_unlock(&g_lock);
- return (0);
-}
-
-void
-libzfs_core_fini(void)
-{
- (void) pthread_mutex_lock(&g_lock);
- ASSERT3S(g_refcount, >, 0);
- g_refcount--;
- if (g_refcount == 0)
- (void) close(g_fd);
- (void) pthread_mutex_unlock(&g_lock);
-}
-
-static int
-lzc_ioctl(zfs_ioc_t ioc, const char *name,
- nvlist_t *source, nvlist_t **resultp)
-{
- zfs_cmd_t zc = { 0 };
- int error = 0;
- char *packed;
- size_t size;
-
- ASSERT3S(g_refcount, >, 0);
-
- (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name));
-
- packed = fnvlist_pack(source, &size);
- zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed;
- zc.zc_nvlist_src_size = size;
-
- if (resultp != NULL) {
- zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024);
- zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
- malloc(zc.zc_nvlist_dst_size);
- if (zc.zc_nvlist_dst == NULL) {
- error = ENOMEM;
- goto out;
- }
- }
-
- while (ioctl(g_fd, ioc, &zc) != 0) {
- if (errno == ENOMEM && resultp != NULL) {
- free((void *)(uintptr_t)zc.zc_nvlist_dst);
- zc.zc_nvlist_dst_size *= 2;
- zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
- malloc(zc.zc_nvlist_dst_size);
- if (zc.zc_nvlist_dst == NULL) {
- error = ENOMEM;
- goto out;
- }
- } else {
- error = errno;
- break;
- }
- }
- if (zc.zc_nvlist_dst_filled) {
- *resultp = fnvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
- zc.zc_nvlist_dst_size);
- } else if (resultp != NULL) {
- *resultp = NULL;
- }
-
-out:
- fnvlist_pack_free(packed, size);
- free((void *)(uintptr_t)zc.zc_nvlist_dst);
- return (error);
-}
-
-int
-lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props)
-{
- int error;
- nvlist_t *args = fnvlist_alloc();
- fnvlist_add_int32(args, "type", type);
- if (props != NULL)
- fnvlist_add_nvlist(args, "props", props);
- error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL);
- nvlist_free(args);
- return (error);
-}
-
-int
-lzc_clone(const char *fsname, const char *origin,
- nvlist_t *props)
-{
- int error;
- nvlist_t *args = fnvlist_alloc();
- fnvlist_add_string(args, "origin", origin);
- if (props != NULL)
- fnvlist_add_nvlist(args, "props", props);
- error = lzc_ioctl(ZFS_IOC_CLONE, fsname, args, NULL);
- nvlist_free(args);
- return (error);
-}
-
-/*
- * Creates snapshots.
- *
- * The keys in the snaps nvlist are the snapshots to be created.
- * They must all be in the same pool.
- *
- * The props nvlist is properties to set. Currently only user properties
- * are supported. { user:prop_name -> string value }
- *
- * The returned results nvlist will have an entry for each snapshot that failed.
- * The value will be the (int32) error code.
- *
- * The return value will be 0 if all snapshots were created, otherwise it will
- * be the errno of a (undetermined) snapshot that failed.
- */
-int
-lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist)
-{
- nvpair_t *elem;
- nvlist_t *args;
- int error;
- char pool[MAXNAMELEN];
-
- *errlist = NULL;
-
- /* determine the pool name */
- elem = nvlist_next_nvpair(snaps, NULL);
- if (elem == NULL)
- return (0);
- (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
- pool[strcspn(pool, "/@")] = '\0';
-
- args = fnvlist_alloc();
- fnvlist_add_nvlist(args, "snaps", snaps);
- if (props != NULL)
- fnvlist_add_nvlist(args, "props", props);
-
- error = lzc_ioctl(ZFS_IOC_SNAPSHOT, pool, args, errlist);
- nvlist_free(args);
-
- return (error);
-}
-
-/*
- * Destroys snapshots.
- *
- * The keys in the snaps nvlist are the snapshots to be destroyed.
- * They must all be in the same pool.
- *
- * Snapshots that do not exist will be silently ignored.
- *
- * If 'defer' is not set, and a snapshot has user holds or clones, the
- * destroy operation will fail and none of the snapshots will be
- * destroyed.
- *
- * If 'defer' is set, and a snapshot has user holds or clones, it will be
- * marked for deferred destruction, and will be destroyed when the last hold
- * or clone is removed/destroyed.
- *
- * The return value will be 0 if all snapshots were destroyed (or marked for
- * later destruction if 'defer' is set) or didn't exist to begin with.
- *
- * Otherwise the return value will be the errno of a (undetermined) snapshot
- * that failed, no snapshots will be destroyed, and the errlist will have an
- * entry for each snapshot that failed. The value in the errlist will be
- * the (int32) error code.
- */
-int
-lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist)
-{
- nvpair_t *elem;
- nvlist_t *args;
- int error;
- char pool[MAXNAMELEN];
-
- /* determine the pool name */
- elem = nvlist_next_nvpair(snaps, NULL);
- if (elem == NULL)
- return (0);
- (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
- pool[strcspn(pool, "/@")] = '\0';
-
- args = fnvlist_alloc();
- fnvlist_add_nvlist(args, "snaps", snaps);
- if (defer)
- fnvlist_add_boolean(args, "defer");
-
- error = lzc_ioctl(ZFS_IOC_DESTROY_SNAPS, pool, args, errlist);
- nvlist_free(args);
-
- return (error);
-
-}
-
-int
-lzc_snaprange_space(const char *firstsnap, const char *lastsnap,
- uint64_t *usedp)
-{
- nvlist_t *args;
- nvlist_t *result;
- int err;
- char fs[MAXNAMELEN];
- char *atp;
-
- /* determine the fs name */
- (void) strlcpy(fs, firstsnap, sizeof (fs));
- atp = strchr(fs, '@');
- if (atp == NULL)
- return (EINVAL);
- *atp = '\0';
-
- args = fnvlist_alloc();
- fnvlist_add_string(args, "firstsnap", firstsnap);
-
- err = lzc_ioctl(ZFS_IOC_SPACE_SNAPS, lastsnap, args, &result);
- nvlist_free(args);
- if (err == 0)
- *usedp = fnvlist_lookup_uint64(result, "used");
- fnvlist_free(result);
-
- return (err);
-}
-
-boolean_t
-lzc_exists(const char *dataset)
-{
- /*
- * The objset_stats ioctl is still legacy, so we need to construct our
- * own zfs_cmd_t rather than using zfsc_ioctl().
- */
- zfs_cmd_t zc = { 0 };
-
- (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
- return (ioctl(g_fd, ZFS_IOC_OBJSET_STATS, &zc) == 0);
-}
-
-/*
- * If fromsnap is NULL, a full (non-incremental) stream will be sent.
- */
-int
-lzc_send(const char *snapname, const char *fromsnap, int fd)
-{
- nvlist_t *args;
- int err;
-
- args = fnvlist_alloc();
- fnvlist_add_int32(args, "fd", fd);
- if (fromsnap != NULL)
- fnvlist_add_string(args, "fromsnap", fromsnap);
- err = lzc_ioctl(ZFS_IOC_SEND_NEW, snapname, args, NULL);
- nvlist_free(args);
- return (err);
-}
-
-/*
- * If fromsnap is NULL, a full (non-incremental) stream will be estimated.
- */
-int
-lzc_send_space(const char *snapname, const char *fromsnap, uint64_t *spacep)
-{
- nvlist_t *args;
- nvlist_t *result;
- int err;
-
- args = fnvlist_alloc();
- if (fromsnap != NULL)
- fnvlist_add_string(args, "fromsnap", fromsnap);
- err = lzc_ioctl(ZFS_IOC_SEND_SPACE, snapname, args, &result);
- nvlist_free(args);
- if (err == 0)
- *spacep = fnvlist_lookup_uint64(result, "space");
- nvlist_free(result);
- return (err);
-}
-
-static int
-recv_read(int fd, void *buf, int ilen)
-{
- char *cp = buf;
- int rv;
- int len = ilen;
-
- do {
- rv = read(fd, cp, len);
- cp += rv;
- len -= rv;
- } while (rv > 0);
-
- if (rv < 0 || len != 0)
- return (EIO);
-
- return (0);
-}
-
-/*
- * The simplest receive case: receive from the specified fd, creating the
- * specified snapshot. Apply the specified properties a "received" properties
- * (which can be overridden by locally-set properties). If the stream is a
- * clone, its origin snapshot must be specified by 'origin'. The 'force'
- * flag will cause the target filesystem to be rolled back or destroyed if
- * necessary to receive.
- *
- * Return 0 on success or an errno on failure.
- *
- * Note: this interface does not work on dedup'd streams
- * (those with DMU_BACKUP_FEATURE_DEDUP).
- */
-int
-lzc_receive(const char *snapname, nvlist_t *props, const char *origin,
- boolean_t force, int fd)
-{
- /*
- * The receive ioctl is still legacy, so we need to construct our own
- * zfs_cmd_t rather than using zfsc_ioctl().
- */
- zfs_cmd_t zc = { 0 };
- char *atp;
- char *packed = NULL;
- size_t size;
- dmu_replay_record_t drr;
- int error;
-
- ASSERT3S(g_refcount, >, 0);
-
- /* zc_name is name of containing filesystem */
- (void) strlcpy(zc.zc_name, snapname, sizeof (zc.zc_name));
- atp = strchr(zc.zc_name, '@');
- if (atp == NULL)
- return (EINVAL);
- *atp = '\0';
-
- /* if the fs does not exist, try its parent. */
- if (!lzc_exists(zc.zc_name)) {
- char *slashp = strrchr(zc.zc_name, '/');
- if (slashp == NULL)
- return (ENOENT);
- *slashp = '\0';
-
- }
-
- /* zc_value is full name of the snapshot to create */
- (void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
-
- if (props != NULL) {
- /* zc_nvlist_src is props to set */
- packed = fnvlist_pack(props, &size);
- zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed;
- zc.zc_nvlist_src_size = size;
- }
-
- /* zc_string is name of clone origin (if DRR_FLAG_CLONE) */
- if (origin != NULL)
- (void) strlcpy(zc.zc_string, origin, sizeof (zc.zc_string));
-
- /* zc_begin_record is non-byteswapped BEGIN record */
- error = recv_read(fd, &drr, sizeof (drr));
- if (error != 0)
- goto out;
- zc.zc_begin_record = drr.drr_u.drr_begin;
-
- /* zc_cookie is fd to read from */
- zc.zc_cookie = fd;
-
- /* zc guid is force flag */
- zc.zc_guid = force;
-
- /* zc_cleanup_fd is unused */
- zc.zc_cleanup_fd = -1;
-
- error = ioctl(g_fd, ZFS_IOC_RECV, &zc);
- if (error != 0)
- error = errno;
-
-out:
- if (packed != NULL)
- fnvlist_pack_free(packed, size);
- free((void*)(uintptr_t)zc.zc_nvlist_dst);
- return (error);
-}
diff --git a/lib/libzfs_core/common/libzfs_core.h b/lib/libzfs_core/common/libzfs_core.h
deleted file mode 100644
index 9edc884a14d1..000000000000
--- a/lib/libzfs_core/common/libzfs_core.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-#ifndef _LIBZFS_CORE_H
-#define _LIBZFS_CORE_H
-
-#include <libnvpair.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/fs/zfs.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int libzfs_core_init(void);
-void libzfs_core_fini(void);
-
-int lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist);
-int lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props);
-int lzc_clone(const char *fsname, const char *origin, nvlist_t *props);
-int lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist);
-
-int lzc_snaprange_space(const char *firstsnap, const char *lastsnap,
- uint64_t *usedp);
-
-int lzc_send(const char *snapname, const char *fromsnap, int fd);
-int lzc_receive(const char *snapname, nvlist_t *props, const char *origin,
- boolean_t force, int fd);
-int lzc_send_space(const char *snapname, const char *fromsnap,
- uint64_t *result);
-
-boolean_t lzc_exists(const char *dataset);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _LIBZFS_CORE_H */
diff --git a/lib/libzpool/common/kernel.c b/lib/libzpool/common/kernel.c
index 04d530727f5c..f323bf60b099 100644
--- a/lib/libzpool/common/kernel.c
+++ b/lib/libzpool/common/kernel.c
@@ -20,7 +20,6 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <assert.h>
@@ -46,7 +45,6 @@ int aok;
uint64_t physmem;
vnode_t *rootdir = (vnode_t *)0xabcd1234;
char hw_serial[HW_HOSTID_LEN];
-vmem_t *zio_arena = NULL;
struct utsname utsname = {
"userland", "libzpool", "1", "1", "na"
@@ -426,9 +424,7 @@ vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset,
* To simulate partial disk writes, we split writes into two
* system calls so that the process can be killed in between.
*/
- int sectors = len >> SPA_MINBLOCKSHIFT;
- split = (sectors > 0 ? rand() % sectors : 0) <<
- SPA_MINBLOCKSHIFT;
+ split = (len > 0 ? rand() % len : 0);
iolen = pwrite64(vp->v_fd, addr, split, offset);
iolen += pwrite64(vp->v_fd, (char *)addr + split,
len - split, offset + split);
@@ -871,12 +867,6 @@ crgetuid(cred_t *cr)
return (0);
}
-uid_t
-crgetruid(cred_t *cr)
-{
- return (0);
-}
-
gid_t
crgetgid(cred_t *cr)
{
diff --git a/lib/libzpool/common/sys/zfs_context.h b/lib/libzpool/common/sys/zfs_context.h
index 39af927f7105..3b0390dca566 100644
--- a/lib/libzpool/common/sys/zfs_context.h
+++ b/lib/libzpool/common/sys/zfs_context.h
@@ -20,9 +20,6 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_ZFS_CONTEXT_H
@@ -215,7 +212,6 @@ struct proc {
};
extern struct proc p0;
-#define curproc (&p0)
#define PS_NONE -1
@@ -286,7 +282,6 @@ extern void rw_exit(krwlock_t *rwlp);
#define rw_downgrade(rwlp) do { } while (0)
extern uid_t crgetuid(cred_t *cr);
-extern uid_t crgetruid(cred_t *cr);
extern gid_t crgetgid(cred_t *cr);
extern int crgetngroups(cred_t *cr);
extern gid_t *crgetgroups(cred_t *cr);
@@ -332,12 +327,9 @@ extern void kstat_delete(kstat_t *);
#define kmem_debugging() 0
#define kmem_cache_reap_now(_c) /* nothing */
#define kmem_cache_set_move(_c, _cb) /* nothing */
-#define vmem_qcache_reap(_v) /* nothing */
#define POINTER_INVALIDATE(_pp) /* nothing */
#define POINTER_IS_VALID(_p) 0
-extern vmem_t *zio_arena;
-
typedef umem_cache_t kmem_cache_t;
typedef enum kmem_cbrc {
@@ -355,16 +347,6 @@ typedef struct taskq taskq_t;
typedef uintptr_t taskqid_t;
typedef void (task_func_t)(void *);
-typedef struct taskq_ent {
- struct taskq_ent *tqent_next;
- struct taskq_ent *tqent_prev;
- task_func_t *tqent_func;
- void *tqent_arg;
- uintptr_t tqent_flags;
-} taskq_ent_t;
-
-#define TQENT_FLAG_PREALLOC 0x1 /* taskq_dispatch_ent used */
-
#define TASKQ_PREPOPULATE 0x0001
#define TASKQ_CPR_SAFE 0x0002 /* Use CPR safe protocol */
#define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */
@@ -376,7 +358,6 @@ typedef struct taskq_ent {
#define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */
#define TQ_FRONT 0x08 /* Queue in front */
-
extern taskq_t *system_taskq;
extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t);
@@ -385,8 +366,6 @@ extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t);
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
(taskq_create(a, b, maxclsyspri, d, e, f))
extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
-extern void taskq_dispatch_ent(taskq_t *, task_func_t, void *, uint_t,
- taskq_ent_t *);
extern void taskq_destroy(taskq_t *);
extern void taskq_wait(taskq_t *);
extern int taskq_member(taskq_t *, void *);
diff --git a/lib/libzpool/common/taskq.c b/lib/libzpool/common/taskq.c
index 2c5dfd86dcc0..8db5d11c1327 100644
--- a/lib/libzpool/common/taskq.c
+++ b/lib/libzpool/common/taskq.c
@@ -22,16 +22,19 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-/*
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved.
- */
#include <sys/zfs_context.h>
int taskq_now;
taskq_t *system_taskq;
+typedef struct task {
+ struct task *task_next;
+ struct task *task_prev;
+ task_func_t *task_func;
+ void *task_arg;
+} task_t;
+
#define TASKQ_ACTIVE 0x00010000
struct taskq {
@@ -48,18 +51,18 @@ struct taskq {
int tq_maxalloc;
kcondvar_t tq_maxalloc_cv;
int tq_maxalloc_wait;
- taskq_ent_t *tq_freelist;
- taskq_ent_t tq_task;
+ task_t *tq_freelist;
+ task_t tq_task;
};
-static taskq_ent_t *
+static task_t *
task_alloc(taskq_t *tq, int tqflags)
{
- taskq_ent_t *t;
+ task_t *t;
int rv;
again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
- tq->tq_freelist = t->tqent_next;
+ tq->tq_freelist = t->task_next;
} else {
if (tq->tq_nalloc >= tq->tq_maxalloc) {
if (!(tqflags & KM_SLEEP))
@@ -84,7 +87,7 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
}
mutex_exit(&tq->tq_lock);
- t = kmem_alloc(sizeof (taskq_ent_t), tqflags);
+ t = kmem_alloc(sizeof (task_t), tqflags);
mutex_enter(&tq->tq_lock);
if (t != NULL)
@@ -94,15 +97,15 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
}
static void
-task_free(taskq_t *tq, taskq_ent_t *t)
+task_free(taskq_t *tq, task_t *t)
{
if (tq->tq_nalloc <= tq->tq_minalloc) {
- t->tqent_next = tq->tq_freelist;
+ t->task_next = tq->tq_freelist;
tq->tq_freelist = t;
} else {
tq->tq_nalloc--;
mutex_exit(&tq->tq_lock);
- kmem_free(t, sizeof (taskq_ent_t));
+ kmem_free(t, sizeof (task_t));
mutex_enter(&tq->tq_lock);
}
@@ -113,7 +116,7 @@ task_free(taskq_t *tq, taskq_ent_t *t)
taskqid_t
taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
{
- taskq_ent_t *t;
+ task_t *t;
if (taskq_now) {
func(arg);
@@ -127,59 +130,26 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
return (0);
}
if (tqflags & TQ_FRONT) {
- t->tqent_next = tq->tq_task.tqent_next;
- t->tqent_prev = &tq->tq_task;
+ t->task_next = tq->tq_task.task_next;
+ t->task_prev = &tq->tq_task;
} else {
- t->tqent_next = &tq->tq_task;
- t->tqent_prev = tq->tq_task.tqent_prev;
+ t->task_next = &tq->tq_task;
+ t->task_prev = tq->tq_task.task_prev;
}
- t->tqent_next->tqent_prev = t;
- t->tqent_prev->tqent_next = t;
- t->tqent_func = func;
- t->tqent_arg = arg;
- t->tqent_flags = 0;
+ t->task_next->task_prev = t;
+ t->task_prev->task_next = t;
+ t->task_func = func;
+ t->task_arg = arg;
cv_signal(&tq->tq_dispatch_cv);
mutex_exit(&tq->tq_lock);
return (1);
}
void
-taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags,
- taskq_ent_t *t)
-{
- ASSERT(func != NULL);
- ASSERT(!(tq->tq_flags & TASKQ_DYNAMIC));
-
- /*
- * Mark it as a prealloc'd task. This is important
- * to ensure that we don't free it later.
- */
- t->tqent_flags |= TQENT_FLAG_PREALLOC;
- /*
- * Enqueue the task to the underlying queue.
- */
- mutex_enter(&tq->tq_lock);
-
- if (flags & TQ_FRONT) {
- t->tqent_next = tq->tq_task.tqent_next;
- t->tqent_prev = &tq->tq_task;
- } else {
- t->tqent_next = &tq->tq_task;
- t->tqent_prev = tq->tq_task.tqent_prev;
- }
- t->tqent_next->tqent_prev = t;
- t->tqent_prev->tqent_next = t;
- t->tqent_func = func;
- t->tqent_arg = arg;
- cv_signal(&tq->tq_dispatch_cv);
- mutex_exit(&tq->tq_lock);
-}
-
-void
taskq_wait(taskq_t *tq)
{
mutex_enter(&tq->tq_lock);
- while (tq->tq_task.tqent_next != &tq->tq_task || tq->tq_active != 0)
+ while (tq->tq_task.task_next != &tq->tq_task || tq->tq_active != 0)
cv_wait(&tq->tq_wait_cv, &tq->tq_lock);
mutex_exit(&tq->tq_lock);
}
@@ -188,32 +158,27 @@ static void *
taskq_thread(void *arg)
{
taskq_t *tq = arg;
- taskq_ent_t *t;
- boolean_t prealloc;
+ task_t *t;
mutex_enter(&tq->tq_lock);
while (tq->tq_flags & TASKQ_ACTIVE) {
- if ((t = tq->tq_task.tqent_next) == &tq->tq_task) {
+ if ((t = tq->tq_task.task_next) == &tq->tq_task) {
if (--tq->tq_active == 0)
cv_broadcast(&tq->tq_wait_cv);
cv_wait(&tq->tq_dispatch_cv, &tq->tq_lock);
tq->tq_active++;
continue;
}
- t->tqent_prev->tqent_next = t->tqent_next;
- t->tqent_next->tqent_prev = t->tqent_prev;
- t->tqent_next = NULL;
- t->tqent_prev = NULL;
- prealloc = t->tqent_flags & TQENT_FLAG_PREALLOC;
+ t->task_prev->task_next = t->task_next;
+ t->task_next->task_prev = t->task_prev;
mutex_exit(&tq->tq_lock);
rw_enter(&tq->tq_threadlock, RW_READER);
- t->tqent_func(t->tqent_arg);
+ t->task_func(t->task_arg);
rw_exit(&tq->tq_threadlock);
mutex_enter(&tq->tq_lock);
- if (!prealloc)
- task_free(tq, t);
+ task_free(tq, t);
}
tq->tq_nthreads--;
cv_broadcast(&tq->tq_wait_cv);
@@ -252,8 +217,8 @@ taskq_create(const char *name, int nthreads, pri_t pri,
tq->tq_nthreads = nthreads;
tq->tq_minalloc = minalloc;
tq->tq_maxalloc = maxalloc;
- tq->tq_task.tqent_next = &tq->tq_task;
- tq->tq_task.tqent_prev = &tq->tq_task;
+ tq->tq_task.task_next = &tq->tq_task;
+ tq->tq_task.task_prev = &tq->tq_task;
tq->tq_threadlist = kmem_alloc(nthreads * sizeof (thread_t), KM_SLEEP);
if (flags & TASKQ_PREPOPULATE) {
diff --git a/tools/ctf/cvt/dwarf.c b/tools/ctf/cvt/dwarf.c
index ef92e384e435..a7e97dfb23a1 100644
--- a/tools/ctf/cvt/dwarf.c
+++ b/tools/ctf/cvt/dwarf.c
@@ -22,10 +22,8 @@
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-/*
- * Copyright 2012 Jason King. All rights reserved.
- * Use is subject to license terms.
- */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
/*
* DWARF to tdata conversion
@@ -364,37 +362,6 @@ die_attr_form(dwarf_t *dw, Dwarf_Attribute attr)
return (0);
}
-/*
- * the following functions lookup the value of an attribute in a DIE:
- *
- * die_signed
- * die_unsigned
- * die_bool
- * die_string
- *
- * They all take the same parameters (with the exception of valp which is
- * a pointer to the type of the attribute we are looking up):
- *
- * dw - the dwarf object to look in
- * die - the DIE we're interested in
- * name - the name of the attribute to lookup
- * valp - pointer to where the value of the attribute is placed
- * req - if the value is required (0 / non-zero)
- *
- * If the attribute is not found, one of the following happens:
- * - program terminates (req is non-zero)
- * - function returns 0
- *
- * If the value is found, and in a form (class) we can handle, the function
- * returns 1.
- *
- * Currently, we can only handle attribute values that are stored as
- * constants (immediate value). If an attribute has a form we cannot
- * handle (for example VLAs may store the dimensions of the array
- * as a DWARF expression that can compute it at runtime by reading
- * values off the stack or other locations in memory), it is treated
- * the same as if the attribute does not exist.
- */
static int
die_signed(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Signed *valp,
int req)
@@ -406,9 +373,6 @@ die_signed(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Signed *valp,
return (0); /* die_attr will terminate for us if necessary */
if (dwarf_formsdata(attr, &val, &dw->dw_err) != DW_DLV_OK) {
- if (req == 0)
- return (0);
-
terminate("die %llu: failed to get signed (form 0x%x)\n",
die_off(dw, die), die_attr_form(dw, attr));
}
@@ -430,9 +394,6 @@ die_unsigned(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Unsigned *valp,
return (0); /* die_attr will terminate for us if necessary */
if (dwarf_formudata(attr, &val, &dw->dw_err) != DW_DLV_OK) {
- if (req == 0)
- return (0);
-
terminate("die %llu: failed to get unsigned (form 0x%x)\n",
die_off(dw, die), die_attr_form(dw, attr));
}
@@ -453,9 +414,6 @@ die_bool(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Bool *valp, int req)
return (0); /* die_attr will terminate for us if necessary */
if (dwarf_formflag(attr, &val, &dw->dw_err) != DW_DLV_OK) {
- if (req == 0)
- return (0);
-
terminate("die %llu: failed to get bool (form 0x%x)\n",
die_off(dw, die), die_attr_form(dw, attr));
}
@@ -476,9 +434,6 @@ die_string(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, char **strp, int req)
return (0); /* die_attr will terminate for us if necessary */
if (dwarf_formstring(attr, &str, &dw->dw_err) != DW_DLV_OK) {
- if (req == 0)
- return (0);
-
terminate("die %llu: failed to get string (form 0x%x)\n",
die_off(dw, die), die_attr_form(dw, attr));
}
@@ -1838,27 +1793,6 @@ die_resolve(dwarf_t *dw)
} while (dw->dw_nunres != 0);
}
-/*
- * Any object containing at least one allocatable section of non-0 size is
- * taken to be a file which should contain DWARF type information
- */
-static boolean_t
-should_have_dwarf(Elf *elf)
-{
- Elf_Scn *scn = NULL;
-
- while ((scn = elf_nextscn(elf, scn)) != NULL) {
- GElf_Shdr shdr;
- gelf_getshdr(scn, &shdr);
-
- if ((shdr.sh_flags & SHF_ALLOC) &&
- (shdr.sh_size != 0))
- return (B_TRUE);
- }
-
- return (B_FALSE);
-}
-
/*ARGSUSED*/
int
dw_read(tdata_t *td, Elf *elf, const char *filename)
@@ -1882,12 +1816,8 @@ dw_read(tdata_t *td, Elf *elf, const char *filename)
if ((rc = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL, &dw.dw_dw,
&dw.dw_err)) == DW_DLV_NO_ENTRY) {
- if (should_have_dwarf(elf)) {
- errno = ENOENT;
- return (-1);
- } else {
- return (0);
- }
+ errno = ENOENT;
+ return (-1);
} else if (rc != DW_DLV_OK) {
if (dwarf_errno(dw.dw_err) == DW_DLE_DEBUG_INFO_NULL) {
/*
@@ -1902,22 +1832,11 @@ dw_read(tdata_t *td, Elf *elf, const char *filename)
}
if ((rc = dwarf_next_cu_header(dw.dw_dw, &hdrlen, &vers, &abboff,
- &addrsz, &nxthdr, &dw.dw_err)) != DW_DLV_OK)
- terminate("file does not contain valid DWARF data: %s\n",
- dwarf_errmsg(dw.dw_err));
-
- /*
- * Some compilers emit no DWARF for empty files, others emit an empty
- * compilation unit.
- */
- if ((cu = die_sibling(&dw, NULL)) == NULL ||
- ((child = die_child(&dw, cu)) == NULL) &&
- should_have_dwarf(elf)) {
+ &addrsz, &nxthdr, &dw.dw_err)) != DW_DLV_OK ||
+ (cu = die_sibling(&dw, NULL)) == NULL ||
+ (child = die_child(&dw, cu)) == NULL)
terminate("file does not contain dwarf type data "
"(try compiling with -g)\n");
- } else if (child == NULL) {
- return (0);
- }
dw.dw_maxoff = nxthdr - 1;