diff options
Diffstat (limited to 'cmd')
131 files changed, 1143 insertions, 11933 deletions
diff --git a/cmd/dtrace/dtrace.1 b/cmd/dtrace/dtrace.1 index fc71612e0f1ab..e20ed9fe6ba8b 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 f8c9ab7337d18..3c5654d88df54 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 19fc3aca51c29..261f8707c18fc 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 81a2d9bcdfd9e..095126569cc17 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 f11cf6916c52b..3f2442950bbf6 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 89ba955871acf..0000000000000 --- 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 bb0739f0d3819..5ca1f1ef93890 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 ca8ad44a621b1..396a808116299 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 ddb97c89ec1fb..50b814b1bfc16 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 9d4e40b4dbde6..0000000000000 --- 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 2c1389bdeb48f..0000000000000 --- 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 7d9c27f902d9a..0000000000000 --- 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 afaa7f976ed68..0000000000000 --- 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 9658f6a754411..0000000000000 --- 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 bee8697fb2c46..0000000000000 --- 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 1afe37dc689dc..0000000000000 --- 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 94e22577123a5..0000000000000 --- 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 2539630e9d664..0000000000000 --- 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 fd803f2ef0af2..0000000000000 --- 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 b8240d64367c2..0000000000000 --- 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 d2dc8fdbeeb63..fb41255473e6a 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 3b1999f62be75..051ab8c3c32cb 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 4527940ebf872..6fa8c35bf3b3b 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 33d058b90455a..89a0cdb95eea5 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 9f730754950bf..8a65ce6f8d66d 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 cf6d1dcece847..b6b9545d4e207 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 41a04a1394cb9..dd4a969d43551 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 141dcccb1caa3..cf24c672645e2 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 b11d2828bb7f9..0000000000000 --- 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 c8af7d920f3c8..0000000000000 --- 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 0404b4ffbdcff..0000000000000 --- 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 fd6b0e67f261d..0000000000000 --- 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 7074f5f665012..0000000000000 --- 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 ea39c7e38ca9d..0000000000000 --- 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 a1ad20f28a626..0000000000000 --- 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 46bf0e6fc206c..0000000000000 --- 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 fee786d39e0d1..0000000000000 --- 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 531ab0b6641ff..0000000000000 --- 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 126429a2996da..0000000000000 --- 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 2a9b2efdc8d1d..0000000000000 --- 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 e1045d83bdcf0..0000000000000 --- 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 9852c1ab95328..0000000000000 --- 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 c7076308446bc..0000000000000 --- 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 77b4d8a84d20b..0000000000000 --- 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 4eb9b2f06d0a7..0000000000000 --- 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 3855beb4adc21..0000000000000 --- 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 e3a6ff1a8cde5..0000000000000 --- 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 1b207bf6f2923..0000000000000 --- 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 57b6ed881b7ff..0000000000000 --- 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 9a7b288966f34..0000000000000 --- 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 b18c688bc7507..0000000000000 --- 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 ac0f3cb300e19..0000000000000 --- 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 c74d019cb1865..0000000000000 --- 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 04b0d5e1bded1..0000000000000 --- 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 7097ba7d33c7f..0000000000000 --- 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 3b1f41b218fc3..0000000000000 --- 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 e2882b3f8e3f6..0000000000000 --- 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 c6736c6fc1539..0000000000000 --- 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 f00659e57513a..0000000000000 --- 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 08885515c002c..0000000000000 --- 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 e3db03002c462..0000000000000 --- 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 941c62679b076..0000000000000 --- 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 6ca9712736acd..561f8549d9246 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 5b57805d12f5d..ec328021b3a36 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 09d984d3fa026..8a9ac6d96c5a7 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 bc29f714cbf27..494f6f8e66057 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 692a7153031b8..892ff3e24df17 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 03b6003fed3cd..8d83bddd23199 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 4a74cb050a7a6..c9ac6b1dd6a86 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 8d326ad7c107f..278ec128131c1 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 ced65849b98dc..0000000000000 --- 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 892b445613761..0000000000000 --- 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 902f07272dd06..0000000000000 --- 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 a1d3be1f62d3a..0000000000000 --- 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 9650bf7c0f5e1..0000000000000 --- 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 0702d4bb5a800..0000000000000 --- 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 ff77bb0ec74df..0000000000000 --- 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 309444d5c8d4c..0000000000000 --- 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 559dab1840c79..0000000000000 --- 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 f7e4076726ae5..0000000000000 --- 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 2fb1c41401e56..0000000000000 --- 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 b7b2108375526..0000000000000 --- 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 4c5df0a1efae1..ed375fdbf9b4c 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 a5cd18386c38d..0000000000000 --- 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 358ed92c6f836..0000000000000 --- 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 eaff59fa94dbd..0000000000000 --- 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 478307a11a2c6..69c0f84a490cd 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 fe5649da76cda..6ca823f5ddd33 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 36edf0ed39f5a..b1a3ab9de2ffc 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 d701053b68c6d..879774a42ea3b 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 c921db88b62d1..0000000000000 --- 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 8436df67353ed..0000000000000 --- 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 1eb96be529ccc..0000000000000 --- 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 554bb7dfb4df5..0000000000000 --- 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 de530e811cb14..0000000000000 --- 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 6415893b8db16..0000000000000 --- 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 ae447709ee3e3..0000000000000 --- 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 8cefb58604172..0000000000000 --- 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 3c41f66214619..291fe83fac257 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 c9bcb03e6311f..68dbb03456ccf 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 ade3a54d48a63..0a6666628fd43 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 692c8d9b5c5ba..c83d8bfa8618a 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 e950eb4af2b92..72f24ce5e30d3 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 3d50443370a9b..687e435e3fcbe 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 47ea79f376101..ba62be75a4ca2 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 9b71ac26377c6..340164847bfb6 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 79e82661927e3..9d2646cdf1fb9 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 1264e3ffb6947..9c12e6dea29e0 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 59339f766c0a6..68a8d016073c4 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 e270290e7d88a..39de8e0d81b05 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 f4679bc3f8ed4..08a1912bae845 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 5576ab81ec489..5683f47d42774 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 bbe1a4acc9a7f..ec07e057af88d 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 35d97afc4828a..01b2126c94423 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 852f5a0b3c7fa..0c8b072cb0d32 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 c0c3465e7626f..a911bcdfdfbb0 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 338dcdf03e6fa..0000000000000 --- 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 a2e5edee38145..0000000000000 --- 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 a1e939c8839f3..989d6d32aff90 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 f18c585ef6c81..0000000000000 --- 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 2f0ee33f1e29d..7fad40156a098 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 85b0e553c4699..1ebcdb95fdf25 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 07b765702cae1..7cf9004c612c3 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 f52c1c351e916..d5d9fdc4d3fd0 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 57c13d5abee44..1a7e0e12365b9 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 a06f44e42b634..cfd7a631211a2 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 d462d3f18e4d4..c6e219df9e1d7 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 1fd27c5677d87..9516697390efd 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 f4be0b2a55fbd..0000000000000 --- 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 3ecdbec9684df..8aa985b1a5526 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 63acd0c3aab81..b2d81b5588822 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)); } |