diff options
Diffstat (limited to 'cddl')
438 files changed, 5020 insertions, 1293 deletions
diff --git a/cddl/Makefile b/cddl/Makefile index 284a370c0167..c83acca43119 100644 --- a/cddl/Makefile +++ b/cddl/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc index 687068d599e8..b306a28b5c84 100644 --- a/cddl/Makefile.inc +++ b/cddl/Makefile.inc @@ -1,4 +1,3 @@ -# $FreeBSD$ OPENSOLARIS_USR_DISTDIR= ${.CURDIR}/../../../cddl/contrib/opensolaris OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris diff --git a/cddl/compat/opensolaris/include/alloca.h b/cddl/compat/opensolaris/include/alloca.h index b8433c100dc2..723115ea2af1 100644 --- a/cddl/compat/opensolaris/include/alloca.h +++ b/cddl/compat/opensolaris/include/alloca.h @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * */ #ifndef _COMPAT_OPENSOLARIS_ALLOCA_H_ diff --git a/cddl/compat/opensolaris/include/assert.h b/cddl/compat/opensolaris/include/assert.h index 0887093d5d64..5afaae7166bf 100644 --- a/cddl/compat/opensolaris/include/assert.h +++ b/cddl/compat/opensolaris/include/assert.h @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #undef assert diff --git a/cddl/compat/opensolaris/include/devid.h b/cddl/compat/opensolaris/include/devid.h index 205e461f8956..6718ce2b9fbc 100644 --- a/cddl/compat/opensolaris/include/devid.h +++ b/cddl/compat/opensolaris/include/devid.h @@ -18,8 +18,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. diff --git a/cddl/compat/opensolaris/include/dtrace.h b/cddl/compat/opensolaris/include/dtrace.h index 9630f9e74f58..7696d74a1414 100644 --- a/cddl/compat/opensolaris/include/dtrace.h +++ b/cddl/compat/opensolaris/include/dtrace.h @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * */ #ifndef _COMPAT_OPENSOLARIS_DTRACE_H_ diff --git a/cddl/compat/opensolaris/include/fcntl.h b/cddl/compat/opensolaris/include/fcntl.h index b962bb4855ee..dd1a66cbbcae 100644 --- a/cddl/compat/opensolaris/include/fcntl.h +++ b/cddl/compat/opensolaris/include/fcntl.h @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * */ #ifndef _COMPAT_OPENSOLARIS_FCNTL_H_ diff --git a/cddl/compat/opensolaris/include/fsshare.h b/cddl/compat/opensolaris/include/fsshare.h index 11a8dbf0b04d..0492006892f1 100644 --- a/cddl/compat/opensolaris/include/fsshare.h +++ b/cddl/compat/opensolaris/include/fsshare.h @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _OPENSOLARIS_FSSHARE_H_ diff --git a/cddl/compat/opensolaris/include/libintl.h b/cddl/compat/opensolaris/include/libintl.h index da13f4749081..5dbc06a75b2f 100644 --- a/cddl/compat/opensolaris/include/libintl.h +++ b/cddl/compat/opensolaris/include/libintl.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #ifndef _LIBINTL_H_ #define _LIBINTL_H_ diff --git a/cddl/compat/opensolaris/include/libproc.h b/cddl/compat/opensolaris/include/libproc.h index 428fa6cf53fe..9c153cd817e9 100644 --- a/cddl/compat/opensolaris/include/libproc.h +++ b/cddl/compat/opensolaris/include/libproc.h @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * */ #ifndef _COMPAT_OPENSOLARIS_LIBPROC_H_ @@ -35,9 +33,6 @@ #define ps_prochandle proc_handle #define Lmid_t int -#define PR_RLC 0x0001 -#define PR_KLC 0x0002 - #include_next <libproc.h> #endif diff --git a/cddl/compat/opensolaris/include/libshare.h b/cddl/compat/opensolaris/include/libshare.h index 82aacadd93a9..eb93933ed901 100644 --- a/cddl/compat/opensolaris/include/libshare.h +++ b/cddl/compat/opensolaris/include/libshare.h @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _OPENSOLARIS_LIBSHARE_H_ diff --git a/cddl/compat/opensolaris/include/priv.h b/cddl/compat/opensolaris/include/priv.h index 2fee5b0d40c8..182921a02b3f 100644 --- a/cddl/compat/opensolaris/include/priv.h +++ b/cddl/compat/opensolaris/include/priv.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #ifndef _OPENSOLARIS_PRIV_H_ #define _OPENSOLARIS_PRIV_H_ diff --git a/cddl/compat/opensolaris/include/sha2.h b/cddl/compat/opensolaris/include/sha2.h index 488f2dbd8b47..1add5365da21 100644 --- a/cddl/compat/opensolaris/include/sha2.h +++ b/cddl/compat/opensolaris/include/sha2.h @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _OPENSOLARIS_SHA2_H_ diff --git a/cddl/compat/opensolaris/include/solaris.h b/cddl/compat/opensolaris/include/solaris.h index 9bead018bcec..b4fb71be92a6 100644 --- a/cddl/compat/opensolaris/include/solaris.h +++ b/cddl/compat/opensolaris/include/solaris.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #ifndef _SOLARIS_H_ #define _SOLARIS_H_ diff --git a/cddl/compat/opensolaris/include/stdio.h b/cddl/compat/opensolaris/include/stdio.h index eba348744475..3c4f323c355f 100644 --- a/cddl/compat/opensolaris/include/stdio.h +++ b/cddl/compat/opensolaris/include/stdio.h @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * */ #ifndef _COMPAT_OPENSOLARIS_STDIO_H_ diff --git a/cddl/compat/opensolaris/include/strings.h b/cddl/compat/opensolaris/include/strings.h index a62bbc845e15..913f0214febc 100644 --- a/cddl/compat/opensolaris/include/strings.h +++ b/cddl/compat/opensolaris/include/strings.h @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * */ #ifndef _COMPAT_OPENSOLARIS_STRINGS_H_ diff --git a/cddl/compat/opensolaris/include/thread_pool.h b/cddl/compat/opensolaris/include/thread_pool.h index 3bd23a6dd2aa..3f4f74212d78 100644 --- a/cddl/compat/opensolaris/include/thread_pool.h +++ b/cddl/compat/opensolaris/include/thread_pool.h @@ -25,7 +25,6 @@ */ /* - * $FreeBSD$ */ #ifndef _THREAD_POOL_H_ diff --git a/cddl/compat/opensolaris/include/unistd.h b/cddl/compat/opensolaris/include/unistd.h index e1a1bc81e60f..48c284cfb45c 100644 --- a/cddl/compat/opensolaris/include/unistd.h +++ b/cddl/compat/opensolaris/include/unistd.h @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * */ #ifndef _COMPAT_OPENSOLARIS_UNISTD_H_ diff --git a/cddl/compat/opensolaris/include/zone.h b/cddl/compat/opensolaris/include/zone.h index 8c377cf6574d..66a041772963 100644 --- a/cddl/compat/opensolaris/include/zone.h +++ b/cddl/compat/opensolaris/include/zone.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #ifndef _ZONE_H_ #define _ZONE_H_ diff --git a/cddl/compat/opensolaris/lib/libumem/umem.c b/cddl/compat/opensolaris/lib/libumem/umem.c index 9dc101f2e65f..e9662ce3c1e8 100644 --- a/cddl/compat/opensolaris/lib/libumem/umem.c +++ b/cddl/compat/opensolaris/lib/libumem/umem.c @@ -17,8 +17,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright 2006 Ricardo Correia. All rights reserved. diff --git a/cddl/compat/opensolaris/lib/libumem/umem.h b/cddl/compat/opensolaris/lib/libumem/umem.h index da4b32fa551e..971cde36e1b2 100644 --- a/cddl/compat/opensolaris/lib/libumem/umem.h +++ b/cddl/compat/opensolaris/lib/libumem/umem.h @@ -18,8 +18,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 8724b27f4cbb..ab8c672a95a1 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 7, 2021 +.Dd September 8, 2023 .Dt DTRACE 1 .Os .Sh NAME @@ -29,7 +29,8 @@ .Sh SYNOPSIS .Nm .Op Fl 32 | Fl 64 -.Op Fl aACeFGhHlqSvVwZ +.Op Fl aACdeFGhHlOqSvVwZ +.Op Fl -libxo .Op Fl b Ar bufsz .Op Fl c Ar cmd .Op Fl D Ar name Op Ns = Ns value @@ -195,6 +196,12 @@ option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see .Fl X . +.It Fl d +Dump the D script to standard output, after syntactic transformations have been +applied. +For example, if-statements in D are implemented using such transformations: a +conditional clause in a probe body is replaced at compile-time by a separate +probe predicated on the original condition. .It Fl D Ar name Op Ns = Ns value Define .Ar name @@ -351,6 +358,11 @@ writing D programs. The specified .Ar path is added after the default library search path. +.It Fl -libxo +Generate output via +.Xr libxo 3 . +This option is the same as specifying +.Sy oformat . .It Fl m Oo Ar provider : Oc Ar module Oo Oo Ar predicate Oc Ar action Oc Specify module name to trace or list .Fl ( l @@ -394,6 +406,14 @@ argument can be suffixed with an optional D probe clause. More than one .Fl n option can be specified on the command line at a time. +.It Fl O +This option causes +.Nm +to print all the aggregations upon exiting if +.Sy oformat +or +.Fl -libxo +are specified. .It Fl o Ar output Specify the .Ar output @@ -646,6 +666,32 @@ Number of whitespace characters to use when indenting and .Fn ustack output. +.It Sy oformat Ns = Ns Ar format +Specify the format to use for output. +Setting +.Sy oformat +to +.Ql text +makes +.Nm +use regular human-readable output which is its default behavior. +The options passed to +.Sy oformat +are directly forwarded to +.Xr libxo 3 . +Some of the supported formatters include +.Ql json , +.Ql xml +and +.Ql html . +Note that this option will cause +.Nm +to not produce any output unless printing functions are explicitly called, +or the +.Fl O +flag is specified. +For more information see +.Sx STRUCTURED OUTPUT . .It Sy statusrate Ns = Ns Ar time Rate of status checking. .It Sy switchrate Ns = Ns Ar time @@ -772,6 +818,376 @@ or .Fl i options) contain descriptions that do not match any known probes. .El +.Sh STRUCTURED OUTPUT +.Nm +supports structured output using +.Xr libxo 3 . +The output will always have a top-level object called +.Dq dtrace , +followed by a list of objects +.Dq probes . +Each of the probe objects will to have a timestamp which is generated at +output time rather than probe firing time, an identifier for the CPU on +which the probe was executed, and the probe's full specification: +.Bd -literal +{ + "dtrace": { + "probes": [ + { + "timestamp": ..., + "cpu": ..., + "id": ..., + "provider": ..., + "module": ..., + "function": ..., + "name": ..., + "output": [ + ... (script-specific output) + ] + } + ] + } +} + +<?xml version="1.0"?> +<dtrace> + <probes> + <timestamp>...</timestamp> + <cpu>...</cpu> + <id>...</id> + <provider>...</provider> + <module>...</module> + <function>...</function> + <name>...</name> + <output> + ... (script-specific output) + </output> + </probes> +</dtrace> +.Ed +.Pp +It is also possible for XML output to take the following form if some +of the fields are empty (in this example, module and function values +are absent): +.Bd -literal +<?xml version="1.0"?> +<dtrace> + <probes> + ... + <module/> + <function/> + ... + <output> + ... (script-specific output) + </output> + </probes> +</dtrace> +.Ed +.Pp +Similarly, +.Sy oformat +can be used to generate HTML: +.Bd -literal +<div class="line"> +<div class="data" data-tag="timestamp">...</div> +<div class="text"></div> +<div class="data" data-tag="cpu">...</div> +<div class="text"></div> +<div class="data" data-tag="id">...</div> +<div class="text"></div> +<div class="data" data-tag="provider">...</div> +<div class="text"></div> +<div class="data" data-tag="module">...</div> +<div class="text"></div> +<div class="data" data-tag="function">...</div> +<div class="text"></div> +<div class="data" data-tag="name">...</div> +<div class="data" data-tag="... (script-specific output)">...</div> +</div> +.Ed +.Pp +Unlike JSON and XML, the +.Dq output +array is not present. +Instead, data is simply formatted into a div of class +.Dq data +and a data-tag is associated with each of the keys. +.Pp +The +.Dq output +array's contents depend on the probes' actions and is explained below. +The examples here are presented in JSON form as opposed to XML or HTML, +however the conversion explained above applies for all output formats. +.Pp +Any scalar output, such as output produced by the +.Fn trace +action is of form: +.Bd -literal +{ + "value": ... +} +.Ed +.Pp +The +.Fn printf +action begins with an object containing the formatted output of the +.Fn printf +action. +Subsequent objects contains the value of each of the arguments to +.Fn printf +in its raw form as if the +.Fn trace +action was used instead. +A +.Fn printf +statement which contains no arguments other than the message will only have +one object following the message object and its value will always be 0. +This is an artefact of the implementation and can safely be ignored. +.Bd -literal +# dtrace --libxo json,pretty -n 'BEGIN { printf("... %Y, ..", walltimestamp); }' + +{ + "message": "... 2023 Sep 7 16:49:02, .." +}, +{ + "value": 1694105342633402400 +}, +{ + ... +} +.Ed +.Pp +Scalar aggregations are aggregations which produce a single value for a given +key. +These aggregations include +.Fn count , +.Fn min , +.Fn max , +.Fn stddev +and +.Fn sum . +Each one of them is represented by the key containing their name. +For example, the output of a +.Fn stddev +aggregation will contain a key +.Dq stddev +inside an +.Dq aggregation-data +object: +.Bd -literal +{ + "aggregation-data": [ + { + "keys": [ + ... + ], + "stddev": ... + } + ], + "aggregation-name": ... +} +.Ed +.Pp +The +.Dq keys +field remains consistent across all aggregations, however +.Fn quantize , +.Fn lquantize +and +.Fn llquantize +need to be treated differently. +.Sy oformat +will create a new array of objects called +.Dq buckets . +Each of the objects contains a +.Dq value +and a +.Dq count +field which are +the left-hand side and the right-hand side of human-readable +.Nm +output respectively. +The full object has the following format: +.Bd -literal +{ + "aggregation-data": [ + ... + { + "keys": [ + ... + ], + "buckets": [ + { + "value": 32, + "count": 0 + }, + { + "value": 64, + "count": 17 + }, + ... + ], + }, + ... + ] + "aggregation-name": ... +} +.Ed +.Pp +Similar to scalar aggregations, named scalar actions such as +.Fn mod , +.Fn umod , +.Fn usym , +.Fn tracemem +and +.Fn printm +will output an object with the key being equal to the +name of the action. +For example, +.Fn printm +output would produce the following object: +.Bd -literal +{ + "printm": "0x4054171100" +} +.Ed +.Pp +.Fn sym +is slightly different. +While it will create a +.Dq sym +field which contains its value, in some cases it will also create additional +fields +.Dq object , +.Dq name +and +.Dq offset : +.Bd -literal +# dtrace -x oformat=json,pretty -On 'BEGIN { sym((uintptr_t)&`prison0); }' + +{ + "sym": "kernel`prison0", + "object": "kernel", + "name": "prison0" +} + +# dtrace --libxo json,pretty -On 'BEGIN { sym((uintptr_t)curthread); }' + +{ + "sym": "0xfffffe00c18d2000", + "offset": "0xfffffe00c18d2000" +} +.Ed +.Pp +.Fn stack +and +.Fn ustack +actions unroll each of the stack frames into its own object in an array. +The only real difference between them is that the +.Fn stack +action will produce a list called +.Dq stack-frames +while +.Fn ustack +will produce one called +.Dq ustack-frames . +The following is an example of their +.Sy oformat +output: +.Bd -literal +{ + "stack-frames": [ + { + "symbol": "dtrace.ko`dtrace_dof_create+0x35", + "module": "dtrace.ko", + "name": "dtrace_dof_create", + "offset": "0x35" + }, + { + "symbol": "dtrace.ko`dtrace_ioctl+0x81c", + "module": "dtrace.ko", + "name": "dtrace_ioctl", + "offset": "0x81c" + }, + ... + ] +} + +{ + "ustack-frames": [ + { + "symbol": "libc.so.7`ioctl+0xa", + "module": "libc.so.7", + "name": "ioctl", + "offset": "0xa" + }, + { + "symbol": "libdtrace.so.2`dtrace_go+0xf3", + "module": "libdtrace.so.2", + "name": "dtrace_go", + "offset": "0xf3" + }, + ... + ] +} +.Ed +.Pp +The +.Fn print +action produces a +.Dq type +list in the following form: +.Bd -literal +{ + "type": [ + { + "object-name": "kernel", + "name": "struct thread", + "ctfid": 2372 + }, + { + "member-name": "td_lock", + "name": "struct mtx *volatile", + "ctfid": 2035, + "value": "0xffffffff82158440" + }, + ... +} +.Ed +.Pp +If the type is invalid, a +.Dq warning +object will be produced containing the diagnostic message as well as two +possible optional fields: +.Dq type-identifier +which contains the CTF identifier of the type and +.Dq size containing the size of an integer, enum or float. +The fields generated will depend on the kind of error that was encountered +while processing the trace data. +.Pp +Finally, +.Sy oformat +provides a special pseudo-probe to represent drops. +As +.Nm +polls for various kinds of drops +.Sy oformat +will produce output similar to the following in order to represent drops: +.Bd -literal +{ + "cpu": -1, + "id": -1, + "provider": "dtrace", + "module": "INTERNAL", + "function": "INTERNAL", + "name": "DROP", + "timestamp": ..., + "count": ..., + "total": ..., + "kind": 2, + "msg": "... dynamic variable drops\n" +} +.Ed .Sh OPERANDS You can specify zero or more additional arguments on the .Nm @@ -803,11 +1219,6 @@ failed or that the specified request could not be satisfied. .It 2 Invalid command line options or arguments were specified. .El -.Sh HISTORY -The -.Nm -utility first appeared in -.Fx 7.1 . .Sh SEE ALSO .Xr cpp 1 , .Xr elf 5 , @@ -815,3 +1226,8 @@ utility first appeared in .Rs .%T Solaris Dynamic Tracing Guide .Re +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.1 . diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c index 06eff2055c17..dc68c6ef5f72 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2023, Domagoj Stolfa. All rights reserved. */ #include <sys/types.h> @@ -55,6 +56,9 @@ #include <spawn.h> #endif +#undef NORETURN /* needed because libxo redefines it */ +#include <libxo/xo.h> + typedef struct dtrace_cmd { void (*dc_func)(struct dtrace_cmd *); /* function to compile arg */ dtrace_probespec_t dc_spec; /* probe specifier context */ @@ -77,7 +81,7 @@ typedef struct dtrace_cmd { #define E_USAGE 2 static const char DTRACE_OPTSTR[] = - "3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z"; + "3:6:aAb:Bc:CdD:ef:FGhHi:I:lL:m:n:o:Op:P:qs:SU:vVwx:X:Z"; static char **g_argv; static int g_argc; @@ -130,7 +134,7 @@ usage(FILE *fp) { static const char predact[] = "[[ predicate ] action ]"; - (void) fprintf(fp, "Usage: %s [-32|-64] [-aACeFGhHlqSvVwZ] " + (void) fprintf(fp, "Usage: %s [-32|-64] [-aACdeFGhHlqSvVwZ] " "[-b bufsz] [-c cmd] [-D name[=def]]\n\t[-I path] [-L path] " "[-o output] [-p pid] [-s script] [-U name]\n\t" "[-x opt[=val]] [-X a|c|s|t]\n\n" @@ -152,6 +156,7 @@ usage(FILE *fp) "\t-b set trace buffer size\n" "\t-c run specified command and exit upon its completion\n" "\t-C run cpp(1) preprocessor on script files\n" + "\t-d dump script after syntactic transformations\n" "\t-D define symbol when invoking preprocessor\n" "\t-e exit after compiling request but prior to enabling probes\n" "\t-f enable or list probes matching the specified function name\n" @@ -166,6 +171,7 @@ usage(FILE *fp) "\t-m enable or list probes matching the specified module name\n" "\t-n enable or list probes matching the specified probe name\n" "\t-o set output file\n" + "\t-O print output upon exiting (specific to oformat)\n" "\t-p grab specified process-ID and cache its symbol tables\n" "\t-P enable or list probes matching the specified provider name\n" "\t-q set quiet mode (only output explicitly traced data)\n" @@ -906,7 +912,10 @@ errhandler(const dtrace_errdata_t *data, void *arg) static int drophandler(const dtrace_dropdata_t *data, void *arg) { - error(data->dtdda_msg); + if (!dtrace_oformat(g_dtp)) { + error(data->dtdda_msg); + } + return (DTRACE_HANDLE_OK); } @@ -1125,7 +1134,9 @@ chew(const dtrace_probedata_t *data, void *arg) } if (!g_flowindent) { - if (!g_quiet) { + if (dtrace_oformat(g_dtp)) { + dtrace_oformat_probe(g_dtp, data, cpu, pd); + } else if (!g_quiet) { char name[DTRACE_FUNCNAMELEN + DTRACE_NAMELEN + 2]; (void) snprintf(name, sizeof (name), "%s:%s", @@ -1312,7 +1323,8 @@ main(int argc, char *argv[]) g_ofp = stdout; int done = 0, mode = 0; - int err, i, c; + int err, i, c, new_argc, libxo_specified; + int print_upon_exit = 0; char *p, **v; struct ps_prochandle *P; pid_t pid; @@ -1335,6 +1347,15 @@ main(int argc, char *argv[]) (g_psv = malloc(sizeof (struct ps_prochandle *) * argc)) == NULL) fatal("failed to allocate memory for arguments"); + new_argc = xo_parse_args(argc, argv); + if (new_argc < 0) + return (usage(stderr)); + + if (new_argc != argc) + libxo_specified = 1; + + argc = new_argc; + g_argv[g_argc++] = argv[0]; /* propagate argv[0] to D as $0/$$0 */ argv[0] = g_pname; /* rewrite argv[0] for getopt errors */ @@ -1531,6 +1552,10 @@ main(int argc, char *argv[]) } else if (g_mode == DMODE_ANON) (void) dtrace_setopt(g_dtp, "linkmode", "primary"); + + if (libxo_specified) + dtrace_oformat_configure(g_dtp); + /* * Now that we have libdtrace open, make a second pass through argv[] * to perform any dtrace_setopt() calls and change any compiler flags. @@ -1559,6 +1584,10 @@ main(int argc, char *argv[]) g_cflags |= DTRACE_C_CPP; break; + case 'd': + g_cflags |= DTRACE_C_SUGAR; + break; + case 'D': if (dtrace_setopt(g_dtp, "define", optarg) != 0) dfatal("failed to set -D %s", optarg); @@ -1619,6 +1648,10 @@ main(int argc, char *argv[]) dcp->dc_arg = optarg; break; + case 'O': + print_upon_exit = 1; + break; + case 'q': if (dtrace_setopt(g_dtp, "quiet", 0) != 0) dfatal("failed to set -q"); @@ -1760,6 +1793,11 @@ main(int argc, char *argv[]) (void) dtrace_getopt(g_dtp, "quiet", &opt); g_quiet = opt != DTRACEOPT_UNSET; + if (dtrace_oformat(g_dtp)) { + if (dtrace_setopt(g_dtp, "quiet", 0) != 0) + dfatal("failed to set quiet (caused by oformat)"); + } + /* * Now make a fifth and final pass over the options that have been * turned into programs and saved in g_cmdv[], performing any mode- @@ -1772,6 +1810,9 @@ main(int argc, char *argv[]) if (g_ofile != NULL && (g_ofp = fopen(g_ofile, "a")) == NULL) fatal("failed to open output file '%s'", g_ofile); + if (dtrace_oformat(g_dtp)) + dtrace_set_outfp(g_ofp); + for (i = 0; i < g_cmdc; i++) exec_prog(&g_cmdv[i]); @@ -1806,6 +1847,9 @@ main(int argc, char *argv[]) if ((g_ofp = fopen(g_ofile, "a")) == NULL) fatal("failed to open output file '%s'", g_ofile); + if (dtrace_oformat(g_dtp)) + dtrace_set_outfp(g_ofp); + for (i = 0; i < g_cmdc; i++) { anon_prog(&g_cmdv[i], dtrace_dof_create(g_dtp, g_cmdv[i].dc_prog, 0), i); @@ -1966,12 +2010,21 @@ main(int argc, char *argv[]) g_pslive = g_psc; /* count for prochandler() */ + dtrace_oformat_setup(g_dtp); do { if (!g_intr && !done) dtrace_sleep(g_dtp); #ifdef __FreeBSD__ - if (g_siginfo) { + /* + * XXX: Supporting SIGINFO with oformat makes little sense, as + * it can't really produce sensible DTrace output. + * + * If needed, we could support it by having an imaginary + * "SIGINFO" probe that we can construct in the output but leave + * it out for now. + */ + if (g_siginfo && !dtrace_oformat(g_dtp)) { (void)dtrace_aggregate_print(g_dtp, g_ofp, NULL); g_siginfo = 0; } @@ -2008,14 +2061,24 @@ main(int argc, char *argv[]) clearerr(g_ofp); } while (!done); - oprintf("\n"); + if (!dtrace_oformat(g_dtp)) + oprintf("\n"); - if (!g_impatient) { + /* + * Since there is no way to format a probe here and machine-readable + * output makes little sense without explicitly asking for it, we print + * nothing upon Ctrl-C if oformat is specified. If the user wishes to + * get output upon exit, they must write an explicit dtrace:::END probe + * to do so. + */ + if ((!g_impatient && !dtrace_oformat(g_dtp)) || + (!g_impatient && print_upon_exit)) { if (dtrace_aggregate_print(g_dtp, g_ofp, NULL) == -1 && dtrace_errno(g_dtp) != EINTR) dfatal("failed to print aggregations"); } + dtrace_oformat_teardown(g_dtp); dtrace_close(g_dtp); return (g_status); } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out index 2e94ff35de88..7f7368f13900 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out @@ -1,6 +1,6 @@ -PING6(56=40+8+8 bytes) ::1 --> ::1 +PING(56=40+8+8 bytes) ::1 --> ::1 1 packets transmitted, 1 packets received, 0.0% packet loss 2 ip:::send (args[2]: 6 16, args[5]: 6 0 16) 2 ip:::send (args[2]: 6 16, args[5]: 6 0 16) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/kinst/tst.basic.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/kinst/tst.basic.ksh new file mode 100644 index 000000000000..3005da74c895 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/kinst/tst.basic.ksh @@ -0,0 +1,48 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2022 Mark Johnston <markj@FreeBSD.org> +# + +script() +{ + $dtrace -q -s /dev/stdin <<__EOF__ +kinst::vm_fault: {} +kinst::amd64_syscall: {} +kinst::exit1: {} +kinst::spinlock_enter: {} +kinst::memcpy: {} + +tick-10s {exit(0);} +__EOF__ +} + +spin() +{ + while true; do + ls -la / >/dev/null 2>&1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +spin & +child=$! + +script +exit $? diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh index b1cac20fc8db..6def4da1062b 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh @@ -59,7 +59,7 @@ pinger() { while true; do ping -A inet localhost - /usr/bin/sleep 1 + sleep 1 done } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh index a492124c9c17..10a83cbd06fd 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh @@ -54,7 +54,7 @@ rupper() { while true; do rup localhost - /usr/bin/sleep 1 + sleep 1 done } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.avg.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.avg.ksh new file mode 100644 index 000000000000..daf5c7f4e9bb --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.avg.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[probefunc] = avg(tid); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.count.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.count.ksh new file mode 100644 index 000000000000..ab7c5fa28471 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.count.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[execname] = count(); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.llquantize.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.llquantize.ksh new file mode 100644 index 000000000000..380335de000a --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.llquantize.ksh @@ -0,0 +1,73 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + self->ts = timestamp; +} + +syscall:::return +/self->ts/ +{ + @[probefunc] = llquantize(timestamp - self->ts, 2, 1, 32, 32); + self->ts = 0; +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.lquantize.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.lquantize.ksh new file mode 100644 index 000000000000..5ec6c725a7f0 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.lquantize.ksh @@ -0,0 +1,73 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + self->ts = timestamp; +} + +syscall:::return +/self->ts/ +{ + @[probefunc] = lquantize(timestamp - self->ts, 0, 1000000, 100); + self->ts = 0; +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.max.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.max.ksh new file mode 100644 index 000000000000..45f790aae030 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.max.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[probefunc] = max(tid); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.min.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.min.ksh new file mode 100644 index 000000000000..6f40acdfff40 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.min.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[probefunc] = min(tid); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.quantize.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.quantize.ksh new file mode 100644 index 000000000000..c0ba0f4a6c0f --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.quantize.ksh @@ -0,0 +1,73 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + self->ts = timestamp; +} + +syscall:::return +/self->ts/ +{ + @[probefunc] = quantize(timestamp - self->ts); + self->ts = 0; +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.stddev.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.stddev.ksh new file mode 100644 index 000000000000..7b06a67b9a8a --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.stddev.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[probefunc] = stddev(tid); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.sum.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.sum.ksh new file mode 100644 index 000000000000..f7c323c6baac --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.agg.sum.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[probefunc] = sum(1); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggmod.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggmod.ksh new file mode 100644 index 000000000000..335819cbcfc9 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggmod.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[mod((uintptr_t)rand())] = count(); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggstack.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggstack.ksh new file mode 100644 index 000000000000..30af498c2498 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggstack.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +fbt:::entry +{ + @[stack()] = count(); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggsym.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggsym.ksh new file mode 100644 index 000000000000..d0da3e5086ed --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggsym.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[sym((uintptr_t)rand())] = count(); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggustack.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggustack.ksh new file mode 100644 index 000000000000..98cf2a0562a4 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggustack.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[ustack()] = count(); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggusym.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggusym.ksh new file mode 100644 index 000000000000..7945b83250c3 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.aggusym.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + @[usym((uintptr_t)rand())] = count(); +} + +tick-5s +{ + exit(0); +} + +END +{ + printa(@); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.drop.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.drop.ksh new file mode 100644 index 000000000000..7f17c321ff74 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.drop.ksh @@ -0,0 +1,61 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +fbt:::entry +{ + x[timestamp] = 1; +} + +tick-5s +{ + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.mod.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.mod.ksh new file mode 100644 index 000000000000..b0e6ce3cc380 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.mod.ksh @@ -0,0 +1,57 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + mod(0); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.print.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.print.ksh new file mode 100644 index 000000000000..68d675f20329 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.print.ksh @@ -0,0 +1,60 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + print(*curthread); + print(*curthread->td_proc); + print(*curthread->td_ucred); + print(*curthread->td_ucred->cr_prison); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.printf.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.printf.ksh new file mode 100644 index 000000000000..a25352c4a1ca --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.printf.ksh @@ -0,0 +1,57 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + printf("Hello World!"); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.printm.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.printm.ksh new file mode 100644 index 000000000000..634606fa574e --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.printm.ksh @@ -0,0 +1,57 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + printm(100, memref(curthread, 10)); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.stack.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.stack.ksh new file mode 100644 index 000000000000..33d1ee6dc1d7 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.stack.ksh @@ -0,0 +1,61 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + stack(); +} + +tick-1s +{ + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.sym.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.sym.ksh new file mode 100644 index 000000000000..5e9bb3fea58e --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.sym.ksh @@ -0,0 +1,57 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + sym(0); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.trace.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.trace.ksh new file mode 100644 index 000000000000..42f714a1a500 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.trace.ksh @@ -0,0 +1,66 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + trace(0); + trace(1); + trace(2); + trace(3); + trace(4); + trace(5); + trace(6); + trace(7); + trace(8); + trace(9); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.tracemem.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.tracemem.ksh new file mode 100644 index 000000000000..dd9dbff3c191 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.tracemem.ksh @@ -0,0 +1,57 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + tracemem(curthread, 10); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.umod.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.umod.ksh new file mode 100644 index 000000000000..0d50e34dfff1 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.umod.ksh @@ -0,0 +1,57 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + umod(0); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.ustack.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.ustack.ksh new file mode 100644 index 000000000000..1b1cc0a247d3 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.ustack.ksh @@ -0,0 +1,61 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +syscall:::entry +{ + ustack(); +} + +tick-1s +{ + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.usym.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.usym.ksh new file mode 100644 index 000000000000..36372d05aa2f --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/tst.usym.ksh @@ -0,0 +1,57 @@ +#!/usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2023 Domagoj Stolfa +# + +bname=`basename $0` +dtraceout=/tmp/dtrace.$bname + +script() +{ + $dtrace -o $dtraceout.$1 -x oformat=$1 -s /dev/stdin <<__EOF__ +BEGIN +{ + usym(0); + exit(0); +} +__EOF__ +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script json +jq . $dtraceout.json + +if [ $? != 0 ]; then + echo $bname: failed to produce valid JSON. see $dtraceout.json + exit 1 +fi + +script xml +xmllint $dtraceout.xml + +if [ $? != 0 ]; then + echo $bname: failed to produce valid XML. see $dtraceout.xml + exit 1 +fi + +rm $dtraceout.json +rm $dtraceout.xml + +exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe index e360d25b465b..4985133fb2a6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe index e360d25b465b..4985133fb2a6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe index e360d25b465b..4985133fb2a6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe index e360d25b465b..4985133fb2a6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe index e360d25b465b..4985133fb2a6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe index e360d25b465b..4985133fb2a6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe index e360d25b465b..4985133fb2a6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe index ddd0f60f63ce..b9365eaafe3d 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe index 6369bc561412..9b9e2659786d 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh index 429173806f35..76996bfcb413 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh @@ -68,7 +68,7 @@ EOF sleeper() { while true; do - /usr/bin/sleep 1 + sleep 1 done } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe index 5acce76efc6c..d15d0668cfc1 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/local/bin/ksh -p # # CDDL HEADER START # diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh index 5b14fc989138..c74a278c1347 100755 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh @@ -45,7 +45,7 @@ outf=/tmp/sched.args.$$ script() { - $dtrace -c '/usr/bin/sleep 10' -o $outf -qs /dev/stdin <<EOF + $dtrace -c 'sleep 10' -o $outf -qs /dev/stdin <<EOF xdt:sched::off-cpu, xdt:sched::on-cpu, xdt:sched::block, diff --git a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 index c649e21bb67e..6c9657fa5406 100644 --- a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 +++ b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 @@ -19,8 +19,6 @@ .\" CDDL HEADER END .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. .\" -.\" $FreeBSD$ -.\" .Dd February 25, 2020 .Dt LOCKSTAT 1 .Os diff --git a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c index 2fd29843b8ce..2cbad3442efb 100644 --- a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c +++ b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c @@ -632,7 +632,7 @@ predicate_destroy(char **pred) } static void -filter_add(char **filt, char *what, uintptr_t base, uintptr_t size) +filter_add(char **filt, char *what, uintptr_t base, size_t size) { char buf[256], *c = buf, *new; int len, newlen; diff --git a/cddl/contrib/opensolaris/cmd/lockstat/sym.c b/cddl/contrib/opensolaris/cmd/lockstat/sym.c index b5366c566857..7516e7d435f4 100644 --- a/cddl/contrib/opensolaris/cmd/lockstat/sym.c +++ b/cddl/contrib/opensolaris/cmd/lockstat/sym.c @@ -42,6 +42,7 @@ #include <libelf.h> #include <link.h> #include <elf.h> +#include <gelf.h> #ifdef illumos #include <sys/machelf.h> @@ -54,7 +55,6 @@ #endif #include <sys/cpuvar.h> - typedef struct syment { uintptr_t addr; char *name; @@ -73,11 +73,6 @@ static char maxsymname[64]; #endif #endif -#define __sElfN(x) typedef __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) x -__sElfN(Sym); -__sElfN(Shdr); -#define elf_getshdr __elfN(getshdr) - static void add_symbol(char *name, uintptr_t addr, size_t size) { @@ -174,7 +169,7 @@ symtab_init(void) { Elf *elf; Elf_Scn *scn = NULL; - Sym *symtab, *symp, *lastsym; + GElf_Sym *symtab, *symp, *lastsym; char *strtab; uint_t cnt; int fd; @@ -198,13 +193,13 @@ symtab_init(void) (void) elf_version(EV_CURRENT); elf = elf_begin(fd, ELF_C_READ, NULL); - for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) { - Shdr *shdr = elf_getshdr(scn); - if (shdr->sh_type == SHT_SYMTAB) { - symtab = (Sym *)elf_getdata(scn, NULL)->d_buf; - nsyms = shdr->sh_size / shdr->sh_entsize; - strindex = shdr->sh_link; + GElf_Shdr shdr; + (void) gelf_getshdr(scn, &shdr); + if (shdr.sh_type == SHT_SYMTAB) { + symtab = (GElf_Sym *)elf_getdata(scn, NULL)->d_buf; + nsyms = shdr.sh_size / shdr.sh_entsize; + strindex = shdr.sh_link; } } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c index 5ea55a05faf0..643e7fae8ace 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c @@ -35,6 +35,7 @@ #include <unistd.h> #include <dt_impl.h> #include <assert.h> +#include <dt_oformat.h> #ifdef illumos #include <alloca.h> #else @@ -471,9 +472,14 @@ dt_aggregate_snap_cpu(dtrace_hdl_t *dtp, processorid_t cpu) } if (buf->dtbd_drops != 0) { + xo_open_instance("probes"); + dt_oformat_drop(dtp, cpu); if (dt_handle_cpudrop(dtp, cpu, - DTRACEDROP_AGGREGATION, buf->dtbd_drops) == -1) + DTRACEDROP_AGGREGATION, buf->dtbd_drops) == -1) { + xo_close_instance("probes"); return (-1); + } + xo_close_instance("probes"); } if (buf->dtbd_size == 0) @@ -2127,8 +2133,13 @@ dtrace_aggregate_print(dtrace_hdl_t *dtp, FILE *fp, if (func == NULL) func = dtrace_aggregate_walk_sorted; - if ((*func)(dtp, dt_print_agg, &pd) == -1) - return (dt_set_errno(dtp, dtp->dt_errno)); + if (dtp->dt_oformat) { + if ((*func)(dtp, dt_format_agg, &pd) == -1) + return (dt_set_errno(dtp, dtp->dt_errno)); + } else { + if ((*func)(dtp, dt_print_agg, &pd) == -1) + return (dt_set_errno(dtp, dtp->dt_errno)); + } return (0); } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c index e63771c91e08..f3fda4af834e 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c @@ -2478,10 +2478,7 @@ dt_compile(dtrace_hdl_t *dtp, int context, dtrace_probespec_t pspec, void *arg, "not referenced)\n", yypcb->pcb_sargv[argc - 1], argc - 1); } - /* - * Perform sugar transformations (for "if" / "else") and replace the - * existing clause chain with the new one. - */ + /* Perform sugar transformations. */ if (context == DT_CTX_DPROG) { dt_node_t *dnp, *next_dnp; dt_node_t *new_list = NULL; @@ -2492,8 +2489,17 @@ dt_compile(dtrace_hdl_t *dtp, int context, dtrace_probespec_t pspec, void *arg, next_dnp = dnp->dn_list; dnp->dn_list = NULL; - if (dnp->dn_kind == DT_NODE_CLAUSE) + if (dnp->dn_kind == DT_NODE_CLAUSE) { dnp = dt_compile_sugar(dtp, dnp); + if (cflags & DTRACE_C_SUGAR) { + dt_node_t *p; + + dt_printd(dnp, stdout, 0); + for (p = dnp->dn_list; p != NULL; + p = p->dn_list) + dt_printd(p, stdout, 0); + } + } /* append node to the new list */ new_list = dt_node_link(new_list, dnp); } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c index 862d4b9222d7..6a32235f7e39 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c @@ -24,6 +24,7 @@ */ /* + * Copyright (c) 2023, Domagoj Stolfa. All rights reserved. * Copyright (c) 2017, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -40,12 +41,50 @@ #endif #include <dt_impl.h> #include <dt_pq.h> +#include <dt_oformat.h> #ifndef illumos #include <libproc_compat.h> #endif #define DT_MASK_LO 0x00000000FFFFFFFFULL +#define dt_format_sym(dtp, addr) dt_print_sym((dtp), NULL, NULL, addr) + +typedef struct dt_prepare_args { + int first_bin; + int last_bin; + union { + struct lquantize_args { +#define lquantize_step u.lquantize.step +#define lquantize_levels u.lquantize.levels +#define lquantize_base u.lquantize.base + int base; + uint16_t step; + uint16_t levels; + } lquantize; + struct llquantize_args { +#define llquantize_next u.llquantize.next +#define llquantize_step u.llquantize.step +#define llquantize_value u.llquantize.value +#define llquantize_levels u.llquantize.levels +#define llquantize_order u.llquantize.order +#define llquantize_factor u.llquantize.factor +#define llquantize_low u.llquantize.low +#define llquantize_high u.llquantize.high +#define llquantize_nsteps u.llquantize.nsteps + int64_t next; + int64_t step; + int64_t value; + int levels; + int order; + uint16_t factor; + uint16_t low; + uint16_t high; + uint16_t nsteps; + } llquantize; + } u; +} dt_prepare_args_t; + /* * We declare this here because (1) we need it and (2) we want to avoid a * dependency on libm in libdtrace. @@ -761,17 +800,17 @@ dt_print_packed(dtrace_hdl_t *dtp, FILE *fp, return (dt_printf(dtp, fp, "%c", ascii[(uint_t)(val + 0.5)])); } -int -dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, - size_t size, uint64_t normal) +static const int64_t * +dt_format_quantize_prepare(dtrace_hdl_t *dtp, const void *addr, size_t size, + dt_prepare_args_t *args) { const int64_t *data = addr; - int i, first_bin = 0, last_bin = DTRACE_QUANTIZE_NBUCKETS - 1; - long double total = 0; - char positives = 0, negatives = 0; + int first_bin = 0, last_bin = DTRACE_QUANTIZE_NBUCKETS - 1; - if (size != DTRACE_QUANTIZE_NBUCKETS * sizeof (uint64_t)) - return (dt_set_errno(dtp, EDT_DMISMATCH)); + if (size != DTRACE_QUANTIZE_NBUCKETS * sizeof (uint64_t)) { + (void) dt_set_errno(dtp, EDT_DMISMATCH); + return (NULL); + } while (first_bin < DTRACE_QUANTIZE_NBUCKETS - 1 && data[first_bin] == 0) first_bin++; @@ -795,6 +834,58 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, last_bin++; } + args->first_bin = first_bin; + args->last_bin = last_bin; + return (data); +} + +int +dt_format_quantize(dtrace_hdl_t *dtp, const void *addr, size_t size, + uint64_t normal) +{ + const int64_t *data; + dt_prepare_args_t args = { 0 }; + int i, first_bin = 0, last_bin = DTRACE_QUANTIZE_NBUCKETS - 1; + + data = dt_format_quantize_prepare(dtp, addr, size, &args); + /* dt_errno is set for us */ + if (data == NULL) + return (-1); + + first_bin = args.first_bin; + last_bin = args.last_bin; + + xo_open_list("buckets"); + for (i = first_bin; i <= last_bin; i++) { + long long value = (long long)DTRACE_QUANTIZE_BUCKETVAL(i); + xo_open_instance("buckets"); + xo_emit("{:value/%lld} {:count/%lld}", value, + (long long)data[i] / normal); + xo_close_instance("buckets"); + } + xo_close_list("buckets"); + + return (0); +} + +int +dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, + size_t size, uint64_t normal) +{ + const int64_t *data; + dt_prepare_args_t args = { 0 }; + int i, first_bin = 0, last_bin = DTRACE_QUANTIZE_NBUCKETS - 1; + long double total = 0; + char positives = 0, negatives = 0; + + data = dt_format_quantize_prepare(dtp, addr, size, &args); + /* dt_errno is set for us */ + if (data == NULL) + return (-1); + + first_bin = args.first_bin; + last_bin = args.last_bin; + for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); @@ -859,19 +950,19 @@ dt_print_quantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr, return (0); } -int -dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, - size_t size, uint64_t normal) +static const int64_t * +dt_format_lquantize_prepare(dtrace_hdl_t *dtp, const void *addr, size_t size, + dt_prepare_args_t *args) { const int64_t *data = addr; - int i, first_bin, last_bin, base; + int first_bin = 0, last_bin = DTRACE_QUANTIZE_NBUCKETS - 1, base; uint64_t arg; - long double total = 0; uint16_t step, levels; - char positives = 0, negatives = 0; - if (size < sizeof (uint64_t)) - return (dt_set_errno(dtp, EDT_DMISMATCH)); + if (size < sizeof (uint64_t)) { + (void) dt_set_errno(dtp, EDT_DMISMATCH); + return (NULL); + } arg = *data++; size -= sizeof (uint64_t); @@ -883,8 +974,10 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, first_bin = 0; last_bin = levels + 1; - if (size != sizeof (uint64_t) * (levels + 2)) - return (dt_set_errno(dtp, EDT_DMISMATCH)); + if (size != sizeof (uint64_t) * (levels + 2)) { + (void) dt_set_errno(dtp, EDT_DMISMATCH); + return (NULL); + } while (first_bin <= levels + 1 && data[first_bin] == 0) first_bin++; @@ -903,6 +996,80 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, last_bin++; } + args->first_bin = first_bin; + args->last_bin = last_bin; + args->lquantize_base = base; + args->lquantize_step = step; + args->lquantize_levels = levels; + return (data); +} + +int +dt_format_lquantize(dtrace_hdl_t *dtp, const void *addr, size_t size, + uint64_t normal) +{ + const int64_t *data; + dt_prepare_args_t args = { 0 }; + int i, first_bin, last_bin, base; + uint16_t step, levels; + + data = dt_format_lquantize_prepare(dtp, addr, size, &args); + /* dt_errno is set for us */ + if (data == NULL) + return (-1); + + first_bin = args.first_bin; + last_bin = args.last_bin; + step = args.lquantize_step; + levels = args.lquantize_levels; + base = args.lquantize_base; + + xo_open_list("buckets"); + for (i = first_bin; i <= last_bin; i++) { + char c[32]; + int err; + + xo_open_instance("buckets"); + if (i == 0) { + xo_emit("{:value/%d} {:operator/%s}", base, "<"); + } else if (i == levels + 1) { + xo_emit("{:value/%d} {:operator/%s}", + base + (levels * step), ">="); + } else { + xo_emit("{:value/%d}", base + (i - 1) * step); + } + + xo_emit("{:count/%lld}", (long long)data[i] / normal); + xo_close_instance("buckets"); + } + xo_close_list("buckets"); + + return (0); +} + +int +dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, + size_t size, uint64_t normal) +{ + const int64_t *data; + dt_prepare_args_t args = { 0 }; + int i, first_bin, last_bin, base; + uint64_t arg; + long double total = 0; + uint16_t step, levels; + char positives = 0, negatives = 0; + + data = dt_format_lquantize_prepare(dtp, addr, size, &args); + /* dt_errno is set for us */ + if (data == NULL) + return (-1); + + first_bin = args.first_bin; + last_bin = args.last_bin; + step = args.lquantize_step; + levels = args.lquantize_levels; + base = args.lquantize_base; + for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); @@ -990,21 +1157,20 @@ dt_print_lquantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr, return (dt_printf(dtp, fp, ": %-8s | %lld\n", c, (long long)count)); } -int -dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, - size_t size, uint64_t normal) +static const int64_t * +dt_format_llquantize_prepare(dtrace_hdl_t *dtp, const void *addr, size_t size, + dt_prepare_args_t *args) { int i, first_bin, last_bin, bin = 1, order, levels; uint16_t factor, low, high, nsteps; const int64_t *data = addr; int64_t value = 1, next, step; - char positives = 0, negatives = 0; - long double total = 0; uint64_t arg; - char c[32]; - if (size < sizeof (uint64_t)) - return (dt_set_errno(dtp, EDT_DMISMATCH)); + if (size < sizeof(uint64_t)) { + (void) dt_set_errno(dtp, EDT_DMISMATCH); + return (NULL); + } arg = *data++; size -= sizeof (uint64_t); @@ -1019,8 +1185,10 @@ dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, * but sanity check them (to a degree) nonetheless. */ if (size > INT32_MAX || factor < 2 || low >= high || - nsteps == 0 || factor > nsteps) - return (dt_set_errno(dtp, EDT_DMISMATCH)); + nsteps == 0 || factor > nsteps) { + (void) dt_set_errno(dtp, EDT_DMISMATCH); + return (NULL); + } levels = (int)size / sizeof (uint64_t); @@ -1044,6 +1212,133 @@ dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, last_bin++; } + for (order = 0; order < low; order++) + value *= factor; + + next = value * factor; + step = next > nsteps ? next / nsteps : 1; + + args->first_bin = first_bin; + args->last_bin = last_bin; + args->llquantize_factor = factor; + args->llquantize_low = low; + args->llquantize_high = high; + args->llquantize_nsteps = nsteps; + args->llquantize_levels = levels; + args->llquantize_order = order; + args->llquantize_next = next; + args->llquantize_step = step; + args->llquantize_value = value; + + return (data); +} + +int +dt_format_llquantize(dtrace_hdl_t *dtp, const void *addr, size_t size, + uint64_t normal) +{ + int first_bin, last_bin, bin = 1, order, levels; + uint16_t factor, low, high, nsteps; + const int64_t *data; + dt_prepare_args_t args = { 0 }; + int64_t value = 1, next, step; + uint64_t arg; + char c[32]; + + data = dt_format_llquantize_prepare(dtp, addr, size, &args); + /* dt_errno is set for us */ + if (data == NULL) + return (-1); + + first_bin = args.first_bin; + last_bin = args.last_bin; + factor = args.llquantize_factor; + low = args.llquantize_low; + high = args.llquantize_high; + nsteps = args.llquantize_nsteps; + levels = args.llquantize_levels; + order = args.llquantize_order; + next = args.llquantize_next; + step = args.llquantize_step; + value = args.llquantize_value; + + xo_open_list("buckets"); + if (first_bin == 0) { + /* + * We have to represent < value somehow in JSON, so we bundle an + * optional "operator" in llquantize buckets. + */ + xo_open_instance("buckets"); + xo_emit("{:value/%lld} {:count/%lld} {:operator/%s}", + (long long)value, (long long)data[0] / normal, "<"); + xo_close_instance("buckets"); + } + + while (order <= high) { + if (bin >= first_bin && bin <= last_bin) { + xo_open_instance("buckets"); + xo_emit("{:value/%lld} {:count/%lld}", (long long)value, + (long long)data[bin] / normal); + xo_close_instance("buckets"); + } + + assert(value < next); + bin++; + + if ((value += step) != next) + continue; + + next = value * factor; + step = next > nsteps ? next / nsteps : 1; + order++; + } + + if (last_bin < bin) { + xo_close_list("buckets"); + return (0); + } + + assert(last_bin == bin); + xo_open_instance("buckets"); + xo_emit("{:value/%lld} {:count/%lld} {:operator/%s}", (long long)value, + (long long)data[bin] / normal, ">="); + xo_close_instance("buckets"); + + xo_close_list("buckets"); + return (0); +} + +int +dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, + size_t size, uint64_t normal) +{ + int i, first_bin, last_bin, bin = 1, order, levels; + uint16_t factor, low, high, nsteps; + const int64_t *data; + dt_prepare_args_t args = { 0 }; + int64_t value = 1, next, step; + char positives = 0, negatives = 0; + long double total = 0; + uint64_t arg; + char c[32]; + + data = dt_format_llquantize_prepare(dtp, addr, size, &args); + /* dt_errno is set for us */ + if (data == NULL) + return (-1); + + first_bin = args.first_bin; + last_bin = args.last_bin; + factor = args.llquantize_factor; + low = args.llquantize_low; + high = args.llquantize_high; + nsteps = args.llquantize_nsteps; + levels = args.llquantize_levels; + order = args.llquantize_order; + next = args.llquantize_next; + step = args.llquantize_step; + value = args.llquantize_value; + for (i = first_bin; i <= last_bin; i++) { positives |= (data[i] > 0); negatives |= (data[i] < 0); @@ -1054,12 +1349,6 @@ dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, "------------- Distribution -------------", "count") < 0) return (-1); - for (order = 0; order < low; order++) - value *= factor; - - next = value * factor; - step = next > nsteps ? next / nsteps : 1; - if (first_bin == 0) { (void) snprintf(c, sizeof (c), "< %lld", (long long)value); @@ -1105,6 +1394,16 @@ dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr, total, positives, negatives)); } +static int +dt_format_average(dtrace_hdl_t *dtp, caddr_t addr, size_t size, uint64_t normal) +{ + int64_t *data = (int64_t *)addr; + + xo_emit("{:average/%lld}", + data[0] ? (long long)(data[1] / (int64_t)normal / data[0]) : 0); + return (0); +} + /*ARGSUSED*/ static int dt_print_average(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, @@ -1117,6 +1416,16 @@ dt_print_average(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, (long long)(data[1] / (int64_t)normal / data[0]) : 0)); } +static int +dt_format_stddev(dtrace_hdl_t *dtp, caddr_t addr, size_t size, uint64_t normal) +{ + uint64_t *data = (uint64_t *)addr; + + xo_emit("{:stddev/%llu}", + data[0] ? (unsigned long long)dt_stddev(data, normal) : 0); + return (0); +} + /*ARGSUSED*/ static int dt_print_stddev(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, @@ -1249,6 +1558,185 @@ raw: } int +dt_format_stack(dtrace_hdl_t *dtp, caddr_t addr, int depth, int size) +{ + dtrace_syminfo_t dts; + GElf_Sym sym; + int i; + uint64_t pc; + + xo_open_list("stack-frames"); + for (i = 0; i < depth; i++) { + switch (size) { + case sizeof (uint32_t): + pc = *((uint32_t *)addr); + break; + + case sizeof (uint64_t): + pc = *((uint64_t *)addr); + break; + + default: + return (dt_set_errno(dtp, EDT_BADSTACKPC)); + } + + if (pc == 0) + break; + + addr += size; + + xo_open_instance("stack-frames"); + if (dtrace_lookup_by_addr(dtp, pc, &sym, &dts) == 0) { + if (pc > sym.st_value) { + xo_emit("{:symbol/%s`%s+0x%llx} {:module/%s} " + "{:name/%s} {:offset/0x%llx}", + dts.dts_object, dts.dts_name, + (u_longlong_t)(pc - sym.st_value), + dts.dts_object, dts.dts_name, + (u_longlong_t)(pc - sym.st_value)); + } else { + xo_emit("{:symbol/%s`%s} {:module/%s} " + "{:name/%s}", + dts.dts_object, dts.dts_name, + dts.dts_object, dts.dts_name); + } + } else { + /* + * We'll repeat the lookup, but this time we'll specify + * a NULL GElf_Sym -- indicating that we're only + * interested in the containing module. + */ + if (dtrace_lookup_by_addr(dtp, pc, NULL, &dts) == 0) { + xo_emit("{:symbol/%s`0x%llx} {:module/%s} " + "{:offset/0x%llx}", + dts.dts_object, (u_longlong_t)pc, + dts.dts_object, (u_longlong_t)pc); + } else { + xo_emit("{:symbol/0x%llx} {:offset/0x%llx}", + (u_longlong_t)pc, (u_longlong_t)pc); + } + } + xo_close_instance("stack-frames"); + } + xo_close_list("stack-frames"); + + return (0); +} + +int +dt_format_ustack(dtrace_hdl_t *dtp, caddr_t addr, uint64_t arg) +{ + uint64_t *pc = (uint64_t *)addr; + uint32_t depth = DTRACE_USTACK_NFRAMES(arg); + uint32_t strsize = DTRACE_USTACK_STRSIZE(arg); + const char *strbase = addr + (depth + 1) * sizeof (uint64_t); + const char *str = strsize ? strbase : NULL; + int err = 0; + + char name[PATH_MAX], objname[PATH_MAX], c[PATH_MAX * 2]; + struct ps_prochandle *P; + GElf_Sym sym; + int i, indent; + pid_t pid; + + if (depth == 0) + return (0); + + pid = (pid_t)*pc++; + + /* + * Ultimately, we need to add an entry point in the library vector for + * determining <symbol, offset> from <pid, address>. For now, if + * this is a vector open, we just print the raw address or string. + */ + if (dtp->dt_vector == NULL) + P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, 0); + else + P = NULL; + + if (P != NULL) + dt_proc_lock(dtp, P); /* lock handle while we perform lookups */ + + xo_open_list("ustack-frames"); + for (i = 0; i < depth && pc[i] != 0; i++) { + const prmap_t *map; + + xo_open_instance("ustack-frames"); + if (P != NULL && Plookup_by_addr(P, pc[i], + name, sizeof (name), &sym) == 0) { + (void) Pobjname(P, pc[i], objname, sizeof (objname)); + + if (pc[i] > sym.st_value) { + xo_emit("{:symbol/%s`%s+0x%llx} {:module/%s} " + "{:name/%s} {:offset/0x%llx}", + dt_basename(objname), name, + (u_longlong_t)(pc[i] - sym.st_value), + dt_basename(objname), name, + (u_longlong_t)(pc[i] - sym.st_value)); + } else { + xo_emit("{:symbol/%s`%s} {:module/%s} " + "{:name/%s}", + dt_basename(objname), name, + dt_basename(objname), name); + } + } else if (str != NULL && str[0] != '\0' && str[0] != '@' && + (P != NULL && ((map = Paddr_to_map(P, pc[i])) == NULL || + (map->pr_mflags & MA_WRITE)))) { + /* + * If the current string pointer in the string table + * does not point to an empty string _and_ the program + * counter falls in a writable region, we'll use the + * string from the string table instead of the raw + * address. This last condition is necessary because + * some (broken) ustack helpers will return a string + * even for a program counter that they can't + * identify. If we have a string for a program + * counter that falls in a segment that isn't + * writable, we assume that we have fallen into this + * case and we refuse to use the string. + */ + xo_emit("{:symbol/%s}", str); + } else { + if (P != NULL && Pobjname(P, pc[i], objname, + sizeof (objname)) != 0) { + xo_emit("{:symbol/%s`0x%llx} {:module/%s} " + "{:offset/0x%llx}", + dt_basename(objname), (u_longlong_t)pc[i], + dt_basename(objname), (u_longlong_t)pc[i]); + } else { + xo_emit("{:symbol/0x%llx} {:offset/0x%llx}", + (u_longlong_t)pc[i], (u_longlong_t)pc[i]); + } + } + + if (str != NULL && str[0] == '@') { + /* + * If the first character of the string is an "at" sign, + * then the string is inferred to be an annotation -- + * and it is printed out beneath the frame and offset + * with brackets. + */ + xo_emit("{:annotation/%s}", &str[1]); + } + + if (str != NULL) { + str += strlen(str) + 1; + if (str - strbase >= strsize) + str = NULL; + } + xo_close_instance("ustack-frames"); + } + xo_close_list("ustack-frames"); + + if (P != NULL) { + dt_proc_unlock(dtp, P); + dt_proc_release(dtp, P); + } + + return (err); +} + +int dt_print_stack(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr, int depth, int size) { @@ -1461,6 +1949,41 @@ dt_print_ustack(dtrace_hdl_t *dtp, FILE *fp, const char *format, } static int +dt_format_usym(dtrace_hdl_t *dtp, caddr_t addr, dtrace_actkind_t act) +{ + uint64_t pid = ((uint64_t *)addr)[0]; + uint64_t pc = ((uint64_t *)addr)[1]; + char *s; + int n, len = 256; + + if (act == DTRACEACT_USYM && dtp->dt_vector == NULL) { + struct ps_prochandle *P; + + if ((P = dt_proc_grab(dtp, pid, + PGRAB_RDONLY | PGRAB_FORCE, 0)) != NULL) { + GElf_Sym sym; + + dt_proc_lock(dtp, P); + + if (Plookup_by_addr(P, pc, NULL, 0, &sym) == 0) + pc = sym.st_value; + + dt_proc_unlock(dtp, P); + dt_proc_release(dtp, P); + } + } + + do { + n = len; + s = alloca(n); + } while ((len = dtrace_uaddr2str(dtp, pid, pc, s, n)) > n); + + xo_emit("{:usym/%s}", s); + return (0); +} + + +static int dt_print_usym(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, dtrace_actkind_t act) { /* LINTED - alignment */ @@ -1497,6 +2020,42 @@ dt_print_usym(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, dtrace_actkind_t act) } int +dt_format_umod(dtrace_hdl_t *dtp, caddr_t addr) +{ + uint64_t pid = ((uint64_t *)addr)[0]; + uint64_t pc = ((uint64_t *)addr)[1]; + int err = 0; + + char objname[PATH_MAX]; + struct ps_prochandle *P; + + /* + * See the comment in dt_print_ustack() for the rationale for + * printing raw addresses in the vectored case. + */ + if (dtp->dt_vector == NULL) + P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, 0); + else + P = NULL; + + if (P != NULL) + dt_proc_lock(dtp, P); /* lock handle while we perform lookups */ + + if (P != NULL && Pobjname(P, pc, objname, sizeof (objname)) != 0) { + xo_emit("{:umod/%s}", dt_basename(objname)); + } else { + xo_emit("{:umod/0x%llx}", (u_longlong_t)pc); + } + + if (P != NULL) { + dt_proc_unlock(dtp, P); + dt_proc_release(dtp, P); + } + + return (0); +} + +int dt_print_umod(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr) { /* LINTED - alignment */ @@ -1552,8 +2111,13 @@ dt_print_sym(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr) format = " %-50s"; if (dtrace_lookup_by_addr(dtp, pc, &sym, &dts) == 0) { - (void) snprintf(c, sizeof (c), "%s`%s", - dts.dts_object, dts.dts_name); + if (dtp->dt_oformat) + xo_emit("{:sym/%s`%s} {:object/%s} {:name/%s}", + dts.dts_object, dts.dts_name, dts.dts_object, + dts.dts_name); + else + (void) snprintf(c, sizeof (c), "%s`%s", + dts.dts_object, dts.dts_name); } else { /* * We'll repeat the lookup, but this time we'll specify a @@ -1561,21 +2125,47 @@ dt_print_sym(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr) * the containing module. */ if (dtrace_lookup_by_addr(dtp, pc, NULL, &dts) == 0) { - (void) snprintf(c, sizeof (c), "%s`0x%llx", - dts.dts_object, (u_longlong_t)pc); + if (dtp->dt_oformat) + xo_emit("{:sym/%s`0x%llx} {:object/%s} " + "{:offset/0x%llx}", + dts.dts_object, (u_longlong_t)pc, + dts.dts_object, (u_longlong_t)pc); + else + (void) snprintf(c, sizeof (c), "%s`0x%llx", + dts.dts_object, (u_longlong_t)pc); } else { - (void) snprintf(c, sizeof (c), "0x%llx", - (u_longlong_t)pc); + if (dtp->dt_oformat) + xo_emit("{:sym/0x%llx} {:offset/0x%llx}", + (u_longlong_t)pc, (u_longlong_t)pc); + else + (void) snprintf(c, sizeof (c), "0x%llx", + (u_longlong_t)pc); } } - if (dt_printf(dtp, fp, format, c) < 0) + if (dtp->dt_oformat != 0 && dt_printf(dtp, fp, format, c) < 0) return (-1); return (0); } int +dt_format_mod(dtrace_hdl_t *dtp, caddr_t addr) +{ + /* LINTED - alignment */ + uint64_t pc = *((uint64_t *)addr); + dtrace_syminfo_t dts; + + if (dtrace_lookup_by_addr(dtp, pc, NULL, &dts) == 0) { + xo_emit("{:mod/%s}", dts.dts_object); + } else { + xo_emit("{:mod/0x%llx}", (u_longlong_t)pc); + } + + return (0); +} + +int dt_print_mod(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr) { /* LINTED - alignment */ @@ -1598,6 +2188,74 @@ dt_print_mod(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr) return (0); } +static char * +dt_format_bytes_get(dtrace_hdl_t *dtp, caddr_t addr, size_t nbytes) +{ + char *s = dt_alloc(dtp, nbytes * 2 + 2 + 1); /* 2 bytes per byte + 0x + '\0' */ + char t[6]; + char *c = (char *)addr; + size_t i, j; + + if (s == NULL) + return (NULL); + + /* + * XXX: Some duplication with dt_print_bytes(). + */ + for (i = 0; i < nbytes; i++) { + if (isprint(c[i]) || isspace(c[i]) || c[i] == '\b' || c[i] == '\a') + continue; + + if (c[i] == '\0' && i > 0) { + for (j = i + 1; j < nbytes; j++) { + if (c[j] != '\0') + break; + } + + if (j != nbytes) + break; + + memcpy(s, c, nbytes); + return (s); + } + + break; + } + + if (i == nbytes) { + memcpy(s, c, nbytes); + s[nbytes] = '\0'; + return (s); + } + + s[0] = '0'; + s[1] = 'x'; + for (i = 0; i < nbytes; i++) { + snprintf(t, sizeof(t), "%02x", (uchar_t)c[i]); + memcpy(s + (i * 2) + 2, t, 2); + } + + s[nbytes * 2 + 2] = 0; + return (s); +} + +static int +dt_format_memory(dtrace_hdl_t *dtp, caddr_t addr) +{ + + size_t nbytes = *((uintptr_t *) addr); + char *s; + + s = dt_format_bytes_get(dtp, addr + sizeof(uintptr_t), nbytes); + if (s == NULL) + return (-1); + + xo_emit("{:printm/%s}", s); + dt_free(dtp, s); + + return (0); +} + static int dt_print_memory(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) { @@ -1803,6 +2461,90 @@ dt_trunc(dtrace_hdl_t *dtp, caddr_t base, dtrace_recdesc_t *rec) } static int +dt_format_datum(dtrace_hdl_t *dtp, dtrace_recdesc_t *rec, caddr_t addr, + size_t size, const dtrace_aggdata_t *aggdata, uint64_t normal, + dt_print_aggdata_t *pd) +{ + dtrace_actkind_t act = rec->dtrd_action; + boolean_t packed = pd->dtpa_agghist || pd->dtpa_aggpack; + dtrace_aggdesc_t *agg = aggdata->dtada_desc; + char fmt[512]; + char *s; + + if (packed && pd->dtpa_agghisthdr != agg->dtagd_varid) + pd->dtpa_agghisthdr = agg->dtagd_varid; + + switch (act) { + case DTRACEACT_STACK: + return (dt_format_stack(dtp, addr, rec->dtrd_arg, + rec->dtrd_size / rec->dtrd_arg)); + + case DTRACEACT_USTACK: + case DTRACEACT_JSTACK: + return (dt_format_ustack(dtp, addr, rec->dtrd_arg)); + + case DTRACEACT_USYM: + case DTRACEACT_UADDR: + return (dt_format_usym(dtp, addr, act)); + + case DTRACEACT_UMOD: + return (dt_format_umod(dtp, addr)); + + case DTRACEACT_SYM: + return (dt_format_sym(dtp, addr)); + case DTRACEACT_MOD: + return (dt_format_mod(dtp, addr)); + + case DTRACEAGG_QUANTIZE: + return (dt_format_quantize(dtp, addr, size, normal)); + + case DTRACEAGG_LQUANTIZE: + return (dt_format_lquantize(dtp, addr, size, normal)); + + case DTRACEAGG_LLQUANTIZE: + return (dt_format_llquantize(dtp, addr, size, normal)); + + case DTRACEAGG_AVG: + return (dt_format_average(dtp, addr, size, normal)); + + case DTRACEAGG_STDDEV: + return (dt_format_stddev(dtp, addr, size, normal)); + + default: + break; + } + + switch (size) { + case sizeof (uint64_t): + snprintf(fmt, sizeof(fmt), "{:%s/%%lld}", pd->dtpa_keyname); + xo_emit(fmt, (long long)*((uint64_t *)addr) / normal); + break; + case sizeof (uint32_t): + snprintf(fmt, sizeof(fmt), "{:%s/%%d}", pd->dtpa_keyname); + xo_emit(fmt, *((uint32_t *)addr) / (uint32_t)normal); + break; + case sizeof (uint16_t): + snprintf(fmt, sizeof(fmt), "{:%s/%%d}", pd->dtpa_keyname); + xo_emit(fmt, *((uint16_t *)addr) / (uint32_t)normal); + break; + case sizeof (uint8_t): + snprintf(fmt, sizeof(fmt), "{:%s/%%d}", pd->dtpa_keyname); + xo_emit(fmt, *((uint8_t *)addr) / (uint32_t)normal); + break; + default: + s = dt_format_bytes_get(dtp, addr, size); + if (s == NULL) + return (-1); + + xo_emit("{:value/%s}", s); + dt_free(dtp, s); + break; + } + + return (0); +} + +static int dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec, caddr_t addr, size_t size, const dtrace_aggdata_t *aggdata, uint64_t normal, dt_print_aggdata_t *pd) @@ -1957,6 +2699,119 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec, } int +dt_format_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) +{ + int i, aggact = 0; + dt_print_aggdata_t *pd = arg; + const dtrace_aggdata_t *aggdata = aggsdata[0]; + dtrace_aggdesc_t *agg = aggdata->dtada_desc; + dtrace_hdl_t *dtp = pd->dtpa_dtp; + dtrace_recdesc_t *rec; + dtrace_actkind_t act; + caddr_t addr; + size_t size; + + if (pd->dtpa_aggname == NULL) + pd->dtpa_aggname = agg->dtagd_name; + + xo_open_instance("aggregation-data"); + strcpy(pd->dtpa_keyname, "value"); + xo_open_list("keys"); + + /* + * Iterate over each record description in the key, printing the traced + * data, skipping the first datum (the tuple member created by the + * compiler). + */ + for (i = 1; i < agg->dtagd_nrecs; i++) { + rec = &agg->dtagd_rec[i]; + act = rec->dtrd_action; + addr = aggdata->dtada_data + rec->dtrd_offset; + size = rec->dtrd_size; + + if (DTRACEACT_ISAGG(act)) { + aggact = i; + break; + } + + xo_open_instance("keys"); + if (dt_format_datum(dtp, rec, addr, + size, aggdata, 1, pd) < 0) { + xo_close_instance("keys"); + xo_close_instance("aggregation-data"); + return (-1); + } + xo_close_instance("keys"); + + if (dt_buffered_flush(dtp, NULL, rec, aggdata, + DTRACE_BUFDATA_AGGKEY) < 0) { + xo_close_instance("aggregation-data"); + return (-1); + } + } + xo_close_list("keys"); + + assert(aggact != 0); + + for (i = (naggvars == 1 ? 0 : 1); i < naggvars; i++) { + uint64_t normal; + + aggdata = aggsdata[i]; + agg = aggdata->dtada_desc; + rec = &agg->dtagd_rec[aggact]; + act = rec->dtrd_action; + addr = aggdata->dtada_data + rec->dtrd_offset; + size = rec->dtrd_size; + + assert(DTRACEACT_ISAGG(act)); + + switch (act) { + case DTRACEAGG_MIN: + strcpy(pd->dtpa_keyname, "min"); + break; + case DTRACEAGG_MAX: + strcpy(pd->dtpa_keyname, "max"); + break; + case DTRACEAGG_COUNT: + strcpy(pd->dtpa_keyname, "count"); + break; + case DTRACEAGG_SUM: + strcpy(pd->dtpa_keyname, "sum"); + break; + default: + strcpy(pd->dtpa_keyname, "UNKNOWN"); + break; + } + + normal = aggdata->dtada_normal; + + if (dt_format_datum(dtp, rec, addr, size, + aggdata, normal, pd) < 0) { + xo_close_instance("aggregation-data"); + return (-1); + } + + if (dt_buffered_flush(dtp, NULL, rec, aggdata, + DTRACE_BUFDATA_AGGVAL) < 0) { + xo_close_instance("aggregation-data"); + return (-1); + } + + if (!pd->dtpa_allunprint) + agg->dtagd_flags |= DTRACE_AGD_PRINTED; + } + + if (dt_buffered_flush(dtp, NULL, NULL, aggdata, + DTRACE_BUFDATA_AGGFORMAT | DTRACE_BUFDATA_AGGLAST) < 0) { + xo_close_instance("aggregation-data"); + return (-1); + } + + xo_close_instance("aggregation-data"); + return (0); +} + +int dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) { int i, aggact = 0; @@ -2038,6 +2893,33 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) } int +dt_format_agg(const dtrace_aggdata_t *aggdata, void *arg) +{ + dt_print_aggdata_t *pd = arg; + dtrace_aggdesc_t *agg = aggdata->dtada_desc; + dtrace_aggvarid_t aggvarid = pd->dtpa_id; + + if (pd->dtpa_allunprint) { + if (agg->dtagd_flags & DTRACE_AGD_PRINTED) + return (0); + } else { + /* + * If we're not printing all unprinted aggregations, then the + * aggregation variable ID denotes a specific aggregation + * variable that we should print -- skip any other aggregations + * that we encounter. + */ + if (agg->dtagd_nrecs == 0) + return (0); + + if (aggvarid != agg->dtagd_varid) + return (0); + } + + return (dt_format_aggs(&aggdata, 1, arg)); +} + +int dt_print_agg(const dtrace_aggdata_t *aggdata, void *arg) { dt_print_aggdata_t *pd = arg; @@ -2101,6 +2983,33 @@ dt_setopt(dtrace_hdl_t *dtp, const dtrace_probedata_t *data, return (rval); } +/* + * Helper functions to help maintain style(9) in dt_consume_cpu(). + */ +static int +dt_oformat_agg_sorted(dtrace_hdl_t *dtp, dtrace_aggregate_f *func, + dt_print_aggdata_t *pd) +{ + int r; + + r = dtrace_aggregate_walk_sorted(dtp, dt_format_agg, pd); + if (r < 0) { + xo_close_list("aggregation-data"); + xo_emit("{:aggregation-name/%s}", pd->dtpa_aggname); + xo_close_instance("output"); + } + + return (r); +} + +static void +dt_oformat_agg_name(dt_print_aggdata_t *pd) +{ + + xo_close_list("aggregation-data"); + xo_emit("{:aggregation-name/%s}", pd->dtpa_aggname); +} + static int dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, dtrace_bufdesc_t *buf, boolean_t just_one, @@ -2114,6 +3023,7 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, uint64_t tracememsize = 0; dtrace_probedata_t data; uint64_t drops; + size_t skip_format; bzero(&data, sizeof (data)); data.dtpda_handle = dtp; @@ -2145,6 +3055,8 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, epd = data.dtpda_edesc; data.dtpda_data = buf->dtbd_data + offs; + data.dtpda_timestamp = DTRACE_RECORD_LOAD_TIMESTAMP( + (struct dtrace_rechdr *)data.dtpda_data); if (data.dtpda_edesc->dtepd_uarg != DT_ECB_DEFAULT) { rval = dt_handle(dtp, &data); @@ -2160,6 +3072,8 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, (void) dt_flowindent(dtp, &data, dtp->dt_last_epid, buf, offs); + if (dtp->dt_oformat) + xo_open_instance("probes"); rval = (*efunc)(&data, arg); if (flow) { @@ -2176,11 +3090,17 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, if (rval != DTRACE_CONSUME_THIS) return (dt_set_errno(dtp, EDT_BADRVAL)); + skip_format = 0; + if (dtp->dt_oformat) + xo_open_list("output"); for (i = 0; i < epd->dtepd_nrecs; i++) { caddr_t addr; dtrace_recdesc_t *rec = &epd->dtepd_rec[i]; dtrace_actkind_t act = rec->dtrd_action; + if (skip_format > 0) + skip_format--; + data.dtpda_data = buf->dtbd_data + offs + rec->dtrd_offset; addr = data.dtpda_data; @@ -2301,54 +3221,109 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, if (rval != DTRACE_CONSUME_THIS) return (dt_set_errno(dtp, EDT_BADRVAL)); + if (dtp->dt_oformat && rec->dtrd_size > 0) + xo_open_instance("output"); if (act == DTRACEACT_STACK) { int depth = rec->dtrd_arg; - if (dt_print_stack(dtp, fp, NULL, addr, depth, - rec->dtrd_size / depth) < 0) + if (dtp->dt_oformat) { + if (dt_format_stack(dtp, addr, depth, + rec->dtrd_size / depth) < 0) { + xo_close_instance("output"); + return (-1); + } + } else { + if (dt_print_stack(dtp, + fp, NULL, addr, depth, + rec->dtrd_size / depth) < 0) return (-1); + } goto nextrec; } if (act == DTRACEACT_USTACK || act == DTRACEACT_JSTACK) { - if (dt_print_ustack(dtp, fp, NULL, - addr, rec->dtrd_arg) < 0) - return (-1); + if (dtp->dt_oformat) { + if (dt_format_ustack(dtp, addr, + rec->dtrd_arg) < 0) { + xo_close_instance("output"); + return (-1); + } + } else { + if (dt_print_ustack(dtp, fp, NULL, + addr, rec->dtrd_arg) < 0) + return (-1); + } goto nextrec; } if (act == DTRACEACT_SYM) { - if (dt_print_sym(dtp, fp, NULL, addr) < 0) - return (-1); + if (dtp->dt_oformat) { + if (dt_format_sym(dtp, addr) < 0) { + xo_close_instance("output"); + return (-1); + } + } else { + if (dt_print_sym(dtp, fp, NULL, addr) < 0) + return (-1); + } goto nextrec; } if (act == DTRACEACT_MOD) { - if (dt_print_mod(dtp, fp, NULL, addr) < 0) - return (-1); + if (dtp->dt_oformat) { + if (dt_format_mod(dtp, addr) < 0) { + xo_close_instance("output"); + return (-1); + } + } else { + if (dt_print_mod(dtp, fp, NULL, addr) < 0) + return (-1); + } goto nextrec; } if (act == DTRACEACT_USYM || act == DTRACEACT_UADDR) { - if (dt_print_usym(dtp, fp, addr, act) < 0) - return (-1); + if (dtp->dt_oformat) { + if (dt_format_usym(dtp, addr, act) < 0) { + xo_close_instance("output"); + return (-1); + } + } else { + if (dt_print_usym(dtp, fp, addr, act) < 0) + return (-1); + } goto nextrec; } if (act == DTRACEACT_UMOD) { - if (dt_print_umod(dtp, fp, NULL, addr) < 0) - return (-1); + if (dtp->dt_oformat) { + if (dt_format_umod(dtp, addr) < 0) { + xo_close_instance("output"); + return (-1); + } + } else { + if (dt_print_umod(dtp, fp, NULL, addr) < 0) + return (-1); + } goto nextrec; } if (act == DTRACEACT_PRINTM) { - if (dt_print_memory(dtp, fp, addr) < 0) - return (-1); + if (dtp->dt_oformat) { + if (dt_format_memory(dtp, addr) < 0) { + xo_close_instance("output"); + return (-1); + } + } else { + if (dt_print_memory(dtp, fp, addr) < 0) + return (-1); + } goto nextrec; } - if (DTRACEACT_ISPRINTFLIKE(act)) { + if (dtp->dt_oformat == DTRACE_OFORMAT_TEXT && + DTRACEACT_ISPRINTFLIKE(act)) { void *fmtdata; int (*func)(dtrace_hdl_t *, FILE *, void *, const dtrace_probedata_t *, @@ -2388,6 +3363,54 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, } /* + * We don't care about a formatted printa, system or + * freopen for oformat. + */ + if (dtp->dt_oformat && act == DTRACEACT_PRINTF && + skip_format == 0) { + void *fmtdata; + if ((fmtdata = dt_format_lookup(dtp, + rec->dtrd_format)) == NULL) + goto nofmt; + + n = dtrace_sprintf(dtp, fp, fmtdata, rec, + epd->dtepd_nrecs - i, + (uchar_t *)buf->dtbd_data + offs, + buf->dtbd_size - offs); + + if (n < 0) { + xo_close_instance("output"); + return (-1); /* errno is set for us */ + } + + xo_emit("{:message/%s}", dtp->dt_sprintf_buf); + skip_format += n; + + /* + * We want the "message" object to be its own + * thing, but we still want to process the + * current DIFEXPR in case there is a value + * attached to it. If there is, we need to + * re-open a new output instance, as otherwise + * the message ends up bundled with the first + * value. + * + * XXX: There is an edge case where a + * printf("hello"); will produce a DIFO that + * returns 0 attached to it and we have no good + * way to determine if this 0 value is because + * there's no real data attached to the printf + * as an argument, or it's because the argument + * actually returns 0. + */ + if (skip_format == 0) + goto nextrec; + + xo_close_instance("output"); + xo_open_instance("output"); + } + + /* * If this is a DIF expression, and the record has a * format set, this indicates we have a CTF type name * associated with the data and we should try to print @@ -2397,8 +3420,14 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, const char *strdata = dt_strdata_lookup(dtp, rec->dtrd_format); if (strdata != NULL) { - n = dtrace_print(dtp, fp, strdata, - addr, rec->dtrd_size); + if (dtp->dt_oformat) + n = dtrace_format_print(dtp, fp, + strdata, addr, + rec->dtrd_size); + else + n = dtrace_print(dtp, fp, + strdata, addr, + rec->dtrd_size); /* * dtrace_print() will return -1 on @@ -2408,8 +3437,12 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, * should fall through to the normal * trace method. */ - if (n < 0) + if (n < 0) { + if (dtp->dt_oformat) + xo_close_instance( + "output"); return (-1); + } if (n > 0) goto nextrec; @@ -2424,8 +3457,11 @@ nofmt: size_t size = ((epd->dtepd_nrecs - i) * sizeof (dtrace_aggvarid_t)); - if ((aggvars = dt_alloc(dtp, size)) == NULL) + if ((aggvars = dt_alloc(dtp, size)) == NULL) { + if (dtp->dt_oformat) + xo_close_instance("output"); return (-1); + } /* * This might be a printa() with multiple @@ -2443,6 +3479,9 @@ nofmt: break; if (nrec->dtrd_action != act) { + if (dtp->dt_oformat) + xo_close_instance( + "output"); return (dt_set_errno(dtp, EDT_BADAGG)); } @@ -2462,24 +3501,50 @@ nofmt: assert(naggvars >= 1); + if (dtp->dt_oformat) + xo_open_list("aggregation-data"); if (naggvars == 1) { pd.dtpa_id = aggvars[0]; dt_free(dtp, aggvars); - if (dt_printf(dtp, fp, "\n") < 0 || - dtrace_aggregate_walk_sorted(dtp, - dt_print_agg, &pd) < 0) - return (-1); + if (dtp->dt_oformat) { + n = dt_oformat_agg_sorted(dtp, + dt_format_agg, &pd); + if (n < 0) + return (-1); + } else { + if (dt_printf(dtp, fp, "\n") < 0 || + dtrace_aggregate_walk_sorted(dtp, + dt_print_agg, &pd) < 0) + return (-1); + } + + if (dtp->dt_oformat) + dt_oformat_agg_name(&pd); goto nextrec; } - if (dt_printf(dtp, fp, "\n") < 0 || - dtrace_aggregate_walk_joined(dtp, aggvars, - naggvars, dt_print_aggs, &pd) < 0) { - dt_free(dtp, aggvars); - return (-1); + if (dtp->dt_oformat) { + if (dtrace_aggregate_walk_joined(dtp, + aggvars, naggvars, + dt_format_aggs, &pd) < 0) { + dt_oformat_agg_name(&pd); + xo_close_instance("output"); + dt_free(dtp, aggvars); + return (-1); + } + } else { + if (dt_printf(dtp, fp, "\n") < 0 || + dtrace_aggregate_walk_joined(dtp, + aggvars, naggvars, + dt_print_aggs, &pd) < 0) { + dt_free(dtp, aggvars); + return (-1); + } } + if (dtp->dt_oformat) + dt_oformat_agg_name(&pd); dt_free(dtp, aggvars); goto nextrec; } @@ -2490,8 +3555,17 @@ nofmt: tracememsize = rec->dtrd_size; } - n = dt_print_bytes(dtp, fp, addr, - tracememsize, -33, quiet, 1); + if (dtp->dt_oformat) { + char *s; + + s = dt_format_bytes_get(dtp, addr, + tracememsize); + n = xo_emit("{:tracemem/%s}", s); + dt_free(dtp, s); + } else { + n = dt_print_bytes(dtp, fp, addr, + tracememsize, -33, quiet, 1); + } tracememsize = 0; @@ -2503,31 +3577,67 @@ nofmt: switch (rec->dtrd_size) { case sizeof (uint64_t): - n = dt_printf(dtp, fp, - quiet ? "%lld" : " %16lld", - /* LINTED - alignment */ - *((unsigned long long *)addr)); + if (dtp->dt_oformat) { + xo_emit("{:value/%lld}", + *((unsigned long long *)addr)); + n = 0; + } else + n = dt_printf(dtp, fp, + quiet ? "%lld" : " %16lld", + /* LINTED - alignment */ + *((unsigned long long *)addr)); break; case sizeof (uint32_t): - n = dt_printf(dtp, fp, quiet ? "%d" : " %8d", - /* LINTED - alignment */ - *((uint32_t *)addr)); + if (dtp->dt_oformat) { + xo_emit("{:value/%d}", + *((uint32_t *)addr)); + n = 0; + } else + n = dt_printf(dtp, fp, + quiet ? "%d" : " %8d", + /* LINTED - alignment */ + *((uint32_t *)addr)); break; case sizeof (uint16_t): - n = dt_printf(dtp, fp, quiet ? "%d" : " %5d", - /* LINTED - alignment */ - *((uint16_t *)addr)); + if (dtp->dt_oformat) { + xo_emit("{:value/%d}", + *((uint16_t *)addr)); + n = 0; + } else + n = dt_printf(dtp, fp, + quiet ? "%d" : " %5d", + /* LINTED - alignment */ + *((uint16_t *)addr)); break; case sizeof (uint8_t): - n = dt_printf(dtp, fp, quiet ? "%d" : " %3d", - *((uint8_t *)addr)); + if (dtp->dt_oformat) { + xo_emit("{:value/%d}", + *((uint8_t *)addr)); + n = 0; + } else + n = dt_printf(dtp, fp, + quiet ? "%d" : " %3d", + *((uint8_t *)addr)); break; default: - n = dt_print_bytes(dtp, fp, addr, - rec->dtrd_size, -33, quiet, 0); + if (dtp->dt_oformat && rec->dtrd_size > 0) { + char *s; + + s = dt_format_bytes_get(dtp, addr, + rec->dtrd_size); + xo_emit("{:value/%s}", s); + dt_free(dtp, s); + n = 0; + } else { + n = dt_print_bytes(dtp, fp, addr, + rec->dtrd_size, -33, quiet, 0); + } break; } + if (dtp->dt_oformat && rec->dtrd_size > 0) + xo_close_instance("output"); + if (n < 0) return (-1); /* errno is set for us */ @@ -2544,6 +3654,12 @@ nextrec: nextepid: offs += epd->dtepd_size; dtp->dt_last_epid = id; + + if (dtp->dt_oformat) { + xo_close_list("output"); + xo_close_instance("probes"); + xo_flush(); + } if (just_one) { buf->dtbd_oldest = offs; break; @@ -2562,7 +3678,12 @@ nextepid: */ buf->dtbd_drops = 0; - return (dt_handle_cpudrop(dtp, cpu, DTRACEDROP_PRINCIPAL, drops)); + xo_open_instance("probes"); + dt_oformat_drop(dtp, cpu); + rval = dt_handle_cpudrop(dtp, cpu, DTRACEDROP_PRINCIPAL, drops); + xo_close_instance("probes"); + + return (rval); } /* @@ -3065,8 +4186,12 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, /* Consume drops. */ for (i = 0; i < max_ncpus; i++) { if (drops[i] != 0) { - int error = dt_handle_cpudrop(dtp, i, + int error; + xo_open_instance("probes"); + dt_oformat_drop(dtp, i); + error = dt_handle_cpudrop(dtp, i, DTRACEDROP_PRINCIPAL, drops[i]); + xo_close_instance("probes"); if (error != 0) return (error); } @@ -3082,3 +4207,22 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, return (0); } + +void +dtrace_oformat_probe(dtrace_hdl_t *dtp __unused, const dtrace_probedata_t *data, + processorid_t cpu, dtrace_probedesc_t *pd) +{ + + xo_emit("{:timestamp/%llu} {:cpu/%d} {:id/%d} {:provider/%s} " + "{:module/%s} {:function/%s} {:name/%s}", + (unsigned long long)data->dtpda_timestamp, cpu, pd->dtpd_id, + pd->dtpd_provider, pd->dtpd_mod, pd->dtpd_func, pd->dtpd_name); +} + +void +dt_oformat_drop(dtrace_hdl_t *dtp, processorid_t cpu) +{ + xo_emit("{:cpu/%d} {:id/%d} {:provider/%s} " + "{:module/%s} {:function/%s} {:name/%s}", + cpu, -1, "dtrace", "INTERNAL", "INTERNAL", "DROP"); +} diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c index f26126bba517..91a4871f56b5 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c @@ -36,6 +36,7 @@ #endif #include <dt_impl.h> +#include <dt_oformat.h> #include <dt_program.h> static const char _dt_errprog[] = @@ -315,6 +316,7 @@ dt_handle_cpudrop(dtrace_hdl_t *dtp, processorid_t cpu, dtrace_dropdata_t drop; char str[80], *s; int size; + struct timeval tv; assert(what == DTRACEDROP_PRINCIPAL || what == DTRACEDROP_AGGREGATION); @@ -339,6 +341,15 @@ dt_handle_cpudrop(dtrace_hdl_t *dtp, processorid_t cpu, what == DTRACEDROP_PRINCIPAL ? "" : "aggregation ", howmany > 1 ? "s" : "", cpu); + if (dtp->dt_oformat) { + (void) gettimeofday(&tv, NULL); + xo_emit("{:timestamp/%ld.%06ld} {:count/%ju} " + "{:total/%ju} {:kind/%d} {:msg/%s}", + tv.tv_sec, tv.tv_usec, (uintmax_t)drop.dtdda_drops, + (uintmax_t)drop.dtdda_total, drop.dtdda_kind, + drop.dtdda_msg); + } + if (dtp->dt_drophdlr == NULL) return (dt_set_errno(dtp, EDT_DROPABORT)); @@ -396,6 +407,7 @@ dt_handle_status(dtrace_hdl_t *dtp, dtrace_status_t *old, dtrace_status_t *new) char str[80], *s; uintptr_t base = (uintptr_t)new, obase = (uintptr_t)old; int i, size; + struct timeval tv; bzero(&drop, sizeof (drop)); drop.dtdda_handle = dtp; @@ -408,6 +420,8 @@ dt_handle_status(dtrace_hdl_t *dtp, dtrace_status_t *old, dtrace_status_t *new) if (new->dtst_killed && !old->dtst_killed) return (dt_set_errno(dtp, EDT_BRICKED)); + (void) gettimeofday(&tv, NULL); + for (i = 0; _dt_droptab[i].dtdrt_str != NULL; i++) { uintptr_t naddr = base + _dt_droptab[i].dtdrt_offset; uintptr_t oaddr = obase + _dt_droptab[i].dtdrt_offset; @@ -438,12 +452,31 @@ dt_handle_status(dtrace_hdl_t *dtp, dtrace_status_t *old, dtrace_status_t *new) drop.dtdda_total = nval; drop.dtdda_drops = nval - oval; - if (dtp->dt_drophdlr == NULL) + if (dtp->dt_oformat) { + xo_open_instance("probes"); + dt_oformat_drop(dtp, DTRACE_CPUALL); + xo_emit("{:timestamp/%ld.%06ld} {:count/%ju} " + "{:total/%ju} {:kind/%d} {:msg/%s}", + tv.tv_sec, tv.tv_usec, (uintmax_t)drop.dtdda_drops, + (uintmax_t)drop.dtdda_total, drop.dtdda_kind, + drop.dtdda_msg); + } + + if (dtp->dt_drophdlr == NULL) { + if (dtp->dt_oformat) + xo_close_instance("probes"); return (dt_set_errno(dtp, EDT_DROPABORT)); + } if ((*dtp->dt_drophdlr)(&drop, - dtp->dt_droparg) == DTRACE_HANDLE_ABORT) + dtp->dt_droparg) == DTRACE_HANDLE_ABORT) { + if (dtp->dt_oformat) + xo_close_instance("probes"); return (dt_set_errno(dtp, EDT_DROPABORT)); + } + + if (dtp->dt_oformat) + xo_close_instance("probes"); } return (0); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h index b3f69bb6329d..1be984f28001 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h @@ -211,6 +211,8 @@ typedef struct dt_print_aggdata { int dtpa_agghist; /* print aggregation as histogram */ int dtpa_agghisthdr; /* aggregation histogram hdr printed */ int dtpa_aggpack; /* pack quantized aggregations */ + char dtpa_keyname[256]; /* key name for oformat */ + char *dtpa_aggname; /* aggregate name for oformat */ } dt_print_aggdata_t; typedef struct dt_dirpath { @@ -323,6 +325,7 @@ struct dtrace_hdl { #endif int dt_fd; /* file descriptor for dtrace pseudo-device */ int dt_ftfd; /* file descriptor for fasttrap pseudo-device */ + int dt_kinstfd; /* file descriptor for kinst pseudo-device */ int dt_fterr; /* saved errno from failed open of dt_ftfd */ int dt_cdefs_fd; /* file descriptor for C CTF debugging cache */ int dt_ddefs_fd; /* file descriptor for D CTF debugging cache */ @@ -363,6 +366,7 @@ struct dtrace_hdl { dtrace_epid_t dt_last_epid; /* most recently consumed EPID */ uint64_t dt_last_timestamp; /* most recently consumed timestamp */ boolean_t dt_has_sugar; /* syntactic sugar used? */ + int dt_oformat; /* output format (none, json, xml, html) */ }; /* @@ -701,6 +705,8 @@ extern int dt_print_llquantize(dtrace_hdl_t *, FILE *, const void *, size_t, uint64_t); extern int dt_print_agg(const dtrace_aggdata_t *, void *); +extern int dt_format_agg(const dtrace_aggdata_t *, void *); + extern int dt_handle(dtrace_hdl_t *, dtrace_probedata_t *); extern int dt_handle_liberr(dtrace_hdl_t *, const dtrace_probedata_t *, const char *); @@ -710,6 +716,8 @@ extern int dt_handle_status(dtrace_hdl_t *, dtrace_status_t *, dtrace_status_t *); extern int dt_handle_setopt(dtrace_hdl_t *, dtrace_setoptdata_t *); +extern void dt_oformat_drop(dtrace_hdl_t *, processorid_t); + extern int dt_lib_depend_add(dtrace_hdl_t *, dt_list_t *, const char *); extern dt_lib_depend_t *dt_lib_depend_lookup(dt_list_t *, const char *); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l index 7dcf21652586..d50369bb57c9 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l @@ -97,6 +97,8 @@ static void unput(int); */ %} +%option yylineno + %e 1500 /* maximum nodes */ %p 4900 /* maximum positions */ %n 600 /* maximum states */ diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c index 0b3dac0224f9..442c6f940733 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c @@ -215,10 +215,6 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf32_t *dep) dofr[j].dofr_offset; rel->r_info = ELF32_R_INFO(count + dep->de_global, R_386_PC32); -#elif defined(__mips__) -/* XXX */ - printf("%s:%s(%d): MIPS not implemented\n", - __FUNCTION__, __FILE__, __LINE__); #elif defined(__powerpc__) /* * Add 4 bytes to hit the low half of this 64-bit @@ -229,9 +225,9 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf32_t *dep) rel->r_info = ELF32_R_INFO(count + dep->de_global, R_PPC_REL32); #elif defined(__riscv) -/* XXX */ - printf("%s:%s(%d): RISC-V not implemented\n", - __FUNCTION__, __FILE__, __LINE__); + rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; + rel->r_info = ELF32_R_INFO(count + dep->de_global, + R_RISCV_32_PCREL); #else #error unknown ISA #endif @@ -401,15 +397,15 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf64_t *dep) R_AARCH64_PREL64); #elif defined(__arm__) /* XXX */ -#elif defined(__mips__) -/* XXX */ #elif defined(__powerpc__) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; rel->r_info = ELF64_R_INFO(count + dep->de_global, R_PPC64_REL64); #elif defined(__riscv) -/* XXX */ + rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; + rel->r_info = ELF64_R_INFO(count + dep->de_global, + R_RISCV_32_PCREL); #elif defined(__i386) || defined(__amd64) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; @@ -504,14 +500,28 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd) elf_file.ehdr.e_type = ET_REL; #if defined(__arm__) elf_file.ehdr.e_machine = EM_ARM; -#elif defined(__mips__) - elf_file.ehdr.e_machine = EM_MIPS; #elif defined(__powerpc__) elf_file.ehdr.e_machine = EM_PPC; #elif defined(__i386) || defined(__amd64) elf_file.ehdr.e_machine = EM_386; #elif defined(__aarch64__) elf_file.ehdr.e_machine = EM_AARCH64; +#elif defined(__riscv) + elf_file.ehdr.e_machine = EM_RISCV; + + /* Set the ELF flags according to our current ABI */ +#if defined(__riscv_compressed) + elf_file.ehdr.e_flags |= EF_RISCV_RVC; +#endif +#if defined(__riscv_float_abi_soft) + elf_file.ehdr.e_flags |= EF_RISCV_FLOAT_ABI_SOFT; +#endif +#if defined(__riscv_float_abi_single) + elf_file.ehdr.e_flags |= EF_RISCV_FLOAT_ABI_SINGLE; +#endif +#if defined(__riscv_float_abi_double) + elf_file.ehdr.e_flags |= EF_RISCV_FLOAT_ABI_DOUBLE; +#endif #endif elf_file.ehdr.e_version = EV_CURRENT; elf_file.ehdr.e_shoff = sizeof (Elf32_Ehdr); @@ -572,7 +582,7 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd) } else { shp = &elf_file.shdr[ESHDR_REL]; shp->sh_name = 37; /* DTRACE_SHSTRTAB32[37] = ".rel.SUNW_dof" */ - shp->sh_flags = SHF_ALLOC; + shp->sh_flags = 0; shp->sh_type = SHT_REL; shp->sh_entsize = sizeof (de.de_rel[0]); shp->sh_link = ESHDR_SYMTAB; @@ -644,8 +654,6 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd) elf_file.ehdr.e_type = ET_REL; #if defined(__arm__) elf_file.ehdr.e_machine = EM_ARM; -#elif defined(__mips__) - elf_file.ehdr.e_machine = EM_MIPS; #elif defined(__powerpc64__) #if defined(_CALL_ELF) && _CALL_ELF == 2 elf_file.ehdr.e_flags = 2; @@ -655,6 +663,22 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd) elf_file.ehdr.e_machine = EM_AMD64; #elif defined(__aarch64__) elf_file.ehdr.e_machine = EM_AARCH64; +#elif defined(__riscv) + elf_file.ehdr.e_machine = EM_RISCV; + + /* Set the ELF flags according to our current ABI */ +#if defined(__riscv_compressed) + elf_file.ehdr.e_flags |= EF_RISCV_RVC; +#endif +#if defined(__riscv_float_abi_soft) + elf_file.ehdr.e_flags |= EF_RISCV_FLOAT_ABI_SOFT; +#endif +#if defined(__riscv_float_abi_single) + elf_file.ehdr.e_flags |= EF_RISCV_FLOAT_ABI_SINGLE; +#endif +#if defined(__riscv_float_abi_double) + elf_file.ehdr.e_flags |= EF_RISCV_FLOAT_ABI_DOUBLE; +#endif #endif elf_file.ehdr.e_version = EV_CURRENT; elf_file.ehdr.e_shoff = sizeof (Elf64_Ehdr); @@ -715,7 +739,7 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd) } else { shp = &elf_file.shdr[ESHDR_REL]; shp->sh_name = 37; /* DTRACE_SHSTRTAB64[37] = ".rel.SUNW_dof" */ - shp->sh_flags = SHF_ALLOC; + shp->sh_flags = 0; shp->sh_type = SHT_RELA; shp->sh_entsize = sizeof (de.de_rel[0]); shp->sh_link = ESHDR_SYMTAB; @@ -843,17 +867,6 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, __LINE__); return (-1); } -#elif defined(__mips__) -#define DT_REL_NONE R_MIPS_NONE - -static int -dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, - uint32_t *off) -{ - printf("%s:%s(%d): MIPS not implemented\n", __FUNCTION__, __FILE__, - __LINE__); - return (-1); -} #elif defined(__powerpc__) /* The sentinel is 'xor r3,r3,r3'. */ #define DT_OP_XOR_R3 0x7c631a78 @@ -938,14 +951,74 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, return (0); } #elif defined(__riscv) +#define DT_OP_NOP 0x00000013 /* addi x0, x0, 0 */ +#define DT_OP_RET 0x00008067 /* jalr x0, x1, 0 */ +#define DT_OP_IS_AUIPC(op) (((op) & 0x7f) == 0x17) +#define DT_OP_IS_JALR(op) (((op) & 0x707f) == 0x67) +#define DT_OP_JALR_CALL 0x000080e7 /* jalr x1, x1, 0 */ +#define DT_OP_JALR_TAIL 0x00030067 /* jalr x0, x6, 0 */ #define DT_REL_NONE R_RISCV_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) { - printf("%s:%s(%d): RISC-V implementation required\n", __FUNCTION__, - __FILE__, __LINE__); - return (-1); + uint32_t *ip; + + /* + * XXX: this implementation is untested, but should serve as a decent + * starting point. + */ + + /* + * Ensure that the offset is aligned on a compressed-instruction + * boundary. + */ + if ((rela->r_offset & (sizeof (uint16_t) - 1)) != 0) + return (-1); + + /* + * We only know about some specific relocation types. + * We also recognize relocation type NONE, since that gets used for + * relocations of USDT probes, and we might be re-processing a file. + */ + if (GELF_R_TYPE(rela->r_info) != R_RISCV_CALL && + GELF_R_TYPE(rela->r_info) != R_RISCV_CALL_PLT && + GELF_R_TYPE(rela->r_info) != R_RISCV_NONE) + return (-1); + + ip = (uint32_t *)(p + rela->r_offset); + + /* + * We may have already processed this object file in an earlier linker + * invocation. Check to see if the present instruction sequence matches + * the one we would install below. + */ + if (ip[0] == DT_OP_NOP && (ip[1] == DT_OP_NOP || ip[1] == DT_OP_RET)) + return (0); + + /* + * We expect a auipc+jalr pair, either from a call or a tail. + * - call: auipc x1 0; jalr x1, x1, 0 + * - tail: auipc x6 0; jalr x0, x6, 0 + */ + if (!DT_OP_IS_AUIPC(ip[0]) || !DT_OP_IS_JALR(ip[1])) + return (-1); + + /* + * On riscv, we do not have to differentiate between regular probes and + * is-enabled probes. Calls are to be converted into a no-op whereas + * tail calls should become a return. + */ + if (ip[1] == DT_OP_JALR_CALL) { + ip[0] = DT_OP_NOP; + ip[1] = DT_OP_NOP; + } else { + ip[0] = DT_OP_NOP; + ip[1] = DT_OP_RET; + } + + return (0); } #elif defined(__i386) || defined(__amd64) @@ -1167,9 +1240,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) if (dtp->dt_oflags & DTRACE_O_LP64) { eclass = ELFCLASS64; -#if defined(__mips__) - emachine1 = emachine2 = EM_MIPS; -#elif defined(__powerpc__) +#if defined(__powerpc__) emachine1 = emachine2 = EM_PPC64; #if !defined(_CALL_ELF) || _CALL_ELF == 1 uses_funcdesc = 1; @@ -1178,14 +1249,14 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) emachine1 = emachine2 = EM_AMD64; #elif defined(__aarch64__) emachine1 = emachine2 = EM_AARCH64; +#elif defined(__riscv) + emachine1 = emachine2 = EM_RISCV; #endif symsize = sizeof (Elf64_Sym); } else { eclass = ELFCLASS32; #if defined(__arm__) emachine1 = emachine2 = EM_ARM; -#elif defined(__mips__) - emachine1 = emachine2 = EM_MIPS; #elif defined(__powerpc__) emachine1 = emachine2 = EM_PPC; #elif defined(__i386) || defined(__amd64) @@ -1612,6 +1683,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) * invocation. */ if (rsym.st_shndx != SHN_ABS) { + rsym.st_info = GELF_ST_INFO(STB_WEAK, STT_FUNC); rsym.st_shndx = SHN_ABS; (void) gelf_update_sym(data_sym, ndx, &rsym); } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index b9408944f8c5..281c787de533 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -1129,33 +1129,21 @@ dt_module_getctflib(dtrace_hdl_t *dtp, dt_module_t *dmp, const char *name) * including the path. */ static void -#ifdef illumos -dt_module_update(dtrace_hdl_t *dtp, const char *name) -#else dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) -#endif { char fname[MAXPATHLEN]; struct stat64 st; int fd, err, bits; -#ifdef __FreeBSD__ struct module_stat ms; dt_kmodule_t *dkmp; uint_t h; int modid; -#endif - dt_module_t *dmp; const char *s; size_t shstrs; GElf_Shdr sh; Elf_Data *dp; Elf_Scn *sp; - -#ifdef illumos - (void) snprintf(fname, sizeof (fname), - "%s/%s/object", OBJFS_ROOT, name); -#else GElf_Ehdr ehdr; GElf_Phdr ph; char name[MAXPATHLEN]; @@ -1165,7 +1153,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) (void) strlcpy(name, k_stat->name, sizeof(name)); (void) strlcpy(fname, k_stat->pathname, sizeof(fname)); -#endif if ((fd = open(fname, O_RDONLY)) == -1 || fstat64(fd, &st) == -1 || (dmp = dt_module_create(dtp, name)) == NULL) { @@ -1174,6 +1161,9 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) return; } + (void) strlcpy(dmp->dm_file, fname, sizeof(dmp->dm_file)); + dmp->dm_modid = k_stat->id; + /* * Since the module can unload out from under us (and /system/object * will return ENOENT), tell libelf to cook the entire file now and @@ -1206,7 +1196,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) dt_module_destroy(dtp, dmp); return; } -#if defined(__FreeBSD__) mapbase = (uintptr_t)k_stat->address; gelf_getehdr(dmp->dm_elf, &ehdr); is_elf_obj = (ehdr.e_type == ET_REL); @@ -1219,7 +1208,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) return; } } -#endif /* * Iterate over the section headers locating various sections of * interest and use their attributes to flesh out the dt_module_t. @@ -1228,7 +1216,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL || (s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL) continue; /* skip any malformed sections */ -#if defined(__FreeBSD__) if (sh.sh_size == 0) continue; if (sh.sh_type == SHT_PROGBITS || sh.sh_type == SHT_NOBITS) { @@ -1240,7 +1227,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr; mapbase += sh.sh_size; } -#endif if (strcmp(s, ".text") == 0) { dmp->dm_text_size = sh.sh_size; dmp->dm_text_va = sh.sh_addr; @@ -1254,17 +1240,10 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) (dp = elf_getdata(sp, NULL)) != NULL) { bcopy(dp->d_buf, &dmp->dm_info, MIN(sh.sh_size, sizeof (dmp->dm_info))); - } else if (strcmp(s, ".filename") == 0 && - (dp = elf_getdata(sp, NULL)) != NULL) { - (void) strlcpy(dmp->dm_file, - dp->d_buf, sizeof (dmp->dm_file)); } } dmp->dm_flags |= DT_DM_KERNEL; -#ifdef illumos - dmp->dm_modid = (int)OBJFS_MODID(st.st_ino); -#else /* * Include .rodata and special sections into .text. * This depends on default section layout produced by GNU ld @@ -1285,12 +1264,10 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) } } #endif -#endif /* illumos */ if (dmp->dm_info.objfs_info_primary) dmp->dm_flags |= DT_DM_PRIMARY; -#ifdef __FreeBSD__ ms.version = sizeof(ms); for (modid = kldfirstmod(k_stat->id); modid > 0; modid = modnext(modid)) { @@ -1315,7 +1292,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) dkmp->dkm_module = dmp; dtp->dt_kmods[h] = dkmp; } -#endif dt_dprintf("opened %d-bit module %s (%s) [%d]\n", bits, dmp->dm_name, dmp->dm_file, dmp->dm_modid); diff --git a/cddl/compat/opensolaris/include/stdlib.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_oformat.h index 9ba32322c03b..bea7dbd19b4d 100644 --- a/cddl/compat/opensolaris/include/stdlib.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_oformat.h @@ -1,7 +1,8 @@ -/* - * Copyright (C) 2007 John Birrell <jb@freebsd.org> - * All rights reserved. - * +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Domagoj Stolfa + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -10,11 +11,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -22,16 +23,12 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ - * */ -#include_next <stdlib.h> - -#ifndef _COMPAT_OPENSOLARIS_STDLIB_H_ -#define _COMPAT_OPENSOLARIS_STDLIB_H_ +#ifndef _DT_OFORMAT_H_ +#define _DT_OFORMAT_H_ -#define getexecname getprogname +#undef NORETURN /* needed because libxo redefines it */ +#include <libxo/xo.h> -#endif +#endif /* _DT_OFORMAT_H_ */ diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index f55d488f4d91..8f8d20298e4c 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -59,6 +59,7 @@ #include <dt_printf.h> #include <dt_string.h> #include <dt_provider.h> +#include <dt_oformat.h> #ifndef illumos #include <sys/sysctl.h> #include <string.h> @@ -416,6 +417,8 @@ static const dt_ident_t _dtrace_globals[] = { &dt_idops_func, "void(int)" }, { "rand", DT_IDENT_FUNC, 0, DIF_SUBR_RAND, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "int()" }, +{ "regs", DT_IDENT_ARRAY, 0, DIF_VAR_REGS, DT_ATTR_STABCMN, DT_VERS_1_13, + &dt_idops_regs, NULL }, { "rindex", DT_IDENT_FUNC, 0, DIF_SUBR_RINDEX, DT_ATTR_STABCMN, DT_VERS_1_1, &dt_idops_func, "int(const char *, const char *, [int])" }, #ifdef illumos @@ -1113,6 +1116,15 @@ dt_vopen(int version, int flags, int *errp, */ if (err == ENOENT && modfind("dtraceall") < 0) { kldload("dtraceall"); /* ignore the error */ +#if __SIZEOF_LONG__ == 8 + if (modfind("linux64elf") >= 0) + kldload("systrace_linux"); + if (modfind("linuxelf") >= 0) + kldload("systrace_linux32"); +#else + if (modfind("linuxelf") >= 0) + kldload("systrace_linux"); +#endif dtfd = open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC); err = errno; } @@ -1171,6 +1183,7 @@ alloc: dtp->dt_version = version; dtp->dt_fd = dtfd; dtp->dt_ftfd = ftfd; + dtp->dt_kinstfd = -1; dtp->dt_fterr = fterr; dtp->dt_cdefs_fd = -1; dtp->dt_ddefs_fd = -1; @@ -1679,6 +1692,8 @@ dtrace_close(dtrace_hdl_t *dtp) (void) close(dtp->dt_fd); if (dtp->dt_ftfd != -1) (void) close(dtp->dt_ftfd); + if (dtp->dt_kinstfd != -1) + (void) close(dtp->dt_kinstfd); if (dtp->dt_cdefs_fd != -1) (void) close(dtp->dt_cdefs_fd); if (dtp->dt_ddefs_fd != -1) @@ -1722,6 +1737,8 @@ dtrace_close(dtrace_hdl_t *dtp) free(dtp->dt_kmods); #endif free(dtp->dt_provs); + + xo_finish(); free(dtp); } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c index ce13659f1685..1e7a8115c960 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c @@ -43,6 +43,7 @@ #include <dt_impl.h> #include <dt_string.h> +#include <dt_oformat.h> static int dt_opt_agg(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) @@ -724,6 +725,18 @@ dt_opt_size(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) } static int +dt_opt_oformat(dtrace_hdl_t *dtp, const char *arg, uintptr_t option __unused) +{ + if (arg == NULL) + return (dt_set_errno(dtp, EDT_BADOPTVAL)); + + if (xo_set_options(NULL, arg) < 0) + return (dt_set_errno(dtp, EDT_BADOPTVAL)); + + return (dtrace_oformat_configure(dtp)); +} + +static int dt_opt_rate(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) { char *end; @@ -1046,6 +1059,7 @@ static const dt_option_t _dtrace_rtoptions[] = { { "jstackframes", dt_opt_runtime, DTRACEOPT_JSTACKFRAMES }, { "jstackstrsize", dt_opt_size, DTRACEOPT_JSTACKSTRSIZE }, { "nspec", dt_opt_runtime, DTRACEOPT_NSPEC }, + { "oformat", dt_opt_oformat, 0 }, { "specsize", dt_opt_size, DTRACEOPT_SPECSIZE }, { "stackframes", dt_opt_runtime, DTRACEOPT_STACKFRAMES }, { "statusrate", dt_opt_rate, DTRACEOPT_STATUSRATE }, diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c index f028f99ccf64..2b85dd2b26b6 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c @@ -4767,8 +4767,8 @@ dt_printd(dt_node_t *dnp, FILE *fp, int depth) dt_printd(dnp->dn_pred, fp, 0); (void) fprintf(fp, "/\n"); } - (void) fprintf(fp, "{\n"); + (void) fprintf(fp, "{\n"); for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) dt_printd(arg, fp, depth + 1); (void) fprintf(fp, "}\n"); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c index 97da0c3a5ac2..9bbd12e5544f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c @@ -27,6 +27,7 @@ */ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2023, Domagoj Stolfa. All rights reserved. */ /* @@ -82,6 +83,7 @@ #include <dt_printf.h> #include <dt_string.h> #include <dt_impl.h> +#include <dt_oformat.h> /* determines whether the given integer CTF encoding is a character */ #define CTF_IS_CHAR(e) \ @@ -101,8 +103,10 @@ typedef struct dt_printarg { int pa_depth; /* member depth */ int pa_nest; /* nested array depth */ FILE *pa_file; /* output file */ + const char *pa_object; /* object name */ } dt_printarg_t; +static int dt_format_member(const char *, ctf_id_t, ulong_t, int, void *); static int dt_print_member(const char *, ctf_id_t, ulong_t, int, void *); /* @@ -189,7 +193,10 @@ print_bitfield(dt_printarg_t *pap, ulong_t off, ctf_encoding_t *ep) value >>= shift; value &= mask; - (void) fprintf(fp, "%#llx", (u_longlong_t)value); + xo_emit("{:value/%#llx}", (u_longlong_t)value); + + /* Flush in order to ensure output is aligned properly */ + xo_flush(); } /* @@ -200,24 +207,25 @@ dt_print_hex(FILE *fp, caddr_t addr, size_t size) { switch (size) { case sizeof (uint8_t): - (void) fprintf(fp, "%#x", *(uint8_t *)addr); + xo_emit("{:value/%#x}", *(uint8_t *)addr); break; case sizeof (uint16_t): - /* LINTED - alignment */ - (void) fprintf(fp, "%#x", *(uint16_t *)addr); + xo_emit("{:value/%#x}", *(uint16_t *)addr); break; case sizeof (uint32_t): - /* LINTED - alignment */ - (void) fprintf(fp, "%#x", *(uint32_t *)addr); + xo_emit("{:value/%#x}", *(uint32_t *)addr); break; case sizeof (uint64_t): - (void) fprintf(fp, "%#llx", - /* LINTED - alignment */ + xo_emit("{:value/%#llx}", (unsigned long long)*(uint64_t *)addr); break; default: - (void) fprintf(fp, "<invalid size %u>", (uint_t)size); + xo_emit("<{:warning} {:size/%u}>", "invalid size", + (uint_t)size); } + + /* Flush in order to ensure output is aligned properly */ + xo_flush(); } /* @@ -229,12 +237,16 @@ dt_print_int(ctf_id_t base, ulong_t off, dt_printarg_t *pap) { FILE *fp = pap->pa_file; ctf_file_t *ctfp = pap->pa_ctfp; + dtrace_hdl_t *dtp = pap->pa_dtp; ctf_encoding_t e; size_t size; caddr_t addr = pap->pa_addr + off / NBBY; if (ctf_type_encoding(ctfp, base, &e) == CTF_ERR) { - (void) fprintf(fp, "<unknown encoding>"); + xo_emit("<{:warning}>", "unknown encoding"); + + /* Flush in order to ensure output is aligned properly */ + xo_flush(); return; } @@ -243,7 +255,8 @@ dt_print_int(ctf_id_t base, ulong_t off, dt_printarg_t *pap) * would be found. */ if (e.cte_format & CTF_INT_VARARGS) { - (void) fprintf(fp, "..."); + if (!dtp->dt_oformat) + (void)fprintf(fp, "..."); return; } @@ -263,11 +276,14 @@ dt_print_int(ctf_id_t base, ulong_t off, dt_printarg_t *pap) if (CTF_IS_CHAR(e)) { char c = *(char *)addr; if (isprint(c)) - (void) fprintf(fp, "'%c'", c); + xo_emit("'{:value/%c}'", c); else if (c == 0) - (void) fprintf(fp, "'\\0'"); + xo_emit("'\\{:value/0}'"); else - (void) fprintf(fp, "'\\%03o'", c); + xo_emit("'\\{:value/%03o}'", c); + + /* Flush in order to ensure output is aligned properly */ + xo_flush(); return; } @@ -285,22 +301,20 @@ dt_print_float(ctf_id_t base, ulong_t off, dt_printarg_t *pap) ctf_file_t *ctfp = pap->pa_ctfp; ctf_encoding_t e; caddr_t addr = pap->pa_addr + off / NBBY; + dtrace_hdl_t *dtp = pap->pa_dtp; if (ctf_type_encoding(ctfp, base, &e) == 0) { if (e.cte_format == CTF_FP_SINGLE && e.cte_bits == sizeof (float) * NBBY) { - /* LINTED - alignment */ - (void) fprintf(fp, "%+.7e", *((float *)addr)); + xo_emit("{:value/%+.7e}", *((float *)addr)); } else if (e.cte_format == CTF_FP_DOUBLE && e.cte_bits == sizeof (double) * NBBY) { - /* LINTED - alignment */ - (void) fprintf(fp, "%+.7e", *((double *)addr)); + xo_emit("{:value/%+.7e}", *((double *)addr)); } else if (e.cte_format == CTF_FP_LDOUBLE && e.cte_bits == sizeof (long double) * NBBY) { - /* LINTED - alignment */ - (void) fprintf(fp, "%+.16LE", *((long double *)addr)); + xo_emit("{:value/%+.16LE}", *((long double *)addr)); } else { - (void) fprintf(fp, "<unknown encoding>"); + xo_emit("<{:warning}>", "unknown encoding"); } } } @@ -329,8 +343,7 @@ dt_print_ptr(ctf_id_t base, ulong_t off, dt_printarg_t *pap) if (dtrace_lookup_by_addr(pap->pa_dtp, pc, &sym, &dts) != 0) { dt_print_hex(fp, addr, size); } else { - (void) fprintf(fp, "%s`%s", dts.dts_object, - dts.dts_name); + xo_emit("{:value/%s`%s}", dts.dts_object, dts.dts_name); } } } @@ -367,6 +380,7 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg_t *pap) FILE *fp = pap->pa_file; ctf_file_t *ctfp = pap->pa_ctfp; caddr_t addr = pap->pa_addr + off / NBBY; + char *str; ctf_arinfo_t car; ssize_t eltsize; ctf_encoding_t e; @@ -374,16 +388,18 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg_t *pap) boolean_t isstring; int kind; ctf_id_t rtype; + dtrace_hdl_t *dtp = pap->pa_dtp; if (ctf_array_info(ctfp, base, &car) == CTF_ERR) { - (void) fprintf(fp, "%p", (void *)addr); + xo_emit("{:value/%p}", (void *)addr); return; } if ((eltsize = ctf_type_size(ctfp, car.ctr_contents)) < 0 || (rtype = ctf_type_resolve(ctfp, car.ctr_contents)) == CTF_ERR || (kind = ctf_type_kind(ctfp, rtype)) == CTF_ERR) { - (void) fprintf(fp, "<invalid type %lu>", car.ctr_contents); + xo_emit("<{:warning} {:type-identifier/%lu}>", "invalid type", + car.ctr_contents); return; } @@ -411,18 +427,44 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg_t *pap) * * As D will internally represent this as a char[256] array. */ - if (!isstring || pap->pa_depth != 0) - (void) fprintf(fp, "[ "); + if (dtp->dt_oformat) { + if (!isstring) + xo_open_list("value"); + else { + str = malloc(car.ctr_nelems); + if (str == NULL) + return; + *str = 0; + } + } else { + if (!isstring || pap->pa_depth != 0) + (void)fprintf(fp, "[ "); - if (isstring) - (void) fprintf(fp, "\""); + if (isstring) + (void)fprintf(fp, "\""); + } for (i = 0; i < car.ctr_nelems; i++) { if (isstring) { char c = *((char *)addr + eltsize * i); - if (c == '\0') + if (c == '\0') { + if (dtp->dt_oformat) + str[i] = 0; break; - (void) fprintf(fp, "%c", c); + } + + if (dtp->dt_oformat) + str[i] = c; + else + (void)fprintf(fp, "%c", c); + } else if (dtp->dt_oformat) { + dt_printarg_t pa = *pap; + pa.pa_nest += pap->pa_depth + 1; + pa.pa_depth = 0; + pa.pa_addr = addr + eltsize * i; + + (void) ctf_type_visit(ctfp, car.ctr_contents, + dt_format_member, &pa); } else { /* * Recursively invoke ctf_type_visit() on each member. @@ -444,15 +486,24 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg_t *pap) } } - if (isstring) - (void) fprintf(fp, "\""); - - if (!isstring || pap->pa_depth != 0) { - if (CTF_IS_STRUCTLIKE(kind)) - dt_print_indent(pap); - else - (void) fprintf(fp, " "); - (void) fprintf(fp, "]"); + if (dtp->dt_oformat) { + if (!isstring) + xo_close_list("value"); + else { + xo_emit("{:value/%s}", str); + free(str); + } + } else { + if (isstring) + (void)fprintf(fp, "\""); + + if (!isstring || pap->pa_depth != 0) { + if (CTF_IS_STRUCTLIKE(kind)) + dt_print_indent(pap); + else + (void)fprintf(fp, " "); + (void)fprintf(fp, "]"); + } } } @@ -463,7 +514,8 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg_t *pap) static void dt_print_structlike(ctf_id_t id, ulong_t off, dt_printarg_t *pap) { - (void) fprintf(pap->pa_file, "{"); + if (pap->pa_dtp->dt_oformat == DTRACE_OFORMAT_TEXT) + (void)fprintf(pap->pa_file, "{"); } /* @@ -480,6 +532,7 @@ dt_print_enum(ctf_id_t base, ulong_t off, dt_printarg_t *pap) ssize_t size; caddr_t addr = pap->pa_addr + off / NBBY; int value = 0; + dtrace_hdl_t *dtp = pap->pa_dtp; /* * The C standard says that an enum will be at most the sizeof (int). @@ -498,14 +551,19 @@ dt_print_enum(ctf_id_t base, ulong_t off, dt_printarg_t *pap) value = *(int32_t *)addr; break; default: - (void) fprintf(fp, "<invalid enum size %u>", (uint_t)size); + xo_emit("<{:warning} {:size/%u}>", "invalid enum size", + (uint_t)size); return; } - if ((ename = ctf_enum_name(ctfp, base, value)) != NULL) - (void) fprintf(fp, "%s", ename); - else - (void) fprintf(fp, "%d", value); + if ((ename = ctf_enum_name(ctfp, base, value)) != NULL) { + xo_emit("{:value/%s}", ename); + } else { + xo_emit("{:value/%d}", value); + } + + /* Flush in order to ensure output is aligned properly */ + xo_flush(); } /* @@ -516,7 +574,8 @@ dt_print_enum(ctf_id_t base, ulong_t off, dt_printarg_t *pap) static void dt_print_tag(ctf_id_t base, ulong_t off, dt_printarg_t *pap) { - (void) fprintf(pap->pa_file, "<forward decl>"); + if (pap->pa_dtp->dt_oformat == DTRACE_OFORMAT_TEXT) + (void)fprintf(pap->pa_file, "<forward decl>"); } typedef void dt_printarg_f(ctf_id_t, ulong_t, dt_printarg_t *); @@ -533,6 +592,46 @@ static dt_printarg_f *const dt_printfuncs[] = { dt_print_tag /* CTF_K_FORWARD */ }; +static int +dt_format_member(const char *name, ctf_id_t id, ulong_t off, int depth, + void *data) +{ + char type[DT_TYPE_NAMELEN]; + int kind; + dt_printarg_t *pap = data; + FILE *fp = pap->pa_file; + ctf_file_t *ctfp = pap->pa_ctfp; + boolean_t arraymember; + boolean_t brief; + ctf_encoding_t e; + ctf_id_t rtype; + + if ((rtype = ctf_type_resolve(ctfp, id)) == CTF_ERR || + (kind = ctf_type_kind(ctfp, rtype)) == CTF_ERR || + kind < CTF_K_INTEGER || kind > CTF_K_FORWARD) { + xo_emit("{:name/%s} <{:warning} {:type-identifier/%lu}>" + " {:value/0x%llx}", + name, "invalid type", id, pap->pa_addr); + return (0); + } + + dt_print_type_name(ctfp, id, type, sizeof (type)); + xo_open_instance("type"); + if (pap->pa_object) { + xo_emit("{:object-name/%s}", pap->pa_object); + /* Clear the object to avoid duplication */ + pap->pa_object = NULL; + } + + if (*name != 0) + xo_emit("{:member-name/%s}", name); + xo_emit("{:name/%s} {:ctfid/%ld}", type, id); + dt_printfuncs[kind - 1](rtype, off, pap); + + xo_close_instance("type"); + return (0); +} + /* * Print one member of a structure. This callback is invoked from * ctf_type_visit() recursively. @@ -634,16 +733,12 @@ dt_print_member(const char *name, ctf_id_t id, ulong_t off, int depth, return (0); } -/* - * Main print function invoked by dt_consume_cpu(). - */ -int -dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename, - caddr_t addr, size_t len) +static ctf_id_t +dt_print_prepare(dtrace_hdl_t *dtp, const char *typename, caddr_t addr, + size_t len, dt_printarg_t *pa) { const char *s; char *object; - dt_printarg_t pa; ctf_id_t id; dt_module_t *dmp; ctf_file_t *ctfp; @@ -661,20 +756,20 @@ dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename, ; if (*s != '`') - return (0); + return (CTF_ERR); object = alloca(s - typename + 1); bcopy(typename, object, s - typename); object[s - typename] = '\0'; dmp = dt_module_lookup_by_name(dtp, object); if (dmp == NULL) - return (0); + return (CTF_ERR); if (dmp->dm_pid != 0) { libid = atoi(s + 1); s = strchr(s + 1, '`'); if (s == NULL || libid > dmp->dm_nctflibs) - return (0); + return (CTF_ERR); ctfp = dmp->dm_libctfp[libid]; } else { ctfp = dt_module_getctf(dtp, dmp); @@ -688,18 +783,63 @@ dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename, * work. */ if (ctfp == NULL || ctf_type_kind(ctfp, id) == CTF_ERR) + return (CTF_ERR); + + pa->pa_dtp = dtp; + pa->pa_addr = addr; + pa->pa_ctfp = ctfp; + pa->pa_nest = 0; + pa->pa_depth = 0; + pa->pa_object = strdup(object); + return (id); +} + +/* + * Main print function invoked by dt_consume_cpu(). + */ +int +dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename, + caddr_t addr, size_t len) +{ + dt_printarg_t pa; + ctf_id_t id; + + id = dt_print_prepare(dtp, typename, addr, len, &pa); + if (id == CTF_ERR) return (0); - /* setup the print structure and kick off the main print routine */ - pa.pa_dtp = dtp; - pa.pa_addr = addr; - pa.pa_ctfp = ctfp; - pa.pa_nest = 0; - pa.pa_depth = 0; pa.pa_file = fp; (void) ctf_type_visit(pa.pa_ctfp, id, dt_print_member, &pa); dt_print_trailing_braces(&pa, 0); + dt_free(dtp, (void *)pa.pa_object); + + return (len); +} + +/* + * Main format function invoked by dt_consume_cpu(). + */ +int +dtrace_format_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename, + caddr_t addr, size_t len) +{ + dt_printarg_t pa; + ctf_id_t id; + char toplevel[1024]; + + id = dt_print_prepare(dtp, typename, addr, len, &pa); + if (id == CTF_ERR) + return (0); + + if (ctf_type_name(pa.pa_ctfp, id, toplevel, sizeof(toplevel)) < 0) + return (0); + + xo_open_list("type"); + (void) ctf_type_visit(pa.pa_ctfp, id, dt_format_member, &pa); + xo_close_list("type"); + dt_free(dtp, (void *)pa.pa_object); return (len); } + diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c index 57a7db4ad0fd..c33ae955ba61 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c @@ -317,8 +317,7 @@ pfprint_fp(dtrace_hdl_t *dtp, FILE *fp, const char *format, case sizeof (double): return (dt_printf(dtp, fp, format, *((double *)addr) / n)); -#if !defined(__arm__) && !defined(__powerpc__) && \ - !defined(__mips__) && !defined(__riscv) +#if !defined(__arm__) && !defined(__powerpc__) && !defined(__riscv) case sizeof (long double): return (dt_printf(dtp, fp, format, *((long double *)addr) / ldn)); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.h index b3b5b8b94bf6..58e345b204ac 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.h @@ -21,6 +21,7 @@ */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2023 Domagoj Stolfa. All rights reserved. * Use is subject to license terms. */ @@ -128,6 +129,11 @@ extern int dt_print_ustack(dtrace_hdl_t *, FILE *, extern int dt_print_mod(dtrace_hdl_t *, FILE *, const char *, caddr_t); extern int dt_print_umod(dtrace_hdl_t *, FILE *, const char *, caddr_t); +extern int dt_format_stack(dtrace_hdl_t *, caddr_t, int, int); +extern int dt_format_ustack(dtrace_hdl_t *, caddr_t, uint64_t); +extern int dt_format_mod(dtrace_hdl_t *, caddr_t); +extern int dt_format_umod(dtrace_hdl_t *, caddr_t); + #ifdef __cplusplus } #endif diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c index 34bcc15b9ac7..b32dcea1f8ba 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c @@ -80,10 +80,8 @@ * up using this condition and will then call the client handler as necessary. */ +#include <sys/syscall.h> #include <sys/wait.h> -#ifdef illumos -#include <sys/lwp.h> -#endif #include <strings.h> #include <signal.h> #include <assert.h> @@ -93,14 +91,10 @@ #include <dt_pid.h> #include <dt_impl.h> -#ifndef illumos -#include <sys/syscall.h> #include <libproc_compat.h> -#define SYS_forksys SYS_fork -#endif #define IS_SYS_EXEC(w) (w == SYS_execve) -#define IS_SYS_FORK(w) (w == SYS_vfork || w == SYS_forksys) +#define IS_SYS_FORK(w) (w == SYS_vfork || w == SYS_fork) static dt_bkpt_t * dt_proc_bpcreate(dt_proc_t *dpr, uintptr_t addr, dt_bkpt_f *func, void *data) @@ -147,38 +141,23 @@ dt_proc_bpdestroy(dt_proc_t *dpr, int delbkpts) static void dt_proc_bpmatch(dtrace_hdl_t *dtp, dt_proc_t *dpr) { -#ifdef illumos - const lwpstatus_t *psp = &Pstatus(dpr->dpr_proc)->pr_lwp; -#else unsigned long pc; -#endif dt_bkpt_t *dbp; assert(DT_MUTEX_HELD(&dpr->dpr_lock)); -#ifndef illumos proc_regget(dpr->dpr_proc, REG_PC, &pc); proc_bkptregadj(&pc); -#endif for (dbp = dt_list_next(&dpr->dpr_bps); dbp != NULL; dbp = dt_list_next(dbp)) { -#ifdef illumos - if (psp->pr_reg[R_PC] == dbp->dbp_addr) - break; -#else if (pc == dbp->dbp_addr) break; -#endif } if (dbp == NULL) { dt_dprintf("pid %d: spurious breakpoint wakeup for %lx\n", -#ifdef illumos - (int)dpr->dpr_pid, (ulong_t)psp->pr_reg[R_PC]); -#else (int)dpr->dpr_pid, pc); -#endif return; } @@ -346,12 +325,8 @@ dt_proc_rdwatch(dt_proc_t *dpr, rd_event_e event, const char *evname) } (void) dt_proc_bpcreate(dpr, rdn.u.bptaddr, -#ifdef illumos - (dt_bkpt_f *)dt_proc_rdevent, (void *)evname); -#else /* XXX ugly */ (dt_bkpt_f *)dt_proc_rdevent, __DECONST(void *, evname)); -#endif } /* @@ -361,34 +336,18 @@ dt_proc_rdwatch(dt_proc_t *dpr, rd_event_e event, const char *evname) static void dt_proc_attach(dt_proc_t *dpr, int exec) { -#ifdef illumos - const pstatus_t *psp = Pstatus(dpr->dpr_proc); -#endif rd_err_e err; GElf_Sym sym; assert(DT_MUTEX_HELD(&dpr->dpr_lock)); if (exec) { -#ifdef illumos - if (psp->pr_lwp.pr_errno != 0) - return; /* exec failed: nothing needs to be done */ -#endif dt_proc_bpdestroy(dpr, B_FALSE); -#ifdef illumos - Preset_maps(dpr->dpr_proc); -#endif } if ((dpr->dpr_rtld = Prd_agent(dpr->dpr_proc)) != NULL && (err = rd_event_enable(dpr->dpr_rtld, B_TRUE)) == RD_OK) { -#ifdef illumos - dt_proc_rdwatch(dpr, RD_PREINIT, "RD_PREINIT"); -#endif dt_proc_rdwatch(dpr, RD_POSTINIT, "RD_POSTINIT"); -#ifdef illumos - dt_proc_rdwatch(dpr, RD_DLACTIVITY, "RD_DLACTIVITY"); -#endif } else { dt_dprintf("pid %d: failed to enable rtld events: %s\n", (int)dpr->dpr_pid, dpr->dpr_rtld ? rd_errstr(err) : @@ -407,84 +366,6 @@ dt_proc_attach(dt_proc_t *dpr, int exec) } } -/* - * Wait for a stopped process to be set running again by some other debugger. - * This is typically not required by /proc-based debuggers, since the usual - * model is that one debugger controls one victim. But DTrace, as usual, has - * its own needs: the stop() action assumes that prun(1) or some other tool - * will be applied to resume the victim process. This could be solved by - * adding a PCWRUN directive to /proc, but that seems like overkill unless - * other debuggers end up needing this functionality, so we implement a cheap - * equivalent to PCWRUN using the set of existing kernel mechanisms. - * - * Our intent is really not just to wait for the victim to run, but rather to - * wait for it to run and then stop again for a reason other than the current - * PR_REQUESTED stop. Since PCWSTOP/Pstopstatus() can be applied repeatedly - * to a stopped process and will return the same result without affecting the - * victim, we can just perform these operations repeatedly until Pstate() - * changes, the representative LWP ID changes, or the stop timestamp advances. - * dt_proc_control() will then rediscover the new state and continue as usual. - * When the process is still stopped in the same exact state, we sleep for a - * brief interval before waiting again so as not to spin consuming CPU cycles. - */ -static void -dt_proc_waitrun(dt_proc_t *dpr) -{ - printf("%s:%s(%d): not implemented\n", __FUNCTION__, __FILE__, - __LINE__); -#ifdef DOODAD - struct ps_prochandle *P = dpr->dpr_proc; - const lwpstatus_t *psp = &Pstatus(P)->pr_lwp; - - int krflag = psp->pr_flags & (PR_KLC | PR_RLC); - timestruc_t tstamp = psp->pr_tstamp; - lwpid_t lwpid = psp->pr_lwpid; - - const long wstop = PCWSTOP; - int pfd = Pctlfd(P); - - assert(DT_MUTEX_HELD(&dpr->dpr_lock)); - assert(psp->pr_flags & PR_STOPPED); - assert(Pstate(P) == PS_STOP); - - /* - * While we are waiting for the victim to run, clear PR_KLC and PR_RLC - * so that if the libdtrace client is killed, the victim stays stopped. - * dt_proc_destroy() will also observe this and perform PRELEASE_HANG. - */ - (void) Punsetflags(P, krflag); - Psync(P); - - (void) pthread_mutex_unlock(&dpr->dpr_lock); - - while (!dpr->dpr_quit) { - if (write(pfd, &wstop, sizeof (wstop)) == -1 && errno == EINTR) - continue; /* check dpr_quit and continue waiting */ - - (void) pthread_mutex_lock(&dpr->dpr_lock); - (void) Pstopstatus(P, PCNULL, 0); - psp = &Pstatus(P)->pr_lwp; - - /* - * If we've reached a new state, found a new representative, or - * the stop timestamp has changed, restore PR_KLC/PR_RLC to its - * original setting and then return with dpr_lock held. - */ - if (Pstate(P) != PS_STOP || psp->pr_lwpid != lwpid || - bcmp(&psp->pr_tstamp, &tstamp, sizeof (tstamp)) != 0) { - (void) Psetflags(P, krflag); - Psync(P); - return; - } - - (void) pthread_mutex_unlock(&dpr->dpr_lock); - (void) poll(NULL, 0, MILLISEC / 2); - } - - (void) pthread_mutex_lock(&dpr->dpr_lock); -#endif -} - typedef struct dt_proc_control_data { dtrace_hdl_t *dpcd_hdl; /* DTrace handle */ dt_proc_t *dpcd_proc; /* proccess to control */ @@ -511,12 +392,6 @@ dt_proc_control(void *arg) dt_proc_hash_t *dph = dtp->dt_procs; struct ps_prochandle *P = dpr->dpr_proc; int pid = dpr->dpr_pid; - -#ifdef illumos - int pfd = Pctlfd(P); - - const long wstop = PCWSTOP; -#endif int notify = B_FALSE; /* @@ -534,44 +409,14 @@ dt_proc_control(void *arg) */ (void) pthread_mutex_lock(&dpr->dpr_lock); -#ifdef illumos - (void) Punsetflags(P, PR_ASYNC); /* require synchronous mode */ - (void) Psetflags(P, PR_BPTADJ); /* always adjust eip on x86 */ - (void) Punsetflags(P, PR_FORK); /* do not inherit on fork */ - - (void) Pfault(P, FLTBPT, B_TRUE); /* always trace breakpoints */ - (void) Pfault(P, FLTTRACE, B_TRUE); /* always trace single-step */ - - /* - * We must trace exit from exec() system calls so that if the exec is - * successful, we can reset our breakpoints and re-initialize libproc. - */ - (void) Psysexit(P, SYS_execve, B_TRUE); - - /* - * We must trace entry and exit for fork() system calls in order to - * disable our breakpoints temporarily during the fork. We do not set - * the PR_FORK flag, so if fork succeeds the child begins executing and - * does not inherit any other tracing behaviors or a control thread. - */ - (void) Psysentry(P, SYS_vfork, B_TRUE); - (void) Psysexit(P, SYS_vfork, B_TRUE); - (void) Psysentry(P, SYS_forksys, B_TRUE); - (void) Psysexit(P, SYS_forksys, B_TRUE); - - Psync(P); /* enable all /proc changes */ -#endif dt_proc_attach(dpr, B_FALSE); /* enable rtld breakpoints */ /* - * If PR_KLC is set, we created the process; otherwise we grabbed it. - * Check for an appropriate stop request and wait for dt_proc_continue. + * If DT_CLOSE_KILL is set, we created the process; otherwise we + * grabbed it. Check for an appropriate stop request and wait for + * dt_proc_continue. */ -#ifdef illumos - if (Pstatus(P)->pr_flags & PR_KLC) -#else - if (proc_getflags(P) & PR_KLC) -#endif + if (dpr->dpr_close == DT_CLOSE_KILL) dt_proc_stop(dpr, DT_PROC_STOP_CREATE); else dt_proc_stop(dpr, DT_PROC_STOP_GRAB); @@ -595,55 +440,21 @@ dt_proc_control(void *arg) while (!dpr->dpr_quit) { const lwpstatus_t *psp; -#ifdef illumos - if (write(pfd, &wstop, sizeof (wstop)) == -1 && errno == EINTR) - continue; /* check dpr_quit and continue waiting */ -#else /* Wait for the process to report status. */ proc_wstatus(P); if (errno == EINTR) continue; /* check dpr_quit and continue waiting */ -#endif (void) pthread_mutex_lock(&dpr->dpr_lock); -#ifdef illumos -pwait_locked: - if (Pstopstatus(P, PCNULL, 0) == -1 && errno == EINTR) { - (void) pthread_mutex_unlock(&dpr->dpr_lock); - continue; /* check dpr_quit and continue waiting */ - } -#endif - switch (Pstate(P)) { case PS_STOP: -#ifdef illumos - psp = &Pstatus(P)->pr_lwp; -#else psp = proc_getlwpstatus(P); -#endif dt_dprintf("pid %d: proc stopped showing %d/%d\n", pid, psp->pr_why, psp->pr_what); /* - * If the process stops showing PR_REQUESTED, then the - * DTrace stop() action was applied to it or another - * debugging utility (e.g. pstop(1)) asked it to stop. - * In either case, the user's intention is for the - * process to remain stopped until another external - * mechanism (e.g. prun(1)) is applied. So instead of - * setting the process running ourself, we wait for - * someone else to do so. Once that happens, we return - * to our normal loop waiting for an event of interest. - */ - if (psp->pr_why == PR_REQUESTED) { - dt_proc_waitrun(dpr); - (void) pthread_mutex_unlock(&dpr->dpr_lock); - continue; - } - - /* * If the process stops showing one of the events that * we are tracing, perform the appropriate response. * Note that we ignore PR_SUSPENDED, PR_CHECKPOINT, and @@ -666,11 +477,6 @@ pwait_locked: break; case PS_LOST: -#ifdef illumos - if (Preopen(P) == 0) - goto pwait_locked; -#endif - dt_dprintf("pid %d: proc lost: %s\n", pid, strerror(errno)); @@ -685,9 +491,19 @@ pwait_locked: break; } - if (Pstate(P) != PS_UNDEAD && Psetrun(P, 0, 0) == -1) { - dt_dprintf("pid %d: failed to set running: %s\n", - (int)dpr->dpr_pid, strerror(errno)); + if (Pstate(P) != PS_UNDEAD) { + if (dpr->dpr_quit && dpr->dpr_close == DT_CLOSE_KILL) { + /* + * We're about to kill the child, so don't + * bother resuming it. In some cases, such as + * an initialization error, we shouldn't have + * started it in the first place, so letting it + * run could be harmful. + */ + } else if (Psetrun(P, 0, 0) == -1) { + dt_dprintf("pid %d: failed to set running: " + "%s\n", (int)dpr->dpr_pid, strerror(errno)); + } } (void) pthread_mutex_unlock(&dpr->dpr_lock); @@ -739,11 +555,7 @@ dt_proc_t * dt_proc_lookup(dtrace_hdl_t *dtp, struct ps_prochandle *P, int remove) { dt_proc_hash_t *dph = dtp->dt_procs; -#ifdef illumos - pid_t pid = Pstatus(P)->pr_pid; -#else pid_t pid = proc_getpid(P); -#endif dt_proc_t *dpr, **dpp = &dph->dph_hash[pid & (dph->dph_hashlen - 1)]; for (dpr = *dpp; dpr != NULL; dpr = dpr->dpr_hash) { @@ -772,28 +584,15 @@ dt_proc_destroy(dtrace_hdl_t *dtp, struct ps_prochandle *P) assert(dpr != NULL); - /* - * If neither PR_KLC nor PR_RLC is set, then the process is stopped by - * an external debugger and we were waiting in dt_proc_waitrun(). - * Leave the process in this condition using PRELEASE_HANG. - */ -#ifdef illumos - if (!(Pstatus(dpr->dpr_proc)->pr_flags & (PR_KLC | PR_RLC))) { -#else - if (!(proc_getflags(dpr->dpr_proc) & (PR_KLC | PR_RLC))) { -#endif - dt_dprintf("abandoning pid %d\n", (int)dpr->dpr_pid); - rflag = PRELEASE_HANG; -#ifdef illumos - } else if (Pstatus(dpr->dpr_proc)->pr_flags & PR_KLC) { -#else - } else if (proc_getflags(dpr->dpr_proc) & PR_KLC) { -#endif + switch (dpr->dpr_close) { + case DT_CLOSE_KILL: dt_dprintf("killing pid %d\n", (int)dpr->dpr_pid); - rflag = PRELEASE_KILL; /* apply kill-on-last-close */ - } else { + rflag = PRELEASE_KILL; + break; + case DT_CLOSE_RUN: dt_dprintf("releasing pid %d\n", (int)dpr->dpr_pid); - rflag = 0; /* apply run-on-last-close */ + rflag = 0; + break; } if (dpr->dpr_tid) { @@ -813,11 +612,7 @@ dt_proc_destroy(dtrace_hdl_t *dtp, struct ps_prochandle *P) */ (void) pthread_mutex_lock(&dpr->dpr_lock); dpr->dpr_quit = B_TRUE; -#ifdef illumos - (void) _lwp_kill(dpr->dpr_tid, SIGCANCEL); -#else pthread_kill(dpr->dpr_tid, SIGTHR); -#endif /* * If the process is currently idling in dt_proc_stop(), re- @@ -885,11 +680,7 @@ dt_proc_create_thread(dtrace_hdl_t *dtp, dt_proc_t *dpr, uint_t stop) (void) sigfillset(&nset); (void) sigdelset(&nset, SIGABRT); /* unblocked for assert() */ -#ifdef illumos - (void) sigdelset(&nset, SIGCANCEL); /* see dt_proc_destroy() */ -#else (void) sigdelset(&nset, SIGUSR1); /* see dt_proc_destroy() */ -#endif data.dpcd_hdl = dtp; data.dpcd_proc = dpr; @@ -917,14 +708,8 @@ dt_proc_create_thread(dtrace_hdl_t *dtp, dt_proc_t *dpr, uint_t stop) * small amount of useful information to help figure it out. */ if (dpr->dpr_done) { -#ifdef illumos - const psinfo_t *prp = Ppsinfo(dpr->dpr_proc); - int stat = prp ? prp->pr_wstat : 0; - int pid = dpr->dpr_pid; -#else int stat = proc_getwstat(dpr->dpr_proc); int pid = proc_getpid(dpr->dpr_proc); -#endif if (proc_state(dpr->dpr_proc) == PS_LOST) { (void) dt_proc_error(dpr->dpr_hdl, dpr, "failed to control pid %d: process exec'd " @@ -968,29 +753,15 @@ dt_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv, (void) pthread_mutex_init(&dpr->dpr_lock, NULL); (void) pthread_cond_init(&dpr->dpr_cv, NULL); -#ifdef illumos - dpr->dpr_proc = Pxcreate(file, argv, dtp->dt_proc_env, &err, NULL, 0); - if (dpr->dpr_proc == NULL) { - return (dt_proc_error(dtp, dpr, - "failed to execute %s: %s\n", file, Pcreate_error(err))); - } -#else if ((err = proc_create(file, argv, dtp->dt_proc_env, pcf, child_arg, &dpr->dpr_proc)) != 0) { return (dt_proc_error(dtp, dpr, "failed to execute %s: %s\n", file, Pcreate_error(err))); } -#endif dpr->dpr_hdl = dtp; -#ifdef illumos - dpr->dpr_pid = Pstatus(dpr->dpr_proc)->pr_pid; -#else dpr->dpr_pid = proc_getpid(dpr->dpr_proc); -#endif - - (void) Punsetflags(dpr->dpr_proc, PR_RLC); - (void) Psetflags(dpr->dpr_proc, PR_KLC); + dpr->dpr_close = DT_CLOSE_KILL; if (dt_proc_create_thread(dtp, dpr, dtp->dt_prcmode) != 0) return (NULL); /* dt_proc_error() has been called for us */ @@ -1048,20 +819,14 @@ dt_proc_grab(dtrace_hdl_t *dtp, pid_t pid, int flags, int nomonitor) (void) pthread_mutex_init(&dpr->dpr_lock, NULL); (void) pthread_cond_init(&dpr->dpr_cv, NULL); -#ifdef illumos - if ((dpr->dpr_proc = Pgrab(pid, flags, &err)) == NULL) { -#else if ((err = proc_attach(pid, flags, &dpr->dpr_proc)) != 0) { -#endif return (dt_proc_error(dtp, dpr, "failed to grab pid %d: %s\n", (int)pid, Pgrab_error(err))); } dpr->dpr_hdl = dtp; dpr->dpr_pid = pid; - - (void) Punsetflags(dpr->dpr_proc, PR_KLC); - (void) Psetflags(dpr->dpr_proc, PR_RLC); + dpr->dpr_close = DT_CLOSE_RUN; /* * If we are attempting to grab the process without a monitor @@ -1227,11 +992,7 @@ dtrace_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv, struct ps_prochandle *P = dt_proc_create(dtp, file, argv, pcf, child_arg); if (P != NULL && idp != NULL && idp->di_id == 0) { -#ifdef illumos - idp->di_id = Pstatus(P)->pr_pid; /* $target = created pid */ -#else idp->di_id = proc_getpid(P); /* $target = created pid */ -#endif } return (P); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h index beae6f6d5cda..458e9902881f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h @@ -40,6 +40,11 @@ extern "C" { #endif +enum dt_close_action { + DT_CLOSE_RUN, + DT_CLOSE_KILL, +}; + typedef struct dt_proc { dt_list_t dpr_list; /* prev/next pointers for lru chain */ struct dt_proc *dpr_hash; /* next pointer for pid hash chain */ @@ -60,6 +65,7 @@ typedef struct dt_proc { uint8_t dpr_rdonly; /* proc flag: opened read-only */ pthread_t dpr_tid; /* control thread (or zero if none) */ dt_list_t dpr_bps; /* list of dt_bkpt_t structures */ + enum dt_close_action dpr_close; /* do this to child when exiting */ } dt_proc_t; typedef struct dt_proc_notify { diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c index 7cf352d4d505..2391690afc0b 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c @@ -48,6 +48,7 @@ #include <dt_list.h> #include <dt_pid.h> #include <dtrace.h> +#include <kinst.h> static dt_provider_t * dt_provider_insert(dtrace_hdl_t *dtp, dt_provider_t *pvp, uint_t h) @@ -699,6 +700,34 @@ dt_probe_info(dtrace_hdl_t *dtp, prp = idp->di_data; else if (pdp->dtpd_id != DTRACE_IDNONE) prp = dt_probe_discover(pvp, pdp); + + if (strcmp(pvp->pv_desc.dtvd_name, "kinst") == 0) { + dtrace_kinst_probedesc_t pd; + + if (dtp->dt_kinstfd == -1) { + int fd; + + fd = open("/dev/dtrace/kinst", O_WRONLY); + if (fd < 0) { + (void) dt_set_errno(dtp, errno); + return (NULL); + } + dtp->dt_kinstfd = fd; + } + memset(&pd, 0, sizeof(pd)); + strlcpy(pd.kpd_func, pdp->dtpd_func, + sizeof (pd.kpd_func)); + + if (n_is_glob) + pd.kpd_off = -1; + else + pd.kpd_off = strtol(pdp->dtpd_name, NULL, 10); + if (ioctl(dtp->dt_kinstfd, KINSTIOC_MAKEPROBE, &pd) != + 0) { + (void) dt_set_errno(dtp, errno); + return (NULL); + } + } } /* diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c index 1729eaf2e7be..5976333e1b16 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c @@ -50,6 +50,7 @@ #include <stdint.h> #include <dt_impl.h> +#include <dt_oformat.h> static const struct { size_t dtps_offset; @@ -992,3 +993,44 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_t pid, return (dt_string2str(c, str, nbytes)); } + +int +dtrace_oformat_configure(dtrace_hdl_t *dtp) +{ + + dtp->dt_oformat = xo_get_style(NULL) == XO_STYLE_TEXT ? + DTRACE_OFORMAT_TEXT : + DTRACE_OFORMAT_STRUCTURED; + xo_set_flags(NULL, XOF_DTRT); + return (0); +} + +int +dtrace_oformat(dtrace_hdl_t *dtp) +{ + + return (dtp->dt_oformat != DTRACE_OFORMAT_TEXT); +} + +void +dtrace_set_outfp(const FILE *ofp) +{ + + xo_set_file((FILE *)ofp); +} + +void +dtrace_oformat_setup(dtrace_hdl_t *dtp) +{ + + xo_open_container("dtrace"); + xo_open_list("probes"); +} + +void +dtrace_oformat_teardown(dtrace_hdl_t *dtp) +{ + + xo_close_list("probes"); + xo_close_container("dtrace"); +} diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index f0bc83a7fc7b..b380f5eb3313 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -25,6 +25,7 @@ */ /* + * Copyright (c) 2023 by Domagoj Stolfa. All rights reserved. * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -119,10 +120,11 @@ typedef struct dtrace_proginfo { #define DTRACE_C_PSPEC 0x0080 /* Interpret ambiguous specifiers as probes */ #define DTRACE_C_ETAGS 0x0100 /* Prefix error messages with error tags */ #define DTRACE_C_ARGREF 0x0200 /* Do not require all macro args to be used */ +#define DTRACE_C_SUGAR 0x0400 /* Dump D script post-dt_sugar */ #define DTRACE_C_DEFARG 0x0800 /* Use 0/"" as value for unspecified args */ #define DTRACE_C_NOLIBS 0x1000 /* Do not process D system libraries */ #define DTRACE_C_CTL 0x2000 /* Only process control directives */ -#define DTRACE_C_MASK 0x3bff /* mask of all valid flags to dtrace_*compile */ +#define DTRACE_C_MASK 0x3fff /* mask of all valid flags to dtrace_*compile */ extern dtrace_prog_t *dtrace_program_strcompile(dtrace_hdl_t *, const char *, dtrace_probespec_t, uint_t, int, char *const []); @@ -199,6 +201,7 @@ typedef struct dtrace_probedata { dtrace_flowkind_t dtpda_flow; /* flow kind */ const char *dtpda_prefix; /* recommended flow prefix */ int dtpda_indent; /* recommended flow indent */ + uint64_t dtpda_timestamp; /* hrtime of snapshot */ } dtrace_probedata_t; typedef int dtrace_consume_probe_f(const dtrace_probedata_t *, void *); @@ -232,6 +235,10 @@ extern void *dtrace_printf_create(dtrace_hdl_t *, const char *); extern void *dtrace_printa_create(dtrace_hdl_t *, const char *); extern size_t dtrace_printf_format(dtrace_hdl_t *, void *, char *, size_t); +extern int dtrace_sprintf(dtrace_hdl_t *, FILE *, void *, + const dtrace_recdesc_t *, uint_t, + const void *, size_t); + extern int dtrace_fprintf(dtrace_hdl_t *, FILE *, void *, const dtrace_probedata_t *, const dtrace_recdesc_t *, uint_t, const void *, size_t); @@ -259,6 +266,8 @@ extern int dtrace_freopen(dtrace_hdl_t *, FILE *, void *, */ extern int dtrace_print(dtrace_hdl_t *, FILE *, const char *, caddr_t, size_t); +extern int dtrace_format_print(dtrace_hdl_t *, FILE *, const char *, + caddr_t, size_t); /* * DTrace Work Interface @@ -615,4 +624,18 @@ extern int _dtrace_debug; #define _SC_NPROCESSORS_MAX _SC_NPROCESSORS_CONF #endif +/* + * Values for the dt_oformat property. + */ +#define DTRACE_OFORMAT_TEXT 0 +#define DTRACE_OFORMAT_STRUCTURED 1 + +extern int dtrace_oformat_configure(dtrace_hdl_t *); +extern int dtrace_oformat(dtrace_hdl_t *); +extern void dtrace_set_outfp(const FILE *); +extern void dtrace_oformat_setup(dtrace_hdl_t *); +extern void dtrace_oformat_teardown(dtrace_hdl_t *); +extern void dtrace_oformat_probe(dtrace_hdl_t *, const dtrace_probedata_t *, + processorid_t, dtrace_probedesc_t *); + #endif /* _DTRACE_H */ diff --git a/cddl/contrib/opensolaris/tools/ctf/common/utils.c b/cddl/contrib/opensolaris/tools/ctf/common/utils.c index f74eb8de40fa..fda29486d94b 100644 --- a/cddl/contrib/opensolaris/tools/ctf/common/utils.c +++ b/cddl/contrib/opensolaris/tools/ctf/common/utils.c @@ -35,30 +35,6 @@ /*LINTLIBRARY*/ -static const char *pname; - -#pragma init(getpname) -const char * -getpname(void) -{ - const char *p, *q; - - if (pname != NULL) - return (pname); - - if ((p = getexecname()) != NULL) - q = strrchr(p, '/'); - else - q = NULL; - - if (q == NULL) - pname = p; - else - pname = q + 1; - - return (pname); -} - void vdie(const char *format, va_list alist) { diff --git a/cddl/contrib/opensolaris/tools/ctf/common/utils.h b/cddl/contrib/opensolaris/tools/ctf/common/utils.h index 99378bb4f251..6918bdab89aa 100644 --- a/cddl/contrib/opensolaris/tools/ctf/common/utils.h +++ b/cddl/contrib/opensolaris/tools/ctf/common/utils.h @@ -42,8 +42,6 @@ extern "C" { extern void vdie(const char *, va_list); extern void die(const char *, ...); -extern const char *getpname(void); - #ifdef __cplusplus } #endif diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c index 161927cf0663..c5be22ecfa1b 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c @@ -886,7 +886,7 @@ main(int argc, char **argv) for (i = 0; i < nifiles; i++) tifiles[i] = argv[optind + i]; - qsort(tifiles, nifiles, sizeof (char *), (int (*)())strcompare); + qsort(tifiles, nifiles, sizeof (char *), strcompare); ifiles[0] = tifiles[0]; for (idx = 0, tidx = 1; tidx < nifiles; tidx++) { @@ -912,14 +912,8 @@ main(int argc, char **argv) */ if (read_ctf(ifiles, nifiles, NULL, merge_ctf_cb, &wq, require_ctf) == 0) { - /* - * If we're verifying that C files have CTF, it's safe to - * assume that in this case, we're building only from assembly - * inputs. - */ - if (require_ctf) - exit(0); - terminate("No ctf sections found to merge\n"); + warning("No ctf sections found to merge\n"); + exit(0); } pthread_mutex_lock(&wq.wq_queue_lock); diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index 67866555ae5d..42faaad65db5 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -1004,7 +1004,9 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, else ml->ml_size = tdesc_bitsize(ml->ml_type); - if (die_unsigned(dw, mem, DW_AT_bit_offset, &bitoff, 0)) { + if (die_unsigned(dw, mem, DW_AT_data_bit_offset, &bitoff, 0)) { + ml->ml_offset += bitoff; + } else if (die_unsigned(dw, mem, DW_AT_bit_offset, &bitoff, 0)) { #if BYTE_ORDER == _BIG_ENDIAN ml->ml_offset += bitoff; #else @@ -1367,7 +1369,7 @@ static const fp_size_map_t fp_encodings[] = { }; static uint_t -die_base_type2enc(dwarf_t *dw, Dwarf_Off off, Dwarf_Signed enc, size_t sz) +die_base_type2enc(dwarf_t *dw, Dwarf_Off off, Dwarf_Unsigned enc, size_t sz) { const fp_size_map_t *map = fp_encodings; uint_t szidx = dw->dw_ptrsz == sizeof (uint64_t); @@ -1398,9 +1400,9 @@ static intr_t * die_base_from_dwarf(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, size_t sz) { intr_t *intr = xcalloc(sizeof (intr_t)); - Dwarf_Signed enc; + Dwarf_Unsigned enc; - (void) die_signed(dw, base, DW_AT_encoding, &enc, DW_ATTR_REQ); + (void) die_unsigned(dw, base, DW_AT_encoding, &enc, DW_ATTR_REQ); switch (enc) { case DW_ATE_unsigned: diff --git a/cddl/contrib/opensolaris/tools/ctf/dump/dump.c b/cddl/contrib/opensolaris/tools/ctf/dump/dump.c index 06c00a7b0e7f..5cbf46af1b73 100644 --- a/cddl/contrib/opensolaris/tools/ctf/dump/dump.c +++ b/cddl/contrib/opensolaris/tools/ctf/dump/dump.c @@ -856,7 +856,7 @@ print_stats(void) static int print_usage(FILE *fp, int verbose) { - (void) fprintf(fp, "Usage: %s [-dfhlsSt] [-u file] file\n", getpname()); + (void) fprintf(fp, "Usage: %s [-dfhlsSt] [-u file] file\n", getprogname()); if (verbose) { (void) fprintf(fp, diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile index e66109a21138..e6a0763544f7 100644 --- a/cddl/lib/Makefile +++ b/cddl/lib/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> @@ -21,6 +20,7 @@ SUBDIR.${MK_ZFS}+= \ libtpool \ libumem \ libuutil \ + libzdb \ libzfs \ libzfs_core \ libzfsbootenv \ diff --git a/cddl/lib/Makefile.inc b/cddl/lib/Makefile.inc index 8f9af1d17e9d..3e83ba423f35 100644 --- a/cddl/lib/Makefile.inc +++ b/cddl/lib/Makefile.inc @@ -1,4 +1,3 @@ -# $FreeBSD$ SHLIBDIR?= /lib SHLIB_MAJOR?= 2 diff --git a/cddl/lib/drti/Makefile b/cddl/lib/drti/Makefile index 321352c7100c..b9023202f0fb 100644 --- a/cddl/lib/drti/Makefile +++ b/cddl/lib/drti/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common diff --git a/cddl/lib/drti/Makefile.depend b/cddl/lib/drti/Makefile.depend index 422dbea77a29..2c564fe515ff 100644 --- a/cddl/lib/drti/Makefile.depend +++ b/cddl/lib/drti/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/lib/libavl/Makefile b/cddl/lib/libavl/Makefile index b5e3b458f982..5b47d42d7575 100644 --- a/cddl/lib/libavl/Makefile +++ b/cddl/lib/libavl/Makefile @@ -1,8 +1,7 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/module/avl -PACKAGE= runtime +PACKAGE= zfs LIB= avl LIBADD= spl SRCS= avl.c diff --git a/cddl/lib/libavl/Makefile.depend b/cddl/lib/libavl/Makefile.depend index 1c1a9bee1d67..409c3c86cc20 100644 --- a/cddl/lib/libavl/Makefile.depend +++ b/cddl/lib/libavl/Makefile.depend @@ -1,8 +1,9 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ + cddl/lib/libspl \ include \ + include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ diff --git a/cddl/lib/libctf/Makefile b/cddl/lib/libctf/Makefile index 860b327ca768..3b91a97bc3ee 100644 --- a/cddl/lib/libctf/Makefile +++ b/cddl/lib/libctf/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/common/ctf .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libctf/common diff --git a/cddl/lib/libctf/Makefile.depend b/cddl/lib/libctf/Makefile.depend index ec3b871042c4..7cbc01413fbc 100644 --- a/cddl/lib/libctf/Makefile.depend +++ b/cddl/lib/libctf/Makefile.depend @@ -1,7 +1,7 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ + cddl/lib/libspl \ include \ include/xlocale \ lib/${CSU_DIR} \ diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile index f95517f10ebb..d5c857bc06a0 100644 --- a/cddl/lib/libdtrace/Makefile +++ b/cddl/lib/libdtrace/Makefile @@ -1,10 +1,14 @@ -# $FreeBSD$ + +SHLIBDIR?= /lib + +.include <src.opts.mk> .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libgen/common PACKAGE= dtrace LIB= dtrace + SRCS= dt_aggregate.c \ dt_as.c \ dt_buf.c \ @@ -84,6 +88,7 @@ CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ -I${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} \ + -I${SRCTOP}/sys/cddl/dev/kinst \ -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ @@ -121,13 +126,28 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel .endif .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" -SRCS+= dis_tables.c +SRCS+= dis_tables.c instr_size.c DSRCS+= regs_x86.d .endif +.if ${MACHINE_CPUARCH} == "riscv" +SRCS+= instr_size.c +DSRCS+= regs_riscv.d +.endif + +.if ${MACHINE_CPUARCH} == "aarch64" +SRCS+= instr_size.c +DSRCS+= regs_aarch64.d +.endif + YFLAGS+=-d -LIBADD= ctf elf proc pthread rtld_db +.if ${MK_DTRACE_ASAN} != "no" +CFLAGS+= -fsanitize=address -fsanitize=undefined +LDFLAGS+= -fsanitize=address -fsanitize=undefined +.endif + +LIBADD= ctf elf proc pthread rtld_db xo CLEANFILES= dt_errtags.c dt_names.c diff --git a/cddl/lib/libdtrace/Makefile.depend b/cddl/lib/libdtrace/Makefile.depend index 68a8d3e9c520..92c6b0e658b5 100644 --- a/cddl/lib/libdtrace/Makefile.depend +++ b/cddl/lib/libdtrace/Makefile.depend @@ -1,9 +1,8 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ + bin/sh.host \ cddl/lib/libctf \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ @@ -14,6 +13,7 @@ DIRDEPS = \ lib/libproc \ lib/librtld_db \ lib/libthr \ + usr.bin/awk.host \ usr.bin/yacc.host \ diff --git a/cddl/lib/libdtrace/errno.d b/cddl/lib/libdtrace/errno.d index 426d882b0db1..2045e3a7433d 100644 --- a/cddl/lib/libdtrace/errno.d +++ b/cddl/lib/libdtrace/errno.d @@ -21,8 +21,6 @@ * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org * Portions Copyright 2018 Devin Teske dteske@freebsd.org - * - * $FreeBSD$ */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. diff --git a/cddl/lib/libdtrace/io.d b/cddl/lib/libdtrace/io.d index d643ad732a94..d576f57476ce 100644 --- a/cddl/lib/libdtrace/io.d +++ b/cddl/lib/libdtrace/io.d @@ -19,8 +19,6 @@ * CDDL HEADER END * * Portions Copyright 2018 Devin Teske dteske@freebsd.org - * - * $FreeBSD$ */ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. @@ -196,6 +194,8 @@ inline int DEVSTAT_TYPE_IF_IDE = 0x020; #pragma D binding "1.13" DEVSTAT_TYPE_IF_IDE inline int DEVSTAT_TYPE_IF_OTHER = 0x030; #pragma D binding "1.13" DEVSTAT_TYPE_IF_OTHER +inline int DEVSTAT_TYPE_IF_NVME = 0x040; +#pragma D binding "1.13" DEVSTAT_TYPE_IF_NVME inline int DEVSTAT_TYPE_IF_MASK = 0x0f0; #pragma D binding "1.13" DEVSTAT_TYPE_IF_MASK inline int DEVSTAT_TYPE_PASS = 0x100; @@ -230,6 +230,7 @@ inline string device_if_string[int type] = type == DEVSTAT_TYPE_IF_SCSI ? "SCSI" : type == DEVSTAT_TYPE_IF_IDE ? "IDE" : type == DEVSTAT_TYPE_IF_OTHER ? "OTHER" : + type == DEVSTAT_TYPE_IF_NVME ? "NVME" : strjoin("UNKNOWN(", strjoin(lltostr(type), ")")); #pragma D binding "1.13" device_if diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d index f591a965af68..2fe98858efc2 100644 --- a/cddl/lib/libdtrace/ip.d +++ b/cddl/lib/libdtrace/ip.d @@ -17,8 +17,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. @@ -264,8 +262,8 @@ inline int IFF_LOOPBACK = 0x8; #pragma D binding "1.5" translator translator ifinfo_t < struct ifnet *p > { - if_name = p->if_xname; - if_local = (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1; + if_name = p == NULL ? "<unknown>" : p->if_xname; + if_local = p == NULL ? 0 : (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1; if_addr = (uintptr_t)p; }; diff --git a/cddl/lib/libdtrace/libproc_compat.h b/cddl/lib/libdtrace/libproc_compat.h index 14f32506bb8f..7cdc8af18b56 100644 --- a/cddl/lib/libdtrace/libproc_compat.h +++ b/cddl/lib/libdtrace/libproc_compat.h @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ /* @@ -58,10 +56,8 @@ #define Prd_agent proc_rdagent #define Prelease proc_detach #define Psetbkpt proc_bkptset -#define Psetflags proc_setflags #define Pstate proc_state #define Psymbol_iter_by_addr proc_iter_symbyaddr -#define Punsetflags proc_clearflags #define Pupdate_maps proc_rdagent #define Pupdate_syms proc_updatesyms #define Pxecbkpt proc_bkptexec diff --git a/cddl/lib/libdtrace/net.d b/cddl/lib/libdtrace/net.d index ee22c8ffb0cc..fef61ea31f4b 100644 --- a/cddl/lib/libdtrace/net.d +++ b/cddl/lib/libdtrace/net.d @@ -19,8 +19,6 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org - * - * $FreeBSD$ */ /* diff --git a/cddl/lib/libdtrace/nfs.d b/cddl/lib/libdtrace/nfs.d index ae864ed363d2..4d55b39a809d 100644 --- a/cddl/lib/libdtrace/nfs.d +++ b/cddl/lib/libdtrace/nfs.d @@ -19,8 +19,6 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org - * - * $FreeBSD$ */ /* diff --git a/cddl/lib/libdtrace/nfssrv.d b/cddl/lib/libdtrace/nfssrv.d index 37842f7963a1..b5231bf7a2ec 100644 --- a/cddl/lib/libdtrace/nfssrv.d +++ b/cddl/lib/libdtrace/nfssrv.d @@ -19,8 +19,6 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org - * - * $FreeBSD$ */ /* diff --git a/cddl/lib/libdtrace/psinfo.d b/cddl/lib/libdtrace/psinfo.d index 0f5ca63c39a4..c0cd5b121064 100644 --- a/cddl/lib/libdtrace/psinfo.d +++ b/cddl/lib/libdtrace/psinfo.d @@ -20,8 +20,6 @@ * CDDL HEADER END * * Portions Copyright 2006 John Birrell jb@freebsd.org - * - * $FreeBSD$ */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. diff --git a/cddl/lib/libdtrace/regs_aarch64.d b/cddl/lib/libdtrace/regs_aarch64.d new file mode 100644 index 000000000000..7d20b5c546c5 --- /dev/null +++ b/cddl/lib/libdtrace/regs_aarch64.d @@ -0,0 +1,74 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright 2023 Christos Margiolis <christos@FreeBSD.org> + */ + +inline int R_X0 = 0; +#pragma D binding "1.13" R_X0 +inline int R_X1 = 1; +#pragma D binding "1.13" R_X1 +inline int R_X2 = 2; +#pragma D binding "1.13" R_X2 +inline int R_X3 = 3; +#pragma D binding "1.13" R_X3 +inline int R_X4 = 4; +#pragma D binding "1.13" R_X4 +inline int R_X5 = 5; +#pragma D binding "1.13" R_X5 +inline int R_X6 = 6; +#pragma D binding "1.13" R_X6 +inline int R_X7 = 7; +#pragma D binding "1.13" R_X7 +inline int R_X8 = 8; +#pragma D binding "1.13" R_X8 +inline int R_X9 = 9; +#pragma D binding "1.13" R_X9 +inline int R_X10 = 10; +#pragma D binding "1.13" R_X10 +inline int R_X11 = 11; +#pragma D binding "1.13" R_X11 +inline int R_X12 = 12; +#pragma D binding "1.13" R_X12 +inline int R_X13 = 13; +#pragma D binding "1.13" R_X13 +inline int R_X14 = 14; +#pragma D binding "1.13" R_X14 +inline int R_X15 = 15; +#pragma D binding "1.13" R_X15 +inline int R_X16 = 16; +#pragma D binding "1.13" R_X16 +inline int R_X17 = 17; +#pragma D binding "1.13" R_X17 +inline int R_X18 = 18; +#pragma D binding "1.13" R_X18 +inline int R_X19 = 19; +#pragma D binding "1.13" R_X19 +inline int R_X20 = 20; +#pragma D binding "1.13" R_X20 +inline int R_X21 = 21; +#pragma D binding "1.13" R_X21 +inline int R_X22 = 22; +#pragma D binding "1.13" R_X22 +inline int R_X23 = 23; +#pragma D binding "1.13" R_X23 +inline int R_X24 = 24; +#pragma D binding "1.13" R_X24 +inline int R_X25 = 25; +#pragma D binding "1.13" R_X25 +inline int R_X26 = 26; +#pragma D binding "1.13" R_X26 +inline int R_X27 = 27; +#pragma D binding "1.13" R_X27 +inline int R_X28 = 28; +#pragma D binding "1.13" R_X28 +inline int R_X29 = 29; +#pragma D binding "1.13" R_X29 +inline int R_FP= 29; +#pragma D binding "1.13" R_FP +inline int R_LR = 30; +#pragma D binding "1.13" R_LR +inline int R_SP = 31; +#pragma D binding "1.13" R_SP +inline int R_PC = 32; +#pragma D binding "1.13" R_PC diff --git a/cddl/lib/libdtrace/regs_riscv.d b/cddl/lib/libdtrace/regs_riscv.d new file mode 100644 index 000000000000..e8a9667d2efd --- /dev/null +++ b/cddl/lib/libdtrace/regs_riscv.d @@ -0,0 +1,74 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright 2023 Christos Margiolis <christos@FreeBSD.org> + */ + +inline int R_ZERO = 0; +#pragma D binding "1.13" R_ZERO +inline int R_RA = 1; +#pragma D binding "1.13" R_RA +inline int R_SP = 2; +#pragma D binding "1.13" R_SP +inline int R_GP = 3; +#pragma D binding "1.13" R_GP +inline int R_TP = 4; +#pragma D binding "1.13" R_TP +inline int R_T0 = 5; +#pragma D binding "1.13" R_T0 +inline int R_T1 = 6; +#pragma D binding "1.13" R_T1 +inline int R_T2 = 7; +#pragma D binding "1.13" R_T2 +inline int R_S0 = 8; +#pragma D binding "1.13" R_S0 +inline int R_FP = 8; +#pragma D binding "1.13" R_FP +inline int R_S1 = 9; +#pragma D binding "1.13" R_S1 +inline int R_A0 = 10; +#pragma D binding "1.13" R_A0 +inline int R_A1 = 11; +#pragma D binding "1.13" R_A1 +inline int R_A2 = 12; +#pragma D binding "1.13" R_A2 +inline int R_A3 = 13; +#pragma D binding "1.13" R_A3 +inline int R_A4 = 14; +#pragma D binding "1.13" R_A4 +inline int R_A5 = 15; +#pragma D binding "1.13" R_A5 +inline int R_A6 = 16; +#pragma D binding "1.13" R_A6 +inline int R_A7 = 17; +#pragma D binding "1.13" R_A7 +inline int R_S2 = 18; +#pragma D binding "1.13" R_S2 +inline int R_S3 = 19; +#pragma D binding "1.13" R_S3 +inline int R_S4 = 20; +#pragma D binding "1.13" R_S4 +inline int R_S5 = 21; +#pragma D binding "1.13" R_S5 +inline int R_S6 = 22; +#pragma D binding "1.13" R_S6 +inline int R_S7 = 23; +#pragma D binding "1.13" R_S7 +inline int R_S8 = 24; +#pragma D binding "1.13" R_S8 +inline int R_S9 = 25; +#pragma D binding "1.13" R_S9 +inline int R_S10 = 26; +#pragma D binding "1.13" R_S10 +inline int R_S11 = 27; +#pragma D binding "1.13" R_S11 +inline int R_T3 = 28; +#pragma D binding "1.13" R_T3 +inline int R_T4 = 29; +#pragma D binding "1.13" R_T4 +inline int R_T5 = 30; +#pragma D binding "1.13" R_T5 +inline int R_T6 = 31; +#pragma D binding "1.13" R_T6 +inline int R_PC = 32; +#pragma D binding "1.13" R_PC diff --git a/cddl/lib/libdtrace/regs_x86.d b/cddl/lib/libdtrace/regs_x86.d index 3f625f9f4445..2e31517fdd8d 100644 --- a/cddl/lib/libdtrace/regs_x86.d +++ b/cddl/lib/libdtrace/regs_x86.d @@ -20,8 +20,6 @@ * CDDL HEADER END * * Portions Copyright 2009 Stacey Son sson@FreeBSD.org - * - * $FreeBSD$ */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. @@ -80,11 +78,11 @@ inline int R_R0 = R_EAX; inline int R_R1 = R_EBX; #pragma D binding "1.0" R_R1 -inline int R_RSP = 18 + 1 + 20; +inline int R_RSP = 18 + 1 + 24; #pragma D binding "1.0" R_RSP -inline int R_RFL = 18 + 1 + 19; +inline int R_RFL = 18 + 1 + 23; #pragma D binding "1.0" R_RFL -inline int R_RIP = 18 + 1 + 17; +inline int R_RIP = 18 + 1 + 21; #pragma D binding "1.0" R_RIP inline int R_RAX = 18 + 1 + 14; #pragma D binding "1.0" R_RAX diff --git a/cddl/lib/libdtrace/sched.d b/cddl/lib/libdtrace/sched.d index 82fdf3ab0c05..7eca118fc428 100644 --- a/cddl/lib/libdtrace/sched.d +++ b/cddl/lib/libdtrace/sched.d @@ -19,8 +19,6 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org - * - * $FreeBSD$ */ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. diff --git a/cddl/lib/libdtrace/sctp.d b/cddl/lib/libdtrace/sctp.d index 5dc776bdb971..ef8c3bcc4a56 100644 --- a/cddl/lib/libdtrace/sctp.d +++ b/cddl/lib/libdtrace/sctp.d @@ -17,8 +17,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright (c) 2018 Michael Tuexen <tuexen@FreeBSD.org> diff --git a/cddl/lib/libdtrace/siftr.d b/cddl/lib/libdtrace/siftr.d index 37bc30ff3e06..bca3a0f0df7f 100644 --- a/cddl/lib/libdtrace/siftr.d +++ b/cddl/lib/libdtrace/siftr.d @@ -17,10 +17,9 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ +#pragma D depends_on library ip.d #pragma D depends_on module kernel #pragma D depends_on module siftr #pragma D depends_on provider tcp @@ -29,9 +28,9 @@ * Convert a SIFTR direction value to a string */ #pragma D binding "1.12.1" SIFTR_IN -inline int SIFTR_IN = 1; +inline int SIFTR_IN = 0; #pragma D binding "1.12.1" SIFTR_OUT -inline int SIFTR_OUT = 2; +inline int SIFTR_OUT = 1; /* SIFTR direction strings. */ #pragma D binding "1.12.1" siftr_dir_string @@ -44,22 +43,23 @@ typedef struct siftrinfo { struct timeval tval; uint8_t direction; uint8_t ipver; - uint32_t hash; - uint16_t tcp_localport; - uint16_t tcp_foreignport; - uint64_t snd_cwnd; - u_long snd_wnd; - u_long rcv_wnd; - u_long snd_bwnd; - u_long snd_ssthresh; + uint16_t lport; + uint16_t rport; + string laddr; + string raddr; + uint32_t snd_cwnd; + uint32_t snd_wnd; + uint32_t rcv_wnd; + uint32_t t_flags2; + uint32_t snd_ssthresh; int conn_state; - u_int max_seg_size; - int smoothed_rtt; + uint32_t mss; + uint32_t srtt; u_char sack_enabled; u_char snd_scale; u_char rcv_scale; - u_int flags; - int rxt_length; + u_int t_flags; + uint32_t rto; u_int snd_buf_hiwater; u_int snd_buf_cc; u_int rcv_buf_hiwater; @@ -74,22 +74,29 @@ typedef struct siftrinfo { translator siftrinfo_t < struct pkt_node *p > { direction = p == NULL ? 0 : p->direction; ipver = p == NULL ? 0 : p->ipver; - hash = p == NULL ? 0 : p->hash; - tcp_localport = p == NULL ? 0 : ntohs(p->tcp_localport); - tcp_foreignport = p == NULL ? 0 : ntohs(p->tcp_foreignport); + lport = p == NULL ? 0 : ntohs(p->lport); + rport = p == NULL ? 0 : ntohs(p->fport); + laddr = p == NULL ? "<unknown>" : + p->ipver == INP_IPV4 ? + inet_ntoa(&p->laddr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->laddr.id6_addr); + raddr = p == NULL ? "<unknown>" : + p->ipver == INP_IPV4 ? + inet_ntoa(&p->faddr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->faddr.id6_addr); snd_cwnd = p == NULL ? 0 : p->snd_cwnd; snd_wnd = p == NULL ? 0 : p->snd_wnd; rcv_wnd = p == NULL ? 0 : p->rcv_wnd; - snd_bwnd = p == NULL ? 0 : p->snd_bwnd; + t_flags2 = p == NULL ? 0 : p->t_flags2; snd_ssthresh = p == NULL ? 0 : p->snd_ssthresh; conn_state = p == NULL ? 0 : p->conn_state; - max_seg_size = p == NULL ? 0 : p->max_seg_size; - smoothed_rtt = p == NULL ? 0 : p->smoothed_rtt; + mss = p == NULL ? 0 : p->mss; + srtt = p == NULL ? 0 : p->srtt; sack_enabled = p == NULL ? 0 : p->sack_enabled; snd_scale = p == NULL ? 0 : p->snd_scale; rcv_scale = p == NULL ? 0 : p->rcv_scale; - flags = p == NULL ? 0 : p->flags; - rxt_length = p == NULL ? 0 : p->rxt_length; + t_flags = p == NULL ? 0 : p->t_flags; + rto = p == NULL ? 0 : p->rto; snd_buf_hiwater = p == NULL ? 0 : p->snd_buf_hiwater; snd_buf_cc = p == NULL ? 0 : p->snd_buf_cc; rcv_buf_hiwater = p == NULL ? 0 : p->rcv_buf_hiwater; diff --git a/cddl/lib/libdtrace/signal.d b/cddl/lib/libdtrace/signal.d index cdd433883397..0f9b2567cc0d 100644 --- a/cddl/lib/libdtrace/signal.d +++ b/cddl/lib/libdtrace/signal.d @@ -21,8 +21,6 @@ * * Portions Copyright 2008 John Birrell jb@freebsd.org * Portions Copyright 2018 Devin Teske dteske@freebsd.org - * - * $FreeBSD$ */ inline int SIGHUP = 1; diff --git a/cddl/lib/libdtrace/socket.d b/cddl/lib/libdtrace/socket.d index da8f149b2d10..c8161f9b2d30 100644 --- a/cddl/lib/libdtrace/socket.d +++ b/cddl/lib/libdtrace/socket.d @@ -23,8 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * * Translators and flags for the socket structure. FreeBSD specific code. */ diff --git a/cddl/lib/libdtrace/tcp.d b/cddl/lib/libdtrace/tcp.d index afcfdfadaf1e..0df4e16d41d0 100644 --- a/cddl/lib/libdtrace/tcp.d +++ b/cddl/lib/libdtrace/tcp.d @@ -17,8 +17,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. @@ -83,21 +81,23 @@ inline int TCP_STATE_TIME_WAIT = TCPS_TIME_WAIT; /* TCP segment flags. */ #pragma D binding "1.6.3" TH_FIN -inline uint8_t TH_FIN = 0x01; +inline uint16_t TH_FIN = 0x01; #pragma D binding "1.6.3" TH_SYN -inline uint8_t TH_SYN = 0x02; +inline uint16_t TH_SYN = 0x02; #pragma D binding "1.6.3" TH_RST -inline uint8_t TH_RST = 0x04; +inline uint16_t TH_RST = 0x04; #pragma D binding "1.6.3" TH_PUSH -inline uint8_t TH_PUSH = 0x08; +inline uint16_t TH_PUSH = 0x08; #pragma D binding "1.6.3" TH_ACK -inline uint8_t TH_ACK = 0x10; +inline uint16_t TH_ACK = 0x10; #pragma D binding "1.6.3" TH_URG -inline uint8_t TH_URG = 0x20; +inline uint16_t TH_URG = 0x20; #pragma D binding "1.6.3" TH_ECE -inline uint8_t TH_ECE = 0x40; +inline uint16_t TH_ECE = 0x40; #pragma D binding "1.6.3" TH_CWR -inline uint8_t TH_CWR = 0x80; +inline uint16_t TH_CWR = 0x80; +#pragma D binding "1.6.3" TH_AE +inline uint16_t TH_AE = 0x100; /* TCP connection state strings. */ #pragma D binding "1.6.3" tcp_state_string @@ -175,7 +175,7 @@ typedef struct tcpinfo { uint32_t tcp_seq; /* sequence number */ uint32_t tcp_ack; /* acknowledgment number */ uint8_t tcp_offset; /* data offset, in bytes */ - uint8_t tcp_flags; /* flags */ + uint16_t tcp_flags; /* flags */ uint16_t tcp_window; /* window size */ uint16_t tcp_checksum; /* checksum */ uint16_t tcp_urgent; /* urgent data pointer */ @@ -194,7 +194,7 @@ typedef struct tcpinfoh { uint32_t tcp_seq; /* sequence number */ uint32_t tcp_ack; /* acknowledgment number */ uint8_t tcp_offset; /* data offset, in bytes */ - uint8_t tcp_flags; /* flags */ + uint16_t tcp_flags; /* flags */ uint16_t tcp_window; /* window size */ uint16_t tcp_checksum; /* checksum */ uint16_t tcp_urgent; /* urgent data pointer */ @@ -204,7 +204,7 @@ typedef struct tcpinfoh { #pragma D binding "1.6.3" translator translator csinfo_t < struct tcpcb *p > { cs_addr = NULL; - cs_cid = (uint64_t)(p == NULL ? 0 : p->t_inpcb); + cs_cid = (uint64_t)(p == NULL ? 0 : &p->t_inpcb); cs_pid = 0; cs_zoneid = 0; }; @@ -214,16 +214,16 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_addr = (uintptr_t)p; tcps_local = -1; /* XXX */ tcps_active = -1; /* XXX */ - tcps_lport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_lport); - tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport); + tcps_lport = p == NULL ? 0 : ntohs(p->t_inpcb.inp_inc.inc_ie.ie_lport); + tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb.inp_inc.inc_ie.ie_fport); tcps_laddr = p == NULL ? "<unknown>" : - p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr); + p->t_inpcb.inp_vflag == INP_IPV4 ? + inet_ntoa(&p->t_inpcb.inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb.inp_inc.inc_ie.ie_dependladdr.id6_addr); tcps_raddr = p == NULL ? "<unknown>" : - p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr); + p->t_inpcb.inp_vflag == INP_IPV4 ? + inet_ntoa(&p->t_inpcb.inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb.inp_inc.inc_ie.ie_dependfaddr.id6_addr); tcps_state = p == NULL ? -1 : p->t_state; tcps_iss = p == NULL ? 0 : p->iss; tcps_irs = p == NULL ? 0 : p->irs; @@ -250,9 +250,9 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ tcps_debug = p == NULL ? 0 : - p->t_inpcb->inp_socket->so_options & 1; + p->t_inpcb.inp_socket->so_options & 1; tcps_cookie = p == NULL ? -1 : - p->t_inpcb->inp_socket->so_user_cookie; + p->t_inpcb.inp_socket->so_user_cookie; tcps_dupacks = p == NULL ? -1 : p->t_dupacks; tcps_rtttime = p == NULL ? -1 : p->t_rtttime; tcps_rtseq = p == NULL ? -1 : p->t_rtseq; @@ -265,8 +265,8 @@ translator tcpinfo_t < struct tcphdr *p > { tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); tcp_seq = p == NULL ? -1 : ntohl(p->th_seq); tcp_ack = p == NULL ? -1 : ntohl(p->th_ack); - tcp_offset = p == NULL ? -1 : (p->th_off >> 2); - tcp_flags = p == NULL ? 0 : p->th_flags; + tcp_offset = p == NULL ? -1 : (p->th_off << 2); + tcp_flags = p == NULL ? 0 : ((p->th_x2 << 8) | p->th_flags); tcp_window = p == NULL ? 0 : ntohs(p->th_win); tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); tcp_urgent = p == NULL ? 0 : ntohs(p->th_urp); @@ -284,8 +284,8 @@ translator tcpinfoh_t < struct tcphdr *p > { tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); tcp_seq = p == NULL ? -1 : p->th_seq; tcp_ack = p == NULL ? -1 : p->th_ack; - tcp_offset = p == NULL ? -1 : (p->th_off >> 2); - tcp_flags = p == NULL ? 0 : p->th_flags; + tcp_offset = p == NULL ? -1 : (p->th_off << 2); + tcp_flags = p == NULL ? 0 : ((p->th_x2 << 8) | p->th_flags); tcp_window = p == NULL ? 0 : p->th_win; tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); tcp_urgent = p == NULL ? 0 : p->th_urp; @@ -313,17 +313,17 @@ inline int TA_DROP = 4; /* direction strings. */ -#pragma D binding "1.12.1" tcpdebug_dir_string +#pragma D binding "1.13" tcpdebug_dir_string inline string tcpdebug_dir_string[uint8_t direction] = direction == TA_INPUT ? "input" : direction == TA_OUTPUT ? "output" : direction == TA_USER ? "user" : direction == TA_RESPOND ? "respond" : - direction == TA_OUTPUT ? "drop" : + direction == TA_DROP ? "drop" : "unknown" ; -#pragma D binding "1.12.1" tcpflag_string -inline string tcpflag_string[uint8_t flags] = +#pragma D binding "1.13" tcpflag_string +inline string tcpflag_string[uint16_t flags] = flags & TH_FIN ? "FIN" : flags & TH_SYN ? "SYN" : flags & TH_RST ? "RST" : @@ -332,6 +332,7 @@ inline string tcpflag_string[uint8_t flags] = flags & TH_URG ? "URG" : flags & TH_ECE ? "ECE" : flags & TH_CWR ? "CWR" : + flags & TH_AE ? "AE" : "unknown" ; #pragma D binding "1.12.1" PRU_ATTACH diff --git a/cddl/lib/libdtrace/udp.d b/cddl/lib/libdtrace/udp.d index 603bbbd29617..fd28f5e2e7e9 100644 --- a/cddl/lib/libdtrace/udp.d +++ b/cddl/lib/libdtrace/udp.d @@ -17,8 +17,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. diff --git a/cddl/lib/libdtrace/udplite.d b/cddl/lib/libdtrace/udplite.d index e41a6faa36a8..88c1c8553ce5 100644 --- a/cddl/lib/libdtrace/udplite.d +++ b/cddl/lib/libdtrace/udplite.d @@ -17,8 +17,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. diff --git a/cddl/lib/libdtrace/unistd.d b/cddl/lib/libdtrace/unistd.d index 1ceffef2b215..ead9d23ce670 100644 --- a/cddl/lib/libdtrace/unistd.d +++ b/cddl/lib/libdtrace/unistd.d @@ -17,8 +17,6 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. diff --git a/cddl/lib/libicp/Makefile b/cddl/lib/libicp/Makefile index 58ebb292c946..1dbe4ace88ed 100644 --- a/cddl/lib/libicp/Makefile +++ b/cddl/lib/libicp/Makefile @@ -1,12 +1,10 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp -PACKAGE= utilities +PACKAGE= zfs LIB= icp LIBADD= - .if ${MACHINE_ARCH} == "amd64" ASM_SOURCES_C = asm-x86_64/aes/aeskey.c ASM_SOURCES_AS = \ @@ -15,30 +13,47 @@ ASM_SOURCES_AS = \ asm-x86_64/modes/gcm_pclmulqdq.S \ asm-x86_64/modes/aesni-gcm-x86_64.S \ asm-x86_64/modes/ghash-x86_64.S \ - asm-x86_64/sha2/sha256_impl.S \ - asm-x86_64/sha2/sha512_impl.S \ + asm-x86_64/sha2/sha256-x86_64.S \ + asm-x86_64/sha2/sha512-x86_64.S \ asm-x86_64/blake3/blake3_avx2.S \ asm-x86_64/blake3/blake3_avx512.S \ asm-x86_64/blake3/blake3_sse2.S \ asm-x86_64/blake3/blake3_sse41.S CFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES +.elif ${MACHINE_CPUARCH} == "arm" +ASM_SOURCES_C = +ASM_SOURCES_AS = \ + asm-arm/sha2/sha256-armv7.S \ + asm-arm/sha2/sha512-armv7.S .elif ${MACHINE_ARCH} == "aarch64" ASM_SOURCES_C = ASM_SOURCES_AS = \ asm-aarch64/blake3/b3_aarch64_sse2.S \ - asm-aarch64/blake3/b3_aarch64_sse41.S + asm-aarch64/blake3/b3_aarch64_sse41.S \ + asm-aarch64/sha2/sha256-armv8.S \ + asm-aarch64/sha2/sha512-armv8.S +.elif ${MACHINE_ARCH} == "powerpc64" +ASM_SOURCES_C = +ASM_SOURCES_AS = \ + asm-ppc64/sha2/sha256-ppc.S \ + asm-ppc64/sha2/sha512-ppc.S \ + asm-ppc64/sha2/sha256-p8.S \ + asm-ppc64/sha2/sha512-p8.S .elif ${MACHINE_ARCH} == "powerpc64le" ASM_SOURCES_C = ASM_SOURCES_AS = \ asm-ppc64/blake3/b3_ppc64le_sse2.S \ - asm-ppc64/blake3/b3_ppc64le_sse41.S + asm-ppc64/blake3/b3_ppc64le_sse41.S \ + asm-ppc64/sha2/sha256-ppc.S \ + asm-ppc64/sha2/sha512-ppc.S \ + asm-ppc64/sha2/sha256-p8.S \ + asm-ppc64/sha2/sha512-p8.S .else ASM_SOURCES_C = ASM_SOURCES_AS = .endif - KERNEL_C = \ spi/kcf_spi.c \ api/kcf_ctxops.c \ @@ -52,7 +67,6 @@ KERNEL_C = \ algs/blake3/blake3.c \ algs/blake3/blake3_generic.c \ algs/blake3/blake3_impl.c \ - algs/blake3/blake3_x86-64.c \ algs/edonr/edonr.c \ algs/modes/modes.c \ algs/modes/cbc.c \ @@ -62,7 +76,9 @@ KERNEL_C = \ algs/modes/ctr.c \ algs/modes/ccm.c \ algs/modes/ecb.c \ - algs/sha2/sha2.c \ + algs/sha2/sha2_generic.c \ + algs/sha2/sha256_impl.c \ + algs/sha2/sha512_impl.c \ algs/skein/skein.c \ algs/skein/skein_block.c \ algs/skein/skein_iv.c \ @@ -77,10 +93,8 @@ KERNEL_C = \ core/kcf_prov_tabs.c \ $(ASM_SOURCES_C) - - - - +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs +KERNEL_C+= zfs_impl.c SRCS= $(ASM_SOURCES_AS) $(KERNEL_C) @@ -98,22 +112,31 @@ CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccomp CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h - CFLAGS.aes_amd64.S+= -DLOCORE CFLAGS.aes_aesni.S+= -DLOCORE CFLAGS.gcm_pclmulqdq.S+= -DLOCORE CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE CFLAGS.ghash-x86_64.S+= -DLOCORE -CFLAGS.sha256_impl.S+= -DLOCORE -CFLAGS.sha512_impl.S+= -DLOCORE +CFLAGS.sha256-x86_64.S+= -DLOCORE +CFLAGS.sha512-x86_64.S+= -DLOCORE CFLAGS.blake3_avx2.S = -DLOCORE CFLAGS.blake3_avx512.S = -DLOCORE CFLAGS.blake3_sse2.S = -DLOCORE CFLAGS.blake3_sse41.S = -DLOCORE CFLAGS.b3_aarch64_sse2.S = -DLOCORE CFLAGS.b3_aarch64_sse41.S = -DLOCORE +CFLAGS.sha256-armv7.S = -DLOCORE +CFLAGS.sha256-armv8.S = -DLOCORE +CFLAGS.sha512-armv7.S = -DLOCORE +CFLAGS.sha512-armv8.S = -DLOCORE CFLAGS.b3_ppc64le_sse2.S = -DLOCORE CFLAGS.b3_ppc64le_sse41.S = -DLOCORE +CFLAGS.sha256-p8.S = -DLOCORE +CFLAGS.sha256-ppc.S = -DLOCORE +CFLAGS.sha512-p8.S = -DLOCORE +CFLAGS.sha512-ppc.S = -DLOCORE + +LDFLAGS.bfd+= -Wl,-znoexecstack .include <bsd.lib.mk> diff --git a/cddl/lib/libicp/Makefile.depend b/cddl/lib/libicp/Makefile.depend new file mode 100644 index 000000000000..6ef78fac5cbf --- /dev/null +++ b/cddl/lib/libicp/Makefile.depend @@ -0,0 +1,15 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/cddl/lib/libicp_rescue/Makefile b/cddl/lib/libicp_rescue/Makefile index 1237b1b05edf..196f96b1fcf8 100644 --- a/cddl/lib/libicp_rescue/Makefile +++ b/cddl/lib/libicp_rescue/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp @@ -6,7 +5,6 @@ PACKAGE= utilities LIB= icp_rescue LIBADD= - .if ${MACHINE_ARCH} == "amd64" ASM_SOURCES_C = asm-x86_64/aes/aeskey.c ASM_SOURCES_AS = \ @@ -14,30 +12,47 @@ ASM_SOURCES_AS = \ asm-x86_64/aes/aes_aesni.S \ asm-x86_64/modes/gcm_pclmulqdq.S \ asm-x86_64/modes/aesni-gcm-x86_64.S \ - asm-x86_64/sha2/sha256_impl.S \ - asm-x86_64/sha2/sha512_impl.S \ + asm-x86_64/sha2/sha256-x86_64.S \ + asm-x86_64/sha2/sha512-x86_64.S \ asm-x86_64/blake3/blake3_avx2.S \ asm-x86_64/blake3/blake3_avx512.S \ asm-x86_64/blake3/blake3_sse2.S \ asm-x86_64/blake3/blake3_sse41.S CFLAGS+= -D__amd64 -D_SYS_STACK_H +.elif ${MACHINE_CPUARCH} == "arm" +ASM_SOURCES_C = +ASM_SOURCES_AS = \ + asm-arm/sha2/sha256-armv7.S \ + asm-arm/sha2/sha512-armv7.S .elif ${MACHINE_ARCH} == "aarch64" ASM_SOURCES_C = ASM_SOURCES_AS = \ asm-aarch64/blake3/b3_aarch64_sse2.S \ - asm-aarch64/blake3/b3_aarch64_sse41.S + asm-aarch64/blake3/b3_aarch64_sse41.S \ + asm-aarch64/sha2/sha256-armv8.S \ + asm-aarch64/sha2/sha512-armv8.S +.elif ${MACHINE_ARCH} == "powerpc64" +ASM_SOURCES_C = +ASM_SOURCES_AS = \ + asm-ppc64/sha2/sha256-ppc.S \ + asm-ppc64/sha2/sha512-ppc.S \ + asm-ppc64/sha2/sha256-p8.S \ + asm-ppc64/sha2/sha512-p8.S .elif ${MACHINE_ARCH} == "powerpc64le" ASM_SOURCES_C = ASM_SOURCES_AS = \ asm-ppc64/blake3/b3_ppc64le_sse2.S \ - asm-ppc64/blake3/b3_ppc64le_sse41.S + asm-ppc64/blake3/b3_ppc64le_sse41.S \ + asm-ppc64/sha2/sha256-ppc.S \ + asm-ppc64/sha2/sha512-ppc.S \ + asm-ppc64/sha2/sha256-p8.S \ + asm-ppc64/sha2/sha512-p8.S .else ASM_SOURCES_C = ASM_SOURCES_AS = .endif - KERNEL_C = \ spi/kcf_spi.c \ api/kcf_ctxops.c \ @@ -51,7 +66,6 @@ KERNEL_C = \ algs/blake3/blake3.c \ algs/blake3/blake3_generic.c \ algs/blake3/blake3_impl.c \ - algs/blake3/blake3_x86-64.c \ algs/edonr/edonr.c \ algs/modes/modes.c \ algs/modes/cbc.c \ @@ -61,7 +75,9 @@ KERNEL_C = \ algs/modes/ctr.c \ algs/modes/ccm.c \ algs/modes/ecb.c \ - algs/sha2/sha2.c \ + algs/sha2/sha2_generic.c \ + algs/sha2/sha256_impl.c \ + algs/sha2/sha512_impl.c \ algs/skein/skein_block.c \ illumos-crypto.c \ io/aes.c \ @@ -74,6 +90,9 @@ KERNEL_C = \ core/kcf_prov_tabs.c \ $(ASM_SOURCES_C) +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs +KERNEL_C+= zfs_impl.c + SRCS= $(ASM_SOURCES_AS) $(KERNEL_C) WARNS?= 2 @@ -90,14 +109,13 @@ CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccomp CFLAGS+= -DHAVE_ISSETUGID -UHAVE_AVX -DRESCUE CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h - CFLAGS.aes_amd64.S+= -DLOCORE CFLAGS.aes_aesni.S+= -DLOCORE CFLAGS.gcm_pclmulqdq.S+= -DLOCORE CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE CFLAGS.ghash-x86_64.S+= -DLOCORE -CFLAGS.sha256_impl.S+= -DLOCORE -CFLAGS.sha512_impl.S+= -DLOCORE +CFLAGS.sha256-x86_64.S+= -DLOCORE +CFLAGS.sha512-x86_64.S+= -DLOCORE CFLAGS.gcm.c+= -UCAN_USE_GCM_ASM CFLAGS.blake3_avx2.S = -DLOCORE CFLAGS.blake3_avx512.S = -DLOCORE @@ -105,8 +123,17 @@ CFLAGS.blake3_sse2.S = -DLOCORE CFLAGS.blake3_sse41.S = -DLOCORE CFLAGS.b3_aarch64_sse2.S = -DLOCORE CFLAGS.b3_aarch64_sse41.S = -DLOCORE +CFLAGS.sha256-armv7.S = -DLOCORE +CFLAGS.sha512-armv7.S = -DLOCORE +CFLAGS.sha256-armv8.S = -DLOCORE +CFLAGS.sha512-armv8.S = -DLOCORE CFLAGS.b3_ppc64le_sse2.S = -DLOCORE CFLAGS.b3_ppc64le_sse41.S = -DLOCORE +CFLAGS.sha256-ppc.S = -DLOCORE +CFLAGS.sha256-p8.S = -DLOCORE +CFLAGS.sha512-ppc.S = -DLOCORE +CFLAGS.sha512-p8.S = -DLOCORE +LDFLAGS.bfd+= -Wl,-znoexecstack .include <bsd.lib.mk> diff --git a/cddl/lib/libicp_rescue/Makefile.depend b/cddl/lib/libicp_rescue/Makefile.depend new file mode 100644 index 000000000000..6ef78fac5cbf --- /dev/null +++ b/cddl/lib/libicp_rescue/Makefile.depend @@ -0,0 +1,15 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/cddl/lib/libnvpair/Makefile b/cddl/lib/libnvpair/Makefile index d436b9b1df27..fb80d7c22ea5 100644 --- a/cddl/lib/libnvpair/Makefile +++ b/cddl/lib/libnvpair/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/module/nvpair .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libnvpair @@ -7,7 +6,7 @@ LIB= nvpair LIBADD= spl -PACKAGE= runtime +PACKAGE= zfs # user INCS= libnvpair.h SRCS= libnvpair.c \ diff --git a/cddl/lib/libnvpair/Makefile.depend b/cddl/lib/libnvpair/Makefile.depend index 5f1a802404d8..409c3c86cc20 100644 --- a/cddl/lib/libnvpair/Makefile.depend +++ b/cddl/lib/libnvpair/Makefile.depend @@ -1,13 +1,12 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ + cddl/lib/libspl \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/msun \ .include <dirdeps.mk> diff --git a/cddl/lib/libspl/Makefile b/cddl/lib/libspl/Makefile index 6a918c59e27e..e432b313d9d0 100644 --- a/cddl/lib/libspl/Makefile +++ b/cddl/lib/libspl/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <bsd.init.mk> .include <bsd.compiler.mk> @@ -8,7 +7,7 @@ LIB= spl LIBADD= -PACKAGE= runtime +PACKAGE= zfs SRCS = \ assert.c \ diff --git a/cddl/lib/libspl/Makefile.depend b/cddl/lib/libspl/Makefile.depend new file mode 100644 index 000000000000..6ef78fac5cbf --- /dev/null +++ b/cddl/lib/libspl/Makefile.depend @@ -0,0 +1,15 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/cddl/lib/libtpool/Makefile b/cddl/lib/libtpool/Makefile index 637385bc842e..6e85a8f82e9a 100644 --- a/cddl/lib/libtpool/Makefile +++ b/cddl/lib/libtpool/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libtpool .PATH: ${SRCTOP}/sys/contrib/openzfs/include @@ -6,7 +5,7 @@ LIB= tpool LIBADD= spl -PACKAGE= runtime +PACKAGE= zfs INCS= thread_pool_impl.h SRCS= thread_pool.c diff --git a/cddl/lib/libtpool/Makefile.depend b/cddl/lib/libtpool/Makefile.depend new file mode 100644 index 000000000000..409c3c86cc20 --- /dev/null +++ b/cddl/lib/libtpool/Makefile.depend @@ -0,0 +1,16 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + cddl/lib/libspl \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/cddl/lib/libumem/Makefile b/cddl/lib/libumem/Makefile index ca8f5e665920..1330ba0d94bd 100644 --- a/cddl/lib/libumem/Makefile +++ b/cddl/lib/libumem/Makefile @@ -1,8 +1,7 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/cddl/compat/opensolaris/lib/libumem -PACKAGE= runtime +PACKAGE= zfs LIB= umem SRCS= umem.c WARNS?= 3 diff --git a/cddl/lib/libumem/Makefile.depend b/cddl/lib/libumem/Makefile.depend index 1c1a9bee1d67..93249906da4f 100644 --- a/cddl/lib/libumem/Makefile.depend +++ b/cddl/lib/libumem/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/lib/libuutil/Makefile b/cddl/lib/libuutil/Makefile index 169b8d8afe01..333c581ccb90 100644 --- a/cddl/lib/libuutil/Makefile +++ b/cddl/lib/libuutil/Makefile @@ -1,8 +1,7 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libuutil -PACKAGE= runtime +PACKAGE= zfs LIB= uutil SRCS=\ uu_alloc.c \ @@ -10,7 +9,6 @@ SRCS=\ uu_ident.c \ uu_list.c \ uu_misc.c \ - uu_pname.c \ uu_string.c WARNS?= 2 diff --git a/cddl/lib/libuutil/Makefile.depend b/cddl/lib/libuutil/Makefile.depend index 8d409f5263ac..808980b1879e 100644 --- a/cddl/lib/libuutil/Makefile.depend +++ b/cddl/lib/libuutil/Makefile.depend @@ -1,7 +1,8 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ + cddl/lib/libavl \ + cddl/lib/libspl \ include \ include/xlocale \ lib/${CSU_DIR} \ diff --git a/cddl/lib/libzdb/Makefile b/cddl/lib/libzdb/Makefile new file mode 100644 index 000000000000..63248399b91c --- /dev/null +++ b/cddl/lib/libzdb/Makefile @@ -0,0 +1,25 @@ +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzdb +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + +LIB= zdb +PACKAGE= zfs + +INCS = libzdb.h + +SRCS = libzdb.c + +WARNS?= 2 +CSTD= c99 + +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzutil +CFLAGS+= -DHAVE_ISSETUGID -DIN_BASE +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h + +.include <bsd.lib.mk> diff --git a/cddl/lib/libzdb/Makefile.depend b/cddl/lib/libzdb/Makefile.depend new file mode 100644 index 000000000000..93249906da4f --- /dev/null +++ b/cddl/lib/libzdb/Makefile.depend @@ -0,0 +1,14 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile index 63bfcb39d4d8..c05fe0c1c12b 100644 --- a/cddl/lib/libzfs/Makefile +++ b/cddl/lib/libzfs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp .PATH: ${SRCTOP}/sys/contrib/openzfs/module/zcommon @@ -9,7 +8,7 @@ .PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd .PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd/lib -PACKAGE= runtime +PACKAGE= zfs LIB= zfs LIBADD= \ avl \ @@ -20,6 +19,7 @@ LIBADD= \ md \ nvpair \ pthread \ + rt \ umem \ util \ uutil \ @@ -55,7 +55,6 @@ USER_C += \ os/freebsd/smb.c KERNEL_C = \ - algs/sha2/sha2.c \ cityhash.c \ zfeature_common.c \ zfs_comutil.c \ @@ -100,9 +99,10 @@ CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -DHAVE_EXECVPE CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h CFLAGS+= -DSYSCONFDIR=\"/etc\" CFLAGS+= -DPKGDATADIR=\"/usr/share/zfs\" - +CFLAGS+= -DZFSEXECDIR=\"${LIBEXECDIR}/zfs\" .include <bsd.lib.mk> diff --git a/cddl/lib/libzfs/Makefile.depend b/cddl/lib/libzfs/Makefile.depend index 54a7c43b42aa..1fead4b4f29d 100644 --- a/cddl/lib/libzfs/Makefile.depend +++ b/cddl/lib/libzfs/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ @@ -7,6 +6,7 @@ DIRDEPS = \ cddl/lib/libumem \ cddl/lib/libuutil \ cddl/lib/libzfs_core \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ @@ -15,10 +15,12 @@ DIRDEPS = \ lib/libexpat \ lib/libgeom \ lib/libmd \ + lib/librt \ lib/libthr \ lib/libutil \ lib/libz \ lib/msun \ + secure/lib/libcrypto \ .include <dirdeps.mk> diff --git a/cddl/lib/libzfs_core/Makefile b/cddl/lib/libzfs_core/Makefile index 5a7475f55428..9797f004d10f 100644 --- a/cddl/lib/libzfs_core/Makefile +++ b/cddl/lib/libzfs_core/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core .PATH: ${SRCTOP}/sys/contrib/openzfs/include @@ -8,7 +7,7 @@ LIB= zfs_core LIBADD= nvpair spl zutil -PACKAGE= runtime +PACKAGE= zfs INCS= libzfs_core.h SRCS= libzfs_core.c \ diff --git a/cddl/lib/libzfs_core/Makefile.depend b/cddl/lib/libzfs_core/Makefile.depend index 26e3937b68fd..fd295d12904d 100644 --- a/cddl/lib/libzfs_core/Makefile.depend +++ b/cddl/lib/libzfs_core/Makefile.depend @@ -1,14 +1,14 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libnvpair \ + cddl/lib/libspl \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/msun \ .include <dirdeps.mk> diff --git a/cddl/lib/libzfsbootenv/Makefile b/cddl/lib/libzfsbootenv/Makefile index be39af96124a..9579fb7dcf18 100644 --- a/cddl/lib/libzfsbootenv/Makefile +++ b/cddl/lib/libzfsbootenv/Makefile @@ -1,9 +1,8 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfsbootenv .PATH: ${SRCTOP}/sys/contrib/openzfs/include -PACKAGE= runtime +PACKAGE= zfs LIB= zfsbootenv SHLIB_MAJOR= 1 diff --git a/cddl/lib/libzfsbootenv/Makefile.depend b/cddl/lib/libzfsbootenv/Makefile.depend new file mode 100644 index 000000000000..7209d9b784ef --- /dev/null +++ b/cddl/lib/libzfsbootenv/Makefile.depend @@ -0,0 +1,17 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + cddl/lib/libnvpair \ + cddl/lib/libzfs \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index 92f1bda6d82a..f641edaccb52 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs @@ -32,6 +31,7 @@ ATOMIC_SRCS= opensolaris_atomic.c PICFLAG= -fPIC .endif +PACKAGE= zfs LIB= zpool USER_C = \ @@ -61,12 +61,14 @@ KERNEL_C = \ bplist.c \ bpobj.c \ bptree.c \ - btree.c \ bqueue.c \ + btree.c \ + brt.c \ cityhash.c \ dbuf.c \ dbuf_stats.c \ ddt.c \ + ddt_stats.c \ ddt_zap.c \ dmu.c \ dmu_diff.c \ @@ -116,10 +118,9 @@ KERNEL_C = \ refcount.c \ rrwlock.c \ sa.c \ - sha256.c \ + sha2_zfs.c \ skein_zfs.c \ spa.c \ - spa_boot.c \ spa_checkpoint.c \ spa_config.c \ spa_errlog.c \ @@ -134,7 +135,6 @@ KERNEL_C = \ uberblock.c \ unique.c \ vdev.c \ - vdev_cache.c \ vdev_draid.c \ vdev_draid_rand.c \ vdev_file.c \ @@ -143,6 +143,7 @@ KERNEL_C = \ vdev_indirect_mapping.c \ vdev_initialize.c \ vdev_label.c \ + vdev_label_os.c \ vdev_mirror.c \ vdev_missing.c \ vdev_queue.c \ @@ -287,6 +288,10 @@ CSTD= c99 CFLAGS+= -g -DDEBUG=1 +# Pointer values are used as debugging "tags" to mark reference count +# ownerships and in some cases the tag reference is dropped after an +# object is freed. +CFLAGS.dbuf.c= ${NO_WUSE_AFTER_FREE} CFLAGS.entropy_common.c= -fno-tree-vectorize CFLAGS.entropy_common.c+= ${NO_WBITWISE_INSTEAD_OF_LOGICAL} CFLAGS.error_private.c= -fno-tree-vectorize diff --git a/cddl/lib/libzpool/Makefile.depend b/cddl/lib/libzpool/Makefile.depend index 06045f57b437..42b2995ff2d1 100644 --- a/cddl/lib/libzpool/Makefile.depend +++ b/cddl/lib/libzpool/Makefile.depend @@ -1,12 +1,11 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libavl \ cddl/lib/libicp \ cddl/lib/libnvpair \ + cddl/lib/libspl \ cddl/lib/libumem \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ @@ -15,7 +14,6 @@ DIRDEPS = \ lib/libmd \ lib/libthr \ lib/libz \ - lib/msun \ .include <dirdeps.mk> diff --git a/cddl/lib/libzutil/Makefile b/cddl/lib/libzutil/Makefile index 2e6b53658b22..83f08960d533 100644 --- a/cddl/lib/libzutil/Makefile +++ b/cddl/lib/libzutil/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzutil .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzutil/os/freebsd @@ -6,7 +5,7 @@ LIB= zutil LIBADD= avl geom m tpool -PACKAGE= runtime +PACKAGE= zfs INCS = zutil_import.h diff --git a/cddl/lib/libzutil/Makefile.depend b/cddl/lib/libzutil/Makefile.depend new file mode 100644 index 000000000000..ddad58a70480 --- /dev/null +++ b/cddl/lib/libzutil/Makefile.depend @@ -0,0 +1,19 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + cddl/lib/libavl \ + cddl/lib/libtpool \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/libgeom \ + lib/msun \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/cddl/lib/pam_zfs_key/Makefile b/cddl/lib/pam_zfs_key/Makefile index cf43802090dd..c35a8a6bd615 100644 --- a/cddl/lib/pam_zfs_key/Makefile +++ b/cddl/lib/pam_zfs_key/Makefile @@ -1,7 +1,7 @@ .PATH: ${SRCTOP}/sys/contrib/openzfs/contrib/pam_zfs_key .PATH: ${SRCTOP}/sys/contrib/openzfs/include -PACKAGE= utilities +PACKAGE= zfs LIB= pam_zfs_key SHLIBDIR?= /usr/lib diff --git a/cddl/lib/tests/Makefile b/cddl/lib/tests/Makefile index 3b3078f8612a..b8996030aafc 100644 --- a/cddl/lib/tests/Makefile +++ b/cddl/lib/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/tests KYUAFILE= yes diff --git a/cddl/lib/tests/Makefile.depend b/cddl/lib/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/lib/tests/Makefile.depend +++ b/cddl/lib/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/sbin/Makefile b/cddl/sbin/Makefile index 2b3dcf886246..b0e1448c6455 100644 --- a/cddl/sbin/Makefile +++ b/cddl/sbin/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> diff --git a/cddl/sbin/Makefile.inc b/cddl/sbin/Makefile.inc index c5111d5cb286..9f2b933fcf06 100644 --- a/cddl/sbin/Makefile.inc +++ b/cddl/sbin/Makefile.inc @@ -1,4 +1,3 @@ -# $FreeBSD$ BINDIR?= /sbin diff --git a/cddl/sbin/tests/Makefile b/cddl/sbin/tests/Makefile index 3b3078f8612a..b8996030aafc 100644 --- a/cddl/sbin/tests/Makefile +++ b/cddl/sbin/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/tests KYUAFILE= yes diff --git a/cddl/sbin/tests/Makefile.depend b/cddl/sbin/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/sbin/tests/Makefile.depend +++ b/cddl/sbin/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/sbin/zfs/Makefile b/cddl/sbin/zfs/Makefile index 6a6ef62e4fce..a47302c709d5 100644 --- a/cddl/sbin/zfs/Makefile +++ b/cddl/sbin/zfs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs @@ -7,7 +6,7 @@ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/man/man8 .PATH: ${ZFSTOP}/module/os/freebsd/spl -PACKAGE= runtime +PACKAGE= zfs PROG= zfs MAN= \ zfs.8 \ @@ -77,3 +76,5 @@ CFLAGS+= \ LIBADD= jail avl nvpair geom uutil zfs_core spl tpool zutil zfs m crypto LDADD+= -pthread .include <bsd.prog.mk> + +CWARNFLAGS.zfs_main.c+= -Wno-unused-variable diff --git a/cddl/sbin/zfs/Makefile.depend b/cddl/sbin/zfs/Makefile.depend index b22dd60b0ef8..41b9cb996621 100644 --- a/cddl/sbin/zfs/Makefile.depend +++ b/cddl/sbin/zfs/Makefile.depend @@ -1,28 +1,24 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libavl \ cddl/lib/libnvpair \ - cddl/lib/libumem \ + cddl/lib/libspl \ + cddl/lib/libtpool \ cddl/lib/libuutil \ cddl/lib/libzfs \ cddl/lib/libzfs_core \ - gnu/lib/csu \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libexpat \ lib/libgeom \ lib/libjail \ - lib/libmd \ - lib/libsbuf \ lib/libthr \ - lib/libutil \ - lib/libz \ lib/msun \ + secure/lib/libcrypto \ .include <dirdeps.mk> diff --git a/cddl/sbin/zpool/Makefile b/cddl/sbin/zpool/Makefile index 4c2a8b94de19..5a47890e58f4 100644 --- a/cddl/sbin/zpool/Makefile +++ b/cddl/sbin/zpool/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs @@ -10,10 +9,11 @@ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/cmd/zpool/os/freebsd -PACKAGE= runtime +PACKAGE= zfs PROG= zpool MAN= \ spl.4 \ + vdevprops.7 \ zfs.4 \ zpool.8 \ zpool-add.8 \ diff --git a/cddl/sbin/zpool/Makefile.depend b/cddl/sbin/zpool/Makefile.depend index 53090da6e2fc..117ee30093fd 100644 --- a/cddl/sbin/zpool/Makefile.depend +++ b/cddl/sbin/zpool/Makefile.depend @@ -1,26 +1,21 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libavl \ cddl/lib/libnvpair \ - cddl/lib/libumem \ + cddl/lib/libspl \ + cddl/lib/libtpool \ cddl/lib/libuutil \ cddl/lib/libzfs \ cddl/lib/libzfs_core \ - gnu/lib/csu \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libexpat \ lib/libgeom \ - lib/libmd \ - lib/libsbuf \ lib/libthr \ - lib/libutil \ - lib/libz \ lib/msun \ diff --git a/cddl/share/Makefile b/cddl/share/Makefile index 258b60877f75..2e291b9425ed 100644 --- a/cddl/share/Makefile +++ b/cddl/share/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> diff --git a/cddl/share/zfs/Makefile b/cddl/share/zfs/Makefile index 98e10b60aae6..a1fc04899b6e 100644 --- a/cddl/share/zfs/Makefile +++ b/cddl/share/zfs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> diff --git a/cddl/share/zfs/compatibility.d/Makefile b/cddl/share/zfs/compatibility.d/Makefile index 255f4a3542b3..13d88fef184d 100644 --- a/cddl/share/zfs/compatibility.d/Makefile +++ b/cddl/share/zfs/compatibility.d/Makefile @@ -1,9 +1,10 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/cmd/zpool/compatibility.d +PACKAGE= zfs + FILES= \ compat-2018 \ compat-2019 \ @@ -21,6 +22,7 @@ FILES= \ openzfs-2.0-linux \ openzfs-2.1-freebsd \ openzfs-2.1-linux \ + openzfs-2.2 \ zol-0.6.1 \ zol-0.6.4 \ zol-0.6.5 \ @@ -41,12 +43,17 @@ LINKS= \ ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.0 \ ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.1 \ ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.2 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.3 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.4 \ ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freenas-11.3 \ ${FILESDIR}/freenas-11.0 ${FILESDIR}/freenas-11.1 \ ${FILESDIR}/openzfsonosx-1.9.3 ${FILESDIR}/openzfsonosx-1.9.4 \ ${FILESDIR}/openzfs-2.0-freebsd ${FILESDIR}/truenas-12.0 \ ${FILESDIR}/zol-0.7 ${FILESDIR}/ubuntu-18.04 \ - ${FILESDIR}/zol-0.8 ${FILESDIR}/ubuntu-20.04 + ${FILESDIR}/zol-0.8 ${FILESDIR}/ubuntu-20.04 \ + ${FILESDIR}/openzfs-2.1-linux ${FILESDIR}/ubuntu-22.04 \ + ${FILESDIR}/openzfs-2.2 ${FILESDIR}/openzfs-2.2-linux \ + ${FILESDIR}/openzfs-2.2 ${FILESDIR}/openzfs-2.2-freebsd LINKMODE= ${NOBINMODE} diff --git a/cddl/tests/Makefile b/cddl/tests/Makefile index 3b3078f8612a..b8996030aafc 100644 --- a/cddl/tests/Makefile +++ b/cddl/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/tests KYUAFILE= yes diff --git a/cddl/tests/Makefile.depend b/cddl/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/tests/Makefile.depend +++ b/cddl/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.bin/Makefile b/cddl/usr.bin/Makefile index 97c4639cece0..ccf441cbabeb 100644 --- a/cddl/usr.bin/Makefile +++ b/cddl/usr.bin/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> diff --git a/cddl/usr.bin/Makefile.inc b/cddl/usr.bin/Makefile.inc index 4cec6fe01a45..78a3af23f3cc 100644 --- a/cddl/usr.bin/Makefile.inc +++ b/cddl/usr.bin/Makefile.inc @@ -1,4 +1,3 @@ -# $FreeBSD$ BINDIR?= /usr/bin diff --git a/cddl/usr.bin/ctfconvert/Makefile b/cddl/usr.bin/ctfconvert/Makefile index 78b65020452a..5dd38fbb5329 100644 --- a/cddl/usr.bin/ctfconvert/Makefile +++ b/cddl/usr.bin/ctfconvert/Makefile @@ -1,10 +1,10 @@ -# $FreeBSD$ .include <src.opts.mk> .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt +PACKAGE= ctf-tools PROG= ctfconvert SRCS= alist.c \ ctf.c \ diff --git a/cddl/usr.bin/ctfconvert/Makefile.depend b/cddl/usr.bin/ctfconvert/Makefile.depend index eb40124b7c90..69aabda6c27e 100644 --- a/cddl/usr.bin/ctfconvert/Makefile.depend +++ b/cddl/usr.bin/ctfconvert/Makefile.depend @@ -1,11 +1,9 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ + cddl/lib/libspl \ include \ include/xlocale \ - cddl/lib/libspl \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ diff --git a/cddl/usr.bin/ctfconvert/ctfconvert.1 b/cddl/usr.bin/ctfconvert/ctfconvert.1 index c7b01c9315ce..7697513d0740 100644 --- a/cddl/usr.bin/ctfconvert/ctfconvert.1 +++ b/cddl/usr.bin/ctfconvert/ctfconvert.1 @@ -26,8 +26,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd April 21, 2022 .Dt CTFCONVERT 1 .Os diff --git a/cddl/usr.bin/ctfconvert/tests/Makefile b/cddl/usr.bin/ctfconvert/tests/Makefile index 431a1f25bd9f..101282261dd0 100644 --- a/cddl/usr.bin/ctfconvert/tests/Makefile +++ b/cddl/usr.bin/ctfconvert/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ ATF_TESTS_SH+= ctfconvert_test diff --git a/cddl/usr.bin/ctfconvert/tests/ctfconvert_test.sh b/cddl/usr.bin/ctfconvert/tests/ctfconvert_test.sh index 04723fd08ad3..f19383cfbb4f 100644 --- a/cddl/usr.bin/ctfconvert/tests/ctfconvert_test.sh +++ b/cddl/usr.bin/ctfconvert/tests/ctfconvert_test.sh @@ -23,7 +23,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD$ # usage_output='Usage: ctfconvert' diff --git a/cddl/usr.bin/ctfdump/Makefile b/cddl/usr.bin/ctfdump/Makefile index d7ddd45d9778..60ae9a0033b7 100644 --- a/cddl/usr.bin/ctfdump/Makefile +++ b/cddl/usr.bin/ctfdump/Makefile @@ -1,8 +1,8 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/dump +PACKAGE= ctf-tools PROG= ctfdump SRCS= dump.c \ symbol.c \ diff --git a/cddl/usr.bin/ctfdump/Makefile.depend b/cddl/usr.bin/ctfdump/Makefile.depend index ceebc6a83a34..edb476e399d9 100644 --- a/cddl/usr.bin/ctfdump/Makefile.depend +++ b/cddl/usr.bin/ctfdump/Makefile.depend @@ -1,8 +1,6 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ diff --git a/cddl/usr.bin/ctfdump/ctfdump.1 b/cddl/usr.bin/ctfdump/ctfdump.1 index 68764d11b0f9..27dfe6563645 100644 --- a/cddl/usr.bin/ctfdump/ctfdump.1 +++ b/cddl/usr.bin/ctfdump/ctfdump.1 @@ -26,8 +26,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd April 21, 2022 .Dt CTFDUMP 1 .Os diff --git a/cddl/usr.bin/ctfmerge/Makefile b/cddl/usr.bin/ctfmerge/Makefile index e9c8e505ed76..e7ad35ab097d 100644 --- a/cddl/usr.bin/ctfmerge/Makefile +++ b/cddl/usr.bin/ctfmerge/Makefile @@ -1,8 +1,8 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt +PACKAGE= ctf-tools PROG= ctfmerge SRCS= alist.c \ barrier.c \ diff --git a/cddl/usr.bin/ctfmerge/Makefile.depend b/cddl/usr.bin/ctfmerge/Makefile.depend index 32a1985bd180..e724f22559ff 100644 --- a/cddl/usr.bin/ctfmerge/Makefile.depend +++ b/cddl/usr.bin/ctfmerge/Makefile.depend @@ -1,8 +1,7 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ + cddl/lib/libspl \ include \ include/xlocale \ lib/${CSU_DIR} \ diff --git a/cddl/usr.bin/ctfmerge/ctfmerge.1 b/cddl/usr.bin/ctfmerge/ctfmerge.1 index b84bd8c84ead..2bc70db82dc9 100644 --- a/cddl/usr.bin/ctfmerge/ctfmerge.1 +++ b/cddl/usr.bin/ctfmerge/ctfmerge.1 @@ -26,8 +26,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd April 21, 2022 .Dt CTFMERGE 1 .Os diff --git a/cddl/usr.bin/tests/Makefile b/cddl/usr.bin/tests/Makefile index 3b3078f8612a..b8996030aafc 100644 --- a/cddl/usr.bin/tests/Makefile +++ b/cddl/usr.bin/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/tests KYUAFILE= yes diff --git a/cddl/usr.bin/tests/Makefile.depend b/cddl/usr.bin/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.bin/tests/Makefile.depend +++ b/cddl/usr.bin/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.bin/zinject/Makefile b/cddl/usr.bin/zinject/Makefile index fcc472c24214..71cd4776d339 100644 --- a/cddl/usr.bin/zinject/Makefile +++ b/cddl/usr.bin/zinject/Makefile @@ -1,10 +1,10 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/cmd/zinject .PATH: ${ZFSTOP}/man/man8 +PACKAGE= zfs PROG= zinject INCS= zinject.h SRCS= zinject.c translate.c diff --git a/cddl/usr.bin/zinject/Makefile.depend b/cddl/usr.bin/zinject/Makefile.depend index dfb2563fa7d1..c36e0e5ad2e7 100644 --- a/cddl/usr.bin/zinject/Makefile.depend +++ b/cddl/usr.bin/zinject/Makefile.depend @@ -1,27 +1,21 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libavl \ cddl/lib/libnvpair \ + cddl/lib/libspl \ cddl/lib/libumem \ cddl/lib/libuutil \ cddl/lib/libzfs \ cddl/lib/libzfs_core \ cddl/lib/libzpool \ - gnu/lib/csu \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libexpat \ lib/libgeom \ - lib/libmd \ - lib/libsbuf \ - lib/libthr \ - lib/libutil \ - lib/libz \ lib/msun \ diff --git a/cddl/usr.bin/zstream/Makefile b/cddl/usr.bin/zstream/Makefile index 6296390592b3..4444973b2211 100644 --- a/cddl/usr.bin/zstream/Makefile +++ b/cddl/usr.bin/zstream/Makefile @@ -1,10 +1,10 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/cmd/zstream .PATH: ${ZFSTOP}/man/man8 +PACKAGE= zfs PROG= zstream MAN= zstream.8 MLINKS= zstream.8 zstreamdump.8 @@ -13,6 +13,7 @@ SRCS= \ zstream.c \ zstream_decompress.c \ zstream_dump.c \ + zstream_recompress.c \ zstream_redup.c \ zstream_token.c diff --git a/cddl/usr.bin/ztest/Makefile b/cddl/usr.bin/ztest/Makefile index 91118d13775d..2913349eccc1 100644 --- a/cddl/usr.bin/ztest/Makefile +++ b/cddl/usr.bin/ztest/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> @@ -7,6 +6,7 @@ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/cmd .PATH: ${ZFSTOP}/man/man1 +PACKAGE= zfs PROG= ztest MAN= ztest.1 diff --git a/cddl/usr.bin/ztest/Makefile.depend b/cddl/usr.bin/ztest/Makefile.depend index dfb2563fa7d1..dd387951fe20 100644 --- a/cddl/usr.bin/ztest/Makefile.depend +++ b/cddl/usr.bin/ztest/Makefile.depend @@ -1,27 +1,23 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libavl \ + cddl/lib/libicp \ cddl/lib/libnvpair \ + cddl/lib/libspl \ cddl/lib/libumem \ cddl/lib/libuutil \ cddl/lib/libzfs \ cddl/lib/libzfs_core \ cddl/lib/libzpool \ - gnu/lib/csu \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libexpat \ lib/libgeom \ - lib/libmd \ - lib/libsbuf \ lib/libthr \ - lib/libutil \ - lib/libz \ lib/msun \ diff --git a/cddl/usr.bin/ztest/tests/Makefile b/cddl/usr.bin/ztest/tests/Makefile index edf2a537dbe3..824497940b20 100644 --- a/cddl/usr.bin/ztest/tests/Makefile +++ b/cddl/usr.bin/ztest/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <bsd.own.mk> diff --git a/cddl/usr.bin/ztest/tests/ztest.sh b/cddl/usr.bin/ztest/tests/ztest.sh index 9945d1a45aa9..8bc377917992 100755 --- a/cddl/usr.bin/ztest/tests/ztest.sh +++ b/cddl/usr.bin/ztest/tests/ztest.sh @@ -1,6 +1,5 @@ # # Test Case: ztest -# $FreeBSD$ # atf_test_case ztest ztest_head() diff --git a/cddl/usr.libexec/Makefile b/cddl/usr.libexec/Makefile index 7b7dfc7bd354..9eb4872b69d5 100644 --- a/cddl/usr.libexec/Makefile +++ b/cddl/usr.libexec/Makefile @@ -1,8 +1,8 @@ -# $FreeBSD$ .include <src.opts.mk> SUBDIR.${MK_ZFS}+= \ + zfs_prepare_disk \ zpool_influxdb SUBDIR_PARALLEL= diff --git a/cddl/usr.libexec/zfs_prepare_disk/Makefile b/cddl/usr.libexec/zfs_prepare_disk/Makefile new file mode 100644 index 000000000000..e75484c6dc59 --- /dev/null +++ b/cddl/usr.libexec/zfs_prepare_disk/Makefile @@ -0,0 +1,20 @@ + +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs + +.PATH: ${ZFSTOP}/scripts + +PACKAGE= zfs +SCRIPTS= zfs_prepare_disk +SCRIPTSDIR= ${LIBEXECDIR}/zfs + +.PATH: ${ZFSTOP}/man/man8 +MAN= zfs_prepare_disk.8 + +CLEANFILES+= zfs_prepare_disk.8 + +zfs_prepare_disk.8: zfs_prepare_disk.8.in + sed ${MAN_SUB} ${.ALLSRC} >${.TARGET} + +MAN_SUB+= -e 's|@zfsexecdir@|${LIBEXECDIR}/zfs|g' + +.include <bsd.prog.mk> diff --git a/cddl/usr.libexec/zpool_influxdb/Makefile b/cddl/usr.libexec/zpool_influxdb/Makefile index 2fb22f02ef32..7c0a245903a7 100644 --- a/cddl/usr.libexec/zpool_influxdb/Makefile +++ b/cddl/usr.libexec/zpool_influxdb/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs diff --git a/cddl/usr.libexec/zpool_influxdb/Makefile.depend b/cddl/usr.libexec/zpool_influxdb/Makefile.depend index 53090da6e2fc..50b043094969 100644 --- a/cddl/usr.libexec/zpool_influxdb/Makefile.depend +++ b/cddl/usr.libexec/zpool_influxdb/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/Makefile b/cddl/usr.sbin/Makefile index 68dc735b3d1b..b3bf139feaef 100644 --- a/cddl/usr.sbin/Makefile +++ b/cddl/usr.sbin/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> @@ -12,8 +11,7 @@ SUBDIR.${MK_TESTS}+= tests SUBDIR.${MK_ZFS}+= \ zdb \ - zhack -SUBDIR.${MK_ZFS}.${MK_CXX}+= \ + zhack \ zfsd .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" diff --git a/cddl/usr.sbin/Makefile.inc b/cddl/usr.sbin/Makefile.inc index 282198ea8d8c..5c01baa093b7 100644 --- a/cddl/usr.sbin/Makefile.inc +++ b/cddl/usr.sbin/Makefile.inc @@ -1,4 +1,3 @@ -# $FreeBSD$ BINDIR?= /usr/sbin diff --git a/cddl/usr.sbin/dtrace/Makefile b/cddl/usr.sbin/dtrace/Makefile index d8510e62fb29..0a1ad0b81da0 100644 --- a/cddl/usr.sbin/dtrace/Makefile +++ b/cddl/usr.sbin/dtrace/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> @@ -30,7 +29,12 @@ CFLAGS+= -DHAVE_ISSETUGID #CFLAGS+= -DNEED_ERRLOC #YFLAGS+= -d -LIBADD= dtrace ctf elf proc spl +.if ${MK_DTRACE_ASAN} != "no" +CFLAGS+= -fsanitize=address -fsanitize=undefined +LDFLAGS+= -fsanitize=address -fsanitize=undefined +.endif + +LIBADD= dtrace ctf elf proc spl xo .if ${MK_DTRACE_TESTS} != "no" SUBDIR+= tests diff --git a/cddl/usr.sbin/dtrace/Makefile.depend b/cddl/usr.sbin/dtrace/Makefile.depend index c37ef4acf01e..244baabbff3d 100644 --- a/cddl/usr.sbin/dtrace/Makefile.depend +++ b/cddl/usr.sbin/dtrace/Makefile.depend @@ -1,24 +1,17 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libctf \ cddl/lib/libdtrace \ - gnu/lib/csu \ + cddl/lib/libspl \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libcxxrt \ lib/libelf \ - lib/libkvm \ lib/libproc \ - lib/libprocstat \ lib/librtld_db \ - lib/libthr \ - lib/libutil \ - lib/libz \ .include <dirdeps.mk> diff --git a/cddl/usr.sbin/dtrace/tests/Makefile b/cddl/usr.sbin/dtrace/tests/Makefile index a311126f38b5..c7391dec2416 100644 --- a/cddl/usr.sbin/dtrace/tests/Makefile +++ b/cddl/usr.sbin/dtrace/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <bsd.own.mk> diff --git a/cddl/usr.sbin/dtrace/tests/Makefile.depend b/cddl/usr.sbin/dtrace/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/amd64/Makefile b/cddl/usr.sbin/dtrace/tests/amd64/Makefile index 39ccd333bedf..049692a46cd5 100644 --- a/cddl/usr.sbin/dtrace/tests/amd64/Makefile +++ b/cddl/usr.sbin/dtrace/tests/amd64/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/amd64 TESTS_SUBDIRS+= arrays diff --git a/cddl/usr.sbin/dtrace/tests/amd64/arrays/Makefile b/cddl/usr.sbin/dtrace/tests/amd64/arrays/Makefile index 0308ba5083e1..60d6cdfd1f9f 100644 --- a/cddl/usr.sbin/dtrace/tests/amd64/arrays/Makefile +++ b/cddl/usr.sbin/dtrace/tests/amd64/arrays/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/Makefile b/cddl/usr.sbin/dtrace/tests/common/Makefile index c395269e7aa9..9f694cabf99a 100644 --- a/cddl/usr.sbin/dtrace/tests/common/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # We exclude several subdirectories: nfs and sysevent do not compile on # FreeBSD, and docsExamples doesn't seem amenable to automated testing. @@ -32,6 +31,7 @@ TESTS_SUBDIRS+= aggs \ ip \ java_api \ json \ + kinst \ lexer \ llquantize \ mdb \ @@ -39,6 +39,7 @@ TESTS_SUBDIRS+= aggs \ misc \ multiaggs \ offsetof \ + oformat \ operators \ pid \ plockstat \ diff --git a/cddl/usr.sbin/dtrace/tests/common/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile b/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile index b5e95bc8fd67..a3c7736f20f7 100644 --- a/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile b/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile index 2abee2f8598e..d573cb4b06c6 100644 --- a/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile b/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile index abbc48322795..032f47461a92 100644 --- a/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile b/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile index d7e64b8e4501..772b560bb516 100644 --- a/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/begin/Makefile b/cddl/usr.sbin/dtrace/tests/common/begin/Makefile index 1c254bfe2958..c540a96cfaf4 100644 --- a/cddl/usr.sbin/dtrace/tests/common/begin/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/begin/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/begin/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/begin/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/begin/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/begin/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile b/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile index 903e19262f73..2b3499fa092b 100644 --- a/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile b/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile index e9680e57088c..7f6223e3796e 100644 --- a/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile b/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile index 962e8c9bddb8..b0cbc7961e9b 100644 --- a/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/cg/Makefile b/cddl/usr.sbin/dtrace/tests/common/cg/Makefile index e98af5191aea..104dc2063a8c 100644 --- a/cddl/usr.sbin/dtrace/tests/common/cg/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/cg/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/cg/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/cg/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/cg/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/cg/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile b/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile index 0e835239c35d..ecd84a68928d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile b/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile index 7b8e85d904e7..75d5bebfaf93 100644 --- a/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/decls/Makefile b/cddl/usr.sbin/dtrace/tests/common/decls/Makefile index bd3bf7716feb..1c0800355eff 100644 --- a/cddl/usr.sbin/dtrace/tests/common/decls/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/decls/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/decls/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/decls/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/decls/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/decls/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile b/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile index 5ca7d0908fd7..4115176de9af 100644 --- a/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/drops/Makefile b/cddl/usr.sbin/dtrace/tests/common/drops/Makefile index 4f1973c69b26..b7edb1177a78 100644 --- a/cddl/usr.sbin/dtrace/tests/common/drops/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/drops/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/drops/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/drops/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/drops/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/drops/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile b/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile index dc77d8f0bc04..6d3815bbc80d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/end/Makefile b/cddl/usr.sbin/dtrace/tests/common/end/Makefile index a05361ec4a39..8bc3ec2c65df 100644 --- a/cddl/usr.sbin/dtrace/tests/common/end/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/end/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/end/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/end/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/end/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/end/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/enum/Makefile b/cddl/usr.sbin/dtrace/tests/common/enum/Makefile index 9b78801d4c2f..463824118757 100644 --- a/cddl/usr.sbin/dtrace/tests/common/enum/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/enum/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/enum/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/enum/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/enum/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/enum/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/env/Makefile b/cddl/usr.sbin/dtrace/tests/common/env/Makefile index 9c37c28b448b..35eff477d4bb 100644 --- a/cddl/usr.sbin/dtrace/tests/common/env/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/env/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/error/Makefile b/cddl/usr.sbin/dtrace/tests/common/error/Makefile index afd93dd222ee..372a8968585f 100644 --- a/cddl/usr.sbin/dtrace/tests/common/error/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/error/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/error/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/error/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/error/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/error/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/exit/Makefile b/cddl/usr.sbin/dtrace/tests/common/exit/Makefile index 3732caa83335..ded0777e452b 100644 --- a/cddl/usr.sbin/dtrace/tests/common/exit/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/exit/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/exit/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/exit/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/exit/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/exit/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile index c773b78ba795..4aaf2013d59f 100644 --- a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile b/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile index 67d0b3cc4928..2fb59dc91f1d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile b/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile index b9b94f2c6b35..0e07006bc116 100644 --- a/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/include/Makefile b/cddl/usr.sbin/dtrace/tests/common/include/Makefile index d84f25bef30d..6d01872ad48c 100644 --- a/cddl/usr.sbin/dtrace/tests/common/include/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/include/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/include/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/include/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/include/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/include/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/inline/Makefile b/cddl/usr.sbin/dtrace/tests/common/inline/Makefile index 3a30b97d3cb6..e3ff5a1e9a84 100644 --- a/cddl/usr.sbin/dtrace/tests/common/inline/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/inline/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/inline/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/inline/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/inline/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/inline/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/io/Makefile b/cddl/usr.sbin/dtrace/tests/common/io/Makefile index 9075358230c4..58e1d3ed2745 100644 --- a/cddl/usr.sbin/dtrace/tests/common/io/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/io/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/io/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/io/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/io/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/io/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/ip/Makefile b/cddl/usr.sbin/dtrace/tests/common/ip/Makefile index 25a214b7f37b..73cc3443d987 100644 --- a/cddl/usr.sbin/dtrace/tests/common/ip/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/ip/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/ip/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/ip/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/ip/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/ip/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile b/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile index 7c7fdef9c008..08072d19e0ed 100644 --- a/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/json/Makefile b/cddl/usr.sbin/dtrace/tests/common/json/Makefile index 24400027c1e4..c004df07d6ef 100644 --- a/cddl/usr.sbin/dtrace/tests/common/json/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/json/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/json/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/json/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/json/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/json/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/kinst/Makefile b/cddl/usr.sbin/dtrace/tests/common/kinst/Makefile new file mode 100644 index 000000000000..f33a649010a5 --- /dev/null +++ b/cddl/usr.sbin/dtrace/tests/common/kinst/Makefile @@ -0,0 +1,18 @@ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.basic.ksh \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" diff --git a/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile b/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile index d53872a0361b..abeb9f04ea5d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile index ed99dd1e116f..a73998387cc5 100644 --- a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile b/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile index 26c26e7ba558..855582e677d7 100644 --- a/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/mib/Makefile b/cddl/usr.sbin/dtrace/tests/common/mib/Makefile index ed799e68a879..573cc5ec1033 100644 --- a/cddl/usr.sbin/dtrace/tests/common/mib/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/mib/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/mib/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/mib/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/mib/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/mib/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/misc/Makefile b/cddl/usr.sbin/dtrace/tests/common/misc/Makefile index 87084ab5d593..2bd6eb69a1d2 100644 --- a/cddl/usr.sbin/dtrace/tests/common/misc/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/misc/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/misc/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/misc/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/misc/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/misc/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile b/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile index 2c0c4263a909..906d3e4bc4a7 100644 --- a/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile b/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile index b50285991374..ae820ee08c88 100644 --- a/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile b/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile index 2f56b12a035c..6973488a7d28 100644 --- a/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/oformat/Makefile b/cddl/usr.sbin/dtrace/tests/common/oformat/Makefile new file mode 100644 index 000000000000..219833285d0c --- /dev/null +++ b/cddl/usr.sbin/dtrace/tests/common/oformat/Makefile @@ -0,0 +1,42 @@ +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.agg.avg.ksh \ + tst.agg.count.ksh \ + tst.agg.llquantize.ksh \ + tst.agg.lquantize.ksh \ + tst.agg.max.ksh \ + tst.agg.min.ksh \ + tst.agg.quantize.ksh \ + tst.agg.stddev.ksh \ + tst.agg.sum.ksh \ + tst.aggmod.ksh \ + tst.aggstack.ksh \ + tst.aggsym.ksh \ + tst.aggustack.ksh \ + tst.aggusym.ksh \ + tst.drop.ksh \ + tst.mod.ksh \ + tst.print.ksh \ + tst.printf.ksh \ + tst.printm.ksh \ + tst.stack.ksh \ + tst.sym.ksh \ + tst.trace.ksh \ + tst.tracemem.ksh \ + tst.umod.ksh \ + tst.ustack.ksh \ + tst.usym.ksh \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" diff --git a/cddl/usr.sbin/dtrace/tests/common/operators/Makefile b/cddl/usr.sbin/dtrace/tests/common/operators/Makefile index daf530b93b62..ccbbe083c13c 100644 --- a/cddl/usr.sbin/dtrace/tests/common/operators/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/operators/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/operators/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/operators/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/operators/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/operators/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/pid/Makefile b/cddl/usr.sbin/dtrace/tests/common/pid/Makefile index 0b9fdeb8bb6e..0058a1100196 100644 --- a/cddl/usr.sbin/dtrace/tests/common/pid/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/pid/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/pid/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/pid/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/pid/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/pid/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile b/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile index 57e30ed99036..ec40ac7ae151 100644 --- a/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile b/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile index af438aaaac2c..55921d888df8 100644 --- a/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile b/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile index 26b6920d0b0c..b00a28915ea1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile b/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile index bd14b43757f6..d0a983398dd6 100644 --- a/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile b/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile index f8b8917be205..11ac3dc1107d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/print/Makefile b/cddl/usr.sbin/dtrace/tests/common/print/Makefile index af4e20e30557..ecd2bee5d677 100644 --- a/cddl/usr.sbin/dtrace/tests/common/print/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/print/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/print/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/print/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/print/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/print/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/printa/Makefile b/cddl/usr.sbin/dtrace/tests/common/printa/Makefile index 8f5ac3613dcb..895c00fc589f 100644 --- a/cddl/usr.sbin/dtrace/tests/common/printa/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/printa/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/printa/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/printa/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/printa/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/printa/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/printf/Makefile b/cddl/usr.sbin/dtrace/tests/common/printf/Makefile index 86cfdbbd5d9b..97b9c89bc63c 100644 --- a/cddl/usr.sbin/dtrace/tests/common/printf/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/printf/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/printf/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/printf/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/printf/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/printf/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/privs/Makefile b/cddl/usr.sbin/dtrace/tests/common/privs/Makefile index 36f6106f8f96..a53c8d87f70f 100644 --- a/cddl/usr.sbin/dtrace/tests/common/privs/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/privs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/privs/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/privs/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/privs/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/privs/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/probes/Makefile b/cddl/usr.sbin/dtrace/tests/common/probes/Makefile index 7e02b9a73900..718afcbbc375 100644 --- a/cddl/usr.sbin/dtrace/tests/common/probes/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/probes/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/probes/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/probes/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/probes/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/probes/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile index 296634da3e38..92491ab55acf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile.depend index 564eb51e0156..ab828d5334d8 100644 --- a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile b/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile index 4e5a0157ecff..0e5439792b20 100644 --- a/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile.depend index 03d33794d0e3..af9acf31579d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/providers/Makefile b/cddl/usr.sbin/dtrace/tests/common/providers/Makefile index 3972831ba5d5..31304c1bea7d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/providers/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/providers/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/providers/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/providers/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/providers/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/providers/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/raise/Makefile b/cddl/usr.sbin/dtrace/tests/common/raise/Makefile index 83af0e40de1f..653d545eb5e0 100644 --- a/cddl/usr.sbin/dtrace/tests/common/raise/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/raise/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/raise/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/raise/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/raise/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/raise/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/rates/Makefile b/cddl/usr.sbin/dtrace/tests/common/rates/Makefile index bc9ab0a9d446..4710339fe9ac 100644 --- a/cddl/usr.sbin/dtrace/tests/common/rates/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/rates/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/rates/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/rates/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/rates/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/rates/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/safety/Makefile b/cddl/usr.sbin/dtrace/tests/common/safety/Makefile index 51b302fd3ad7..d3ce7c97abec 100644 --- a/cddl/usr.sbin/dtrace/tests/common/safety/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/safety/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/safety/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/safety/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/safety/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/safety/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile b/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile index 9f019068da35..0d78e9b7117f 100644 --- a/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/sched/Makefile b/cddl/usr.sbin/dtrace/tests/common/sched/Makefile index d1bf42553346..79791b6affb6 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sched/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/sched/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/sched/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/sched/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sched/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/sched/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile b/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile index 1562629423ea..200668c94d50 100644 --- a/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile b/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile index ad0a43e4047e..cc856e43924e 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile b/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile index 021d0099b213..3dc50694e7b7 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile b/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile index 5afee0225e89..9726906660f9 100644 --- a/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/stability/Makefile b/cddl/usr.sbin/dtrace/tests/common/stability/Makefile index 826202d4de3f..3eada9ad78ed 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stability/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/stability/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/stability/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/stability/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stability/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/stability/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/stack/Makefile b/cddl/usr.sbin/dtrace/tests/common/stack/Makefile index 2fc1e8164dc6..350ab18e8a03 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stack/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/stack/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/stack/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/stack/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stack/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/stack/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile b/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile index e7beb43fa827..3dc20ffa2f16 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/stop/Makefile b/cddl/usr.sbin/dtrace/tests/common/stop/Makefile index 50a44bbd0a98..8583c29bf1a5 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stop/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/stop/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/stop/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/stop/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/stop/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/stop/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile b/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile index 19937d3055eb..4eea0b538b16 100644 --- a/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile b/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile index 0ccc037d8bf3..a45315d01e33 100644 --- a/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/struct/Makefile b/cddl/usr.sbin/dtrace/tests/common/struct/Makefile index 35dd51a8067c..e35235dc2b6d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/struct/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/struct/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/struct/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/struct/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/struct/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/struct/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile b/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile index 40fc86a45ce0..4c9621e6c3c7 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile b/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile index f759b6bd398f..2d3aaf1236cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile b/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile index d87b2bbaf042..2c6b909acfaf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile b/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile index 1800635351d7..76e8f4282813 100644 --- a/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/trace/Makefile b/cddl/usr.sbin/dtrace/tests/common/trace/Makefile index 19ff8e44230b..be7c86bca876 100644 --- a/cddl/usr.sbin/dtrace/tests/common/trace/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/trace/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/trace/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/trace/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/trace/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/trace/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile b/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile index 29b0ea26e691..3006ec1ff4a5 100644 --- a/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/translators/Makefile b/cddl/usr.sbin/dtrace/tests/common/translators/Makefile index 6d38d1d63e36..57cedb2cbcce 100644 --- a/cddl/usr.sbin/dtrace/tests/common/translators/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/translators/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/translators/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/translators/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/translators/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/translators/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile b/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile index d3edcfd071ed..3bbc8fa3344d 100644 --- a/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/types/Makefile b/cddl/usr.sbin/dtrace/tests/common/types/Makefile index 89c2947f2632..553037dd91d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/types/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/types/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/types/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/types/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/types/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/types/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile b/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile index 945a853b69df..0a50173d3a84 100644 --- a/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/union/Makefile b/cddl/usr.sbin/dtrace/tests/common/union/Makefile index 855869f05f04..4bb51f899a16 100644 --- a/cddl/usr.sbin/dtrace/tests/common/union/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/union/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/union/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/union/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/union/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/union/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile b/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile index dd5571980d1d..edf3c451e9cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile b/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile index 6ea0621a0c29..75931649250b 100644 --- a/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile.depend index cae7e645ef6a..d80b3a4991d1 100644 --- a/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/vars/Makefile b/cddl/usr.sbin/dtrace/tests/common/vars/Makefile index bced0bf6da53..29cf09bd1a49 100644 --- a/cddl/usr.sbin/dtrace/tests/common/vars/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/vars/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/vars/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/vars/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/vars/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/vars/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/common/version/Makefile b/cddl/usr.sbin/dtrace/tests/common/version/Makefile index 3f1589f4249c..ccce43d023fa 100644 --- a/cddl/usr.sbin/dtrace/tests/common/version/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/version/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/common/version/Makefile.depend b/cddl/usr.sbin/dtrace/tests/common/version/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/dtrace/tests/common/version/Makefile.depend +++ b/cddl/usr.sbin/dtrace/tests/common/version/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk index 0da134c0cbc2..001dc6253f82 100644 --- a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk +++ b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk @@ -1,4 +1,3 @@ -# $FreeBSD$ TESTGROUP= ${.CURDIR:H:T}/${.CURDIR:T} TESTBASE= ${SRCTOP}/cddl/contrib/opensolaris/cmd/dtrace/test/tst @@ -13,7 +12,7 @@ ${TESTGROUP}EXEPACKAGE= ${PACKAGE} TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} -TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh" +TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh /usr/local/bin/jq /usr/local/bin/perl /usr/local/bin/xmllint" TEST_METADATA.t_dtrace_contrib+= required_user="root" GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh diff --git a/cddl/usr.sbin/dtrace/tests/i386/Makefile b/cddl/usr.sbin/dtrace/tests/i386/Makefile index bd6f7cf5ad5c..9501fd7f3cc2 100644 --- a/cddl/usr.sbin/dtrace/tests/i386/Makefile +++ b/cddl/usr.sbin/dtrace/tests/i386/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/i386 TESTS_SUBDIRS+= arrays \ diff --git a/cddl/usr.sbin/dtrace/tests/i386/arrays/Makefile b/cddl/usr.sbin/dtrace/tests/i386/arrays/Makefile index e97c9c64fbba..1cf9fdac093a 100644 --- a/cddl/usr.sbin/dtrace/tests/i386/arrays/Makefile +++ b/cddl/usr.sbin/dtrace/tests/i386/arrays/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/i386/funcs/Makefile b/cddl/usr.sbin/dtrace/tests/i386/funcs/Makefile index 64a00fa57d8b..231db7bb146d 100644 --- a/cddl/usr.sbin/dtrace/tests/i386/funcs/Makefile +++ b/cddl/usr.sbin/dtrace/tests/i386/funcs/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/i386/pid/Makefile b/cddl/usr.sbin/dtrace/tests/i386/pid/Makefile index 61fb328cbc7b..41f31d287fbb 100644 --- a/cddl/usr.sbin/dtrace/tests/i386/pid/Makefile +++ b/cddl/usr.sbin/dtrace/tests/i386/pid/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/i386/ustack/Makefile b/cddl/usr.sbin/dtrace/tests/i386/ustack/Makefile index bc7c6a2d34c0..0df96490d438 100644 --- a/cddl/usr.sbin/dtrace/tests/i386/ustack/Makefile +++ b/cddl/usr.sbin/dtrace/tests/i386/ustack/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. diff --git a/cddl/usr.sbin/dtrace/tests/tools/dtest.sh b/cddl/usr.sbin/dtrace/tests/tools/dtest.sh index dc1f0244739c..d2f3dc4ed8df 100755 --- a/cddl/usr.sbin/dtrace/tests/tools/dtest.sh +++ b/cddl/usr.sbin/dtrace/tests/tools/dtest.sh @@ -1,7 +1,5 @@ #!/bin/sh -# $FreeBSD$ - usage() { cat >&2 <<__EOF__ @@ -72,7 +70,7 @@ runtest() err.*.ksh|tst.*.ksh) expr "$TFILE" : 'err.*' >/dev/null && exstatus=1 - tst=$TFILE ksh "$TFILE" /usr/sbin/dtrace >$STDOUT 2>$STDERR + tst=$TFILE ksh -p "$TFILE" /usr/sbin/dtrace >$STDOUT 2>$STDERR status=$? if [ $status -ne $exstatus ]; then @@ -88,7 +86,7 @@ runtest() if [ $retval -eq 0 ] && \ head -n 1 $STDOUT | grep -q -E '^#!/.*ksh$'; then - ksh $STDOUT + ksh -p $STDOUT retval=$? fi @@ -121,6 +119,10 @@ test stdout: -- $(cat $STDOUT) -- +test stdout diff: +-- +$(diff -u $EXOUT $STDOUT) +-- __EOF__ fi if [ $(stat -f '%z' $STDERR) -gt 0 ]; then diff --git a/cddl/usr.sbin/dtrace/tests/tools/exclude.sh b/cddl/usr.sbin/dtrace/tests/tools/exclude.sh index 26e875073edd..dce5a843b605 100755 --- a/cddl/usr.sbin/dtrace/tests/tools/exclude.sh +++ b/cddl/usr.sbin/dtrace/tests/tools/exclude.sh @@ -1,4 +1,3 @@ -# $FreeBSD$ # This file lists DTrace tests which are known to fail or hang/crash the # system. They were pulled from the legacy DTrace test infrastructure in diff --git a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh index 4f756f7eaf3a..b3663a91d9ef 100755 --- a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh +++ b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh @@ -1,4 +1,3 @@ -# $FreeBSD$ usage() { @@ -60,8 +59,6 @@ WITH_CTF=YES local makefile=$(mktemp) cat <<__EOF__ > $makefile -# \$FreeBSD$ - # # This Makefile was generated by \$srcdir${ORIGINDIR#${TOPDIR}}/genmakefiles.sh. # diff --git a/cddl/usr.sbin/dtrace/tests/tools/gentest.sh b/cddl/usr.sbin/dtrace/tests/tools/gentest.sh index 6bad066e5419..5d8912ac29b0 100755 --- a/cddl/usr.sbin/dtrace/tests/tools/gentest.sh +++ b/cddl/usr.sbin/dtrace/tests/tools/gentest.sh @@ -1,4 +1,3 @@ -# $FreeBSD$ usage() { diff --git a/cddl/usr.sbin/dwatch/Makefile b/cddl/usr.sbin/dwatch/Makefile index aa2873ec4681..e146e744e844 100644 --- a/cddl/usr.sbin/dwatch/Makefile +++ b/cddl/usr.sbin/dwatch/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <src.opts.mk> diff --git a/cddl/usr.sbin/dwatch/dwatch b/cddl/usr.sbin/dwatch/dwatch index 8d90d8173dfe..c9af8258f4ac 100755 --- a/cddl/usr.sbin/dwatch/dwatch +++ b/cddl/usr.sbin/dwatch/dwatch @@ -27,7 +27,6 @@ ############################################################ IDENT(1) # # $Title: Watch processes as they trigger a particular DTrace probe $ -# $FreeBSD$ # ############################################################ CONFIGURATION @@ -1328,7 +1327,6 @@ PSARGS_ACTION=$( cat <&9 ) * SUCH DAMAGE. * * $TITLE dtrace(1) script to log process(es) triggering $PROBE $ - * \$FreeBSD$ */ $( echo "$DTRACE_PRAGMA" | awk ' diff --git a/cddl/usr.sbin/dwatch/dwatch.1 b/cddl/usr.sbin/dwatch/dwatch.1 index d5595a530c0e..28b604d43c5d 100644 --- a/cddl/usr.sbin/dwatch/dwatch.1 +++ b/cddl/usr.sbin/dwatch/dwatch.1 @@ -22,8 +22,6 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd February 9, 2018 .Dt DWATCH 1 .Os @@ -68,7 +66,7 @@ utility uses .Xr dtrace 1 to display process info when a given DTrace probe point is triggered. Only the root user or users with -.Xr sudo 8 +.Xr sudo 8 Pq Pa ports/security/sudo access can run this command. .Pp .Nm diff --git a/cddl/usr.sbin/dwatch/examples/Makefile b/cddl/usr.sbin/dwatch/examples/Makefile index 344d67d27ec8..185f57d8cfe2 100644 --- a/cddl/usr.sbin/dwatch/examples/Makefile +++ b/cddl/usr.sbin/dwatch/examples/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= dwatch FILESDIR= ${SHAREDIR}/examples/dwatch diff --git a/cddl/usr.sbin/dwatch/examples/profile_template b/cddl/usr.sbin/dwatch/examples/profile_template index 8bb3acfed2fb..c5b357c3f946 100644 --- a/cddl/usr.sbin/dwatch/examples/profile_template +++ b/cddl/usr.sbin/dwatch/examples/profile_template @@ -4,7 +4,6 @@ # # $Title: dwatch(8) profile for XXX entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/Makefile b/cddl/usr.sbin/dwatch/libexec/Makefile index 581556eeebd0..e8df567eb205 100644 --- a/cddl/usr.sbin/dwatch/libexec/Makefile +++ b/cddl/usr.sbin/dwatch/libexec/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= dwatch FILESDIR= ${LIBEXECDIR}/dwatch @@ -22,6 +21,7 @@ FILES= chmod \ vop_rename \ vop_symlink +LINKMODE= ${SHAREMODE} LINKS= ${LIBEXECDIR}/dwatch/chmod ${LIBEXECDIR}/dwatch/fchmodat LINKS+= ${LIBEXECDIR}/dwatch/chmod ${LIBEXECDIR}/dwatch/lchmod LINKS+= ${LIBEXECDIR}/dwatch/io ${LIBEXECDIR}/dwatch/io-done diff --git a/cddl/usr.sbin/dwatch/libexec/chmod b/cddl/usr.sbin/dwatch/libexec/chmod index d131109a0d66..6ec7140613e6 100644 --- a/cddl/usr.sbin/dwatch/libexec/chmod +++ b/cddl/usr.sbin/dwatch/libexec/chmod @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for [l]chmod(2), fchmodat(2), or similar entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/errno b/cddl/usr.sbin/dwatch/libexec/errno index 42fce4ab8faa..d899906a1313 100644 --- a/cddl/usr.sbin/dwatch/libexec/errno +++ b/cddl/usr.sbin/dwatch/libexec/errno @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for syscall errno logging $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/io b/cddl/usr.sbin/dwatch/libexec/io index 26c58593ead3..6aafb624c820 100644 --- a/cddl/usr.sbin/dwatch/libexec/io +++ b/cddl/usr.sbin/dwatch/libexec/io @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for dtrace_io(4) $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/ip b/cddl/usr.sbin/dwatch/libexec/ip index 8de385f568bf..9032e37dc043 100644 --- a/cddl/usr.sbin/dwatch/libexec/ip +++ b/cddl/usr.sbin/dwatch/libexec/ip @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for dtrace_ip(4) $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/kill b/cddl/usr.sbin/dwatch/libexec/kill index c30e951381c3..06960d11f8da 100644 --- a/cddl/usr.sbin/dwatch/libexec/kill +++ b/cddl/usr.sbin/dwatch/libexec/kill @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for kill(2) [or similar] entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/nanosleep b/cddl/usr.sbin/dwatch/libexec/nanosleep index acc4cf352af7..d645d8a2a026 100644 --- a/cddl/usr.sbin/dwatch/libexec/nanosleep +++ b/cddl/usr.sbin/dwatch/libexec/nanosleep @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for nanosleep(2) [or similar] entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/open b/cddl/usr.sbin/dwatch/libexec/open index 5185a97aca03..849f8865c55d 100644 --- a/cddl/usr.sbin/dwatch/libexec/open +++ b/cddl/usr.sbin/dwatch/libexec/open @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for open[at](2) [or similar] entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/proc b/cddl/usr.sbin/dwatch/libexec/proc index 0f67394a84d5..02d4d9d1fb8d 100644 --- a/cddl/usr.sbin/dwatch/libexec/proc +++ b/cddl/usr.sbin/dwatch/libexec/proc @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for dtrace_proc(4) activity $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/rw b/cddl/usr.sbin/dwatch/libexec/rw index 32aa58c34f15..6e726c54d8f7 100644 --- a/cddl/usr.sbin/dwatch/libexec/rw +++ b/cddl/usr.sbin/dwatch/libexec/rw @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for read(2), write(2), or similar entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/sched b/cddl/usr.sbin/dwatch/libexec/sched index acbe47d92989..2058f199f40a 100644 --- a/cddl/usr.sbin/dwatch/libexec/sched +++ b/cddl/usr.sbin/dwatch/libexec/sched @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for dtrace_sched(4) $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/sendrecv b/cddl/usr.sbin/dwatch/libexec/sendrecv index 7227e41b5731..05ac339dfa05 100644 --- a/cddl/usr.sbin/dwatch/libexec/sendrecv +++ b/cddl/usr.sbin/dwatch/libexec/sendrecv @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for send(2)/recv(2) $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/systop b/cddl/usr.sbin/dwatch/libexec/systop index b5a29354eee9..7408e41ffffb 100644 --- a/cddl/usr.sbin/dwatch/libexec/systop +++ b/cddl/usr.sbin/dwatch/libexec/systop @@ -4,7 +4,6 @@ # # $Title: dwatch(8) profile for top-like syscall $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/tcp b/cddl/usr.sbin/dwatch/libexec/tcp index 344cdb4ee6e8..a97cde17ef51 100644 --- a/cddl/usr.sbin/dwatch/libexec/tcp +++ b/cddl/usr.sbin/dwatch/libexec/tcp @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for dtrace_tcp(4) connections $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/udp b/cddl/usr.sbin/dwatch/libexec/udp index 1f896a71805d..048f0c9a4102 100644 --- a/cddl/usr.sbin/dwatch/libexec/udp +++ b/cddl/usr.sbin/dwatch/libexec/udp @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for dtrace_udp(4) $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/udplite b/cddl/usr.sbin/dwatch/libexec/udplite index 093c0857f865..44f55de146fe 100644 --- a/cddl/usr.sbin/dwatch/libexec/udplite +++ b/cddl/usr.sbin/dwatch/libexec/udplite @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for dtrace_udplite(4) $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/vop_create b/cddl/usr.sbin/dwatch/libexec/vop_create index 3c544815b758..d36812a4a0d8 100644 --- a/cddl/usr.sbin/dwatch/libexec/vop_create +++ b/cddl/usr.sbin/dwatch/libexec/vop_create @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for VOP_CREATE(9) [or similar] entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/vop_readdir b/cddl/usr.sbin/dwatch/libexec/vop_readdir index 8114bae6527a..6a07b98973f4 100644 --- a/cddl/usr.sbin/dwatch/libexec/vop_readdir +++ b/cddl/usr.sbin/dwatch/libexec/vop_readdir @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for VOP_READDIR(9) [or similar] entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/vop_rename b/cddl/usr.sbin/dwatch/libexec/vop_rename index a9dbf16e73fa..8eca72505558 100644 --- a/cddl/usr.sbin/dwatch/libexec/vop_rename +++ b/cddl/usr.sbin/dwatch/libexec/vop_rename @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for VOP_RENAME(9) [or similar] entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/dwatch/libexec/vop_symlink b/cddl/usr.sbin/dwatch/libexec/vop_symlink index ca75d350af47..dbf7702b2629 100644 --- a/cddl/usr.sbin/dwatch/libexec/vop_symlink +++ b/cddl/usr.sbin/dwatch/libexec/vop_symlink @@ -4,7 +4,6 @@ # # $Title: dwatch(8) module for VOP_SYMLINK(9) [or similar] entry $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ -# $FreeBSD$ # ############################################################ DESCRIPTION # diff --git a/cddl/usr.sbin/lockstat/Makefile b/cddl/usr.sbin/lockstat/Makefile index a4bec42df367..e0e3f40ccda9 100644 --- a/cddl/usr.sbin/lockstat/Makefile +++ b/cddl/usr.sbin/lockstat/Makefile @@ -1,4 +1,5 @@ -# $FreeBSD$ + +.include <src.opts.mk> .PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/lockstat @@ -26,6 +27,11 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${SRCTOP}/sys CFLAGS+= -DHAVE_ISSETUGID +.if ${MK_DTRACE_ASAN} != "no" +CFLAGS+= -fsanitize=address -fsanitize=undefined +LDFLAGS+= -fsanitize=address -fsanitize=undefined +.endif + CFLAGS+= -DNEED_ERRLOC -g #YFLAGS+= -d diff --git a/cddl/usr.sbin/lockstat/Makefile.depend b/cddl/usr.sbin/lockstat/Makefile.depend index 04b96e83f1c7..2df10f761ad0 100644 --- a/cddl/usr.sbin/lockstat/Makefile.depend +++ b/cddl/usr.sbin/lockstat/Makefile.depend @@ -1,25 +1,16 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - cddl/lib/libctf \ cddl/lib/libdtrace \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libcxxrt \ lib/libelf \ - lib/libkvm \ lib/libproc \ - lib/libprocstat \ lib/librt \ lib/librtld_db \ - lib/libthr \ - lib/libutil \ - lib/libz \ .include <dirdeps.mk> diff --git a/cddl/usr.sbin/plockstat/Makefile b/cddl/usr.sbin/plockstat/Makefile index 22610870c846..e83fae8f305c 100644 --- a/cddl/usr.sbin/plockstat/Makefile +++ b/cddl/usr.sbin/plockstat/Makefile @@ -1,4 +1,5 @@ -# $FreeBSD$ + +.include <src.opts.mk> .PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/plockstat @@ -26,6 +27,11 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${SRCTOP}/sys CFLAGS+= -DHAVE_ISSETUGID +.if ${MK_DTRACE_ASAN} != "no" +CFLAGS+= -fsanitize=address -fsanitize=undefined +LDFLAGS+= -fsanitize=address -fsanitize=undefined +.endif + LIBADD= dtrace proc .include <bsd.prog.mk> diff --git a/cddl/usr.sbin/plockstat/Makefile.depend b/cddl/usr.sbin/plockstat/Makefile.depend index c37ef4acf01e..22b6f0fded18 100644 --- a/cddl/usr.sbin/plockstat/Makefile.depend +++ b/cddl/usr.sbin/plockstat/Makefile.depend @@ -1,24 +1,15 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - cddl/lib/libctf \ cddl/lib/libdtrace \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libcxxrt \ lib/libelf \ - lib/libkvm \ lib/libproc \ - lib/libprocstat \ lib/librtld_db \ - lib/libthr \ - lib/libutil \ - lib/libz \ .include <dirdeps.mk> diff --git a/cddl/usr.sbin/plockstat/plockstat.1 b/cddl/usr.sbin/plockstat/plockstat.1 index d02c962771b4..264d01b89df2 100644 --- a/cddl/usr.sbin/plockstat/plockstat.1 +++ b/cddl/usr.sbin/plockstat/plockstat.1 @@ -26,8 +26,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd September 13, 2010 .Dt PLOCKSTAT 1 .Os diff --git a/cddl/usr.sbin/tests/Makefile b/cddl/usr.sbin/tests/Makefile index 3b3078f8612a..b8996030aafc 100644 --- a/cddl/usr.sbin/tests/Makefile +++ b/cddl/usr.sbin/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/tests KYUAFILE= yes diff --git a/cddl/usr.sbin/tests/Makefile.depend b/cddl/usr.sbin/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/cddl/usr.sbin/tests/Makefile.depend +++ b/cddl/usr.sbin/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile index efd8c746128f..e41f4afce82f 100644 --- a/cddl/usr.sbin/zdb/Makefile +++ b/cddl/usr.sbin/zdb/Makefile @@ -1,10 +1,10 @@ -# $FreeBSD$ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/cmd/zdb .PATH: ${ZFSTOP}/man/man8 +PACKAGE= zfs PROG= zdb MAN= zdb.8 INCS= zdb.h @@ -23,7 +23,7 @@ CFLAGS+= \ -include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \ -DHAVE_ISSETUGID -LIBADD= nvpair umem uutil zfs spl avl zutil zpool +LIBADD= nvpair umem uutil zdb zfs spl avl zutil zpool crypto CFLAGS.gcc+= -fms-extensions # Since there are many asserts in this program, it makes no sense to compile diff --git a/cddl/usr.sbin/zdb/Makefile.depend b/cddl/usr.sbin/zdb/Makefile.depend index dfb2563fa7d1..d9ae0ff3c82e 100644 --- a/cddl/usr.sbin/zdb/Makefile.depend +++ b/cddl/usr.sbin/zdb/Makefile.depend @@ -1,28 +1,20 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libavl \ cddl/lib/libnvpair \ + cddl/lib/libspl \ cddl/lib/libumem \ cddl/lib/libuutil \ cddl/lib/libzfs \ - cddl/lib/libzfs_core \ cddl/lib/libzpool \ - gnu/lib/csu \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libexpat \ - lib/libgeom \ - lib/libmd \ - lib/libsbuf \ - lib/libthr \ - lib/libutil \ - lib/libz \ - lib/msun \ + secure/lib/libcrypto \ .include <dirdeps.mk> diff --git a/cddl/usr.sbin/zfsd/Makefile b/cddl/usr.sbin/zfsd/Makefile index 88eb9220a8cc..93426c0320af 100644 --- a/cddl/usr.sbin/zfsd/Makefile +++ b/cddl/usr.sbin/zfsd/Makefile @@ -1,9 +1,9 @@ -# $FreeBSD$ .include <src.opts.mk> .include "Makefile.common" +PACKAGE= zfs PROG_CXX= zfsd MAN= zfsd.8 diff --git a/cddl/usr.sbin/zfsd/Makefile.common b/cddl/usr.sbin/zfsd/Makefile.common index 68d921c90e37..c1ed4bba9289 100644 --- a/cddl/usr.sbin/zfsd/Makefile.common +++ b/cddl/usr.sbin/zfsd/Makefile.common @@ -1,4 +1,3 @@ -# $FreeBSD$ SRCS= callout.cc \ case_file.cc \ @@ -23,8 +22,8 @@ CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -I${SRCTOP}/cddl/usr.sbin -# use issetugid(2) CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -DHAVE_EXECVPE LIBADD+= devdctl zfs util geom bsdxml sbuf nvpair avl uutil zutil diff --git a/cddl/usr.sbin/zfsd/Makefile.depend b/cddl/usr.sbin/zfsd/Makefile.depend index 023a4456ec68..4b9049efecdc 100644 --- a/cddl/usr.sbin/zfsd/Makefile.depend +++ b/cddl/usr.sbin/zfsd/Makefile.depend @@ -1,14 +1,11 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ cddl/lib/libavl \ cddl/lib/libnvpair \ - cddl/lib/libumem \ cddl/lib/libuutil \ cddl/lib/libzfs \ - cddl/lib/libzfs_core \ - gnu/lib/csu \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ @@ -19,11 +16,8 @@ DIRDEPS = \ lib/libdevdctl \ lib/libexpat \ lib/libgeom \ - lib/libmd \ lib/libsbuf \ - lib/libthr \ lib/libutil \ - lib/libz \ lib/msun \ diff --git a/cddl/usr.sbin/zfsd/callout.cc b/cddl/usr.sbin/zfsd/callout.cc index 3e5cd5779559..c141e6550f41 100644 --- a/cddl/usr.sbin/zfsd/callout.cc +++ b/cddl/usr.sbin/zfsd/callout.cc @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/callout.h b/cddl/usr.sbin/zfsd/callout.h index d6b83bcfe5f5..69a4cf123162 100644 --- a/cddl/usr.sbin/zfsd/callout.h +++ b/cddl/usr.sbin/zfsd/callout.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc index 8da711fc10cb..f9fd84da7277 100644 --- a/cddl/usr.sbin/zfsd/case_file.cc +++ b/cddl/usr.sbin/zfsd/case_file.cc @@ -53,6 +53,7 @@ #include <syslog.h> #include <unistd.h> +#include <libzutil.h> #include <libzfs.h> #include <list> @@ -73,9 +74,6 @@ #include "zfsd.h" #include "zfsd_exception.h" #include "zpool_list.h" - -__FBSDID("$FreeBSD$"); - /*============================ Namespace Control =============================*/ using std::hex; using std::ifstream; @@ -94,7 +92,6 @@ using DevdCtl::ParseException; CaseFileList CaseFile::s_activeCases; const string CaseFile::s_caseFilePath = "/var/db/zfsd/cases"; -const timeval CaseFile::s_removeGracePeriod = { 60 /*sec*/, 0 /*usec*/}; //- CaseFile Static Public Methods --------------------------------------------- CaseFile * @@ -116,6 +113,26 @@ CaseFile::Find(Guid poolGUID, Guid vdevGUID) return (NULL); } +void +CaseFile::Find(Guid poolGUID, Guid vdevGUID, CaseFileList &cases) +{ + for (CaseFileList::iterator curCase = s_activeCases.begin(); + curCase != s_activeCases.end(); curCase++) { + if (((*curCase)->PoolGUID() != poolGUID && + Guid::InvalidGuid() != poolGUID) || + (*curCase)->VdevGUID() != vdevGUID) + continue; + + /* + * We can have multiple cases for spare vdevs + */ + cases.push_back(*curCase); + if (!(*curCase)->IsSpare()) { + return; + } + } +} + CaseFile * CaseFile::Find(const string &physPath) { @@ -217,6 +234,12 @@ CaseFile::PurgeAll() } +int +CaseFile::IsSpare() +{ + return (m_is_spare); +} + //- CaseFile Public Methods ---------------------------------------------------- bool CaseFile::RefreshVdevState() @@ -232,6 +255,7 @@ CaseFile::RefreshVdevState() m_vdevState = vd.State(); m_vdevPhysPath = vd.PhysicalPath(); + m_vdevName = vd.Name(casePool, false); return (true); } @@ -240,6 +264,7 @@ CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev) { ZpoolList zpl(ZpoolList::ZpoolByGUID, &m_poolGUID); zpool_handle_t *pool(zpl.empty() ? NULL : zpl.front()); + int flags = ZFS_ONLINE_CHECKREMOVE | ZFS_ONLINE_UNSPARE; if (pool == NULL || !RefreshVdevState()) { /* @@ -280,9 +305,10 @@ CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev) || vdev->PoolGUID() == Guid::InvalidGuid()) && vdev->GUID() == m_vdevGUID) { + if (IsSpare()) + flags |= ZFS_ONLINE_SPARE; if (zpool_vdev_online(pool, vdev->GUIDString().c_str(), - ZFS_ONLINE_CHECKREMOVE | ZFS_ONLINE_UNSPARE, - &m_vdevState) != 0) { + flags, &m_vdevState) != 0) { syslog(LOG_ERR, "Failed to online vdev(%s/%s:%s): %s: %s\n", zpool_get_name(pool), vdev->GUIDString().c_str(), @@ -360,7 +386,7 @@ CaseFile::ReEvaluate(const ZfsEvent &event) { bool consumed(false); - if (event.Value("type") == "misc.fs.zfs.vdev_remove") { + if (event.Value("type") == "sysevent.fs.zfs.vdev_remove") { /* * The Vdev we represent has been removed from the * configuration. This case is no longer of value. @@ -368,12 +394,12 @@ CaseFile::ReEvaluate(const ZfsEvent &event) Close(); return (/*consumed*/true); - } else if (event.Value("type") == "misc.fs.zfs.pool_destroy") { + } else if (event.Value("type") == "sysevent.fs.zfs.pool_destroy") { /* This Pool has been destroyed. Discard the case */ Close(); return (/*consumed*/true); - } else if (event.Value("type") == "misc.fs.zfs.config_sync") { + } else if (event.Value("type") == "sysevent.fs.zfs.config_sync") { RefreshVdevState(); if (VdevState() < VDEV_STATE_HEALTHY) consumed = ActivateSpare(); @@ -445,7 +471,8 @@ CaseFile::ReEvaluate(const ZfsEvent &event) consumed = true; } else if (event.Value("class") == "ereport.fs.zfs.io" || - event.Value("class") == "ereport.fs.zfs.checksum") { + event.Value("class") == "ereport.fs.zfs.checksum" || + event.Value("class") == "ereport.fs.zfs.delay") { m_tentativeEvents.push_front(event.DeepCopy()); RegisterCallout(event); @@ -490,8 +517,7 @@ bool CaseFile::ActivateSpare() { nvlist_t *config, *nvroot, *parent_config; nvlist_t **spares; - char *devPath, *vdev_type; - const char *poolname; + const char *devPath, *poolname, *vdev_type; u_int nspares, i; int error; @@ -518,7 +544,7 @@ CaseFile::ActivateSpare() { parent_config = find_parent(config, nvroot, m_vdevGUID); if (parent_config != NULL) { - char *parent_type; + const char *parent_type; /* * Don't activate spares for members of a "replacing" vdev. @@ -585,15 +611,55 @@ CaseFile::ActivateSpare() { return (Replace(vdev_type, devPath, /*isspare*/true)); } +/* Does the argument event refer to a checksum error? */ +static bool +IsChecksumEvent(const Event* const event) +{ + return ("ereport.fs.zfs.checksum" == event->Value("type")); +} + +/* Does the argument event refer to an IO error? */ +static bool +IsIOEvent(const Event* const event) +{ + return ("ereport.fs.zfs.io" == event->Value("type")); +} + +/* Does the argument event refer to an IO delay? */ +static bool +IsDelayEvent(const Event* const event) +{ + return ("ereport.fs.zfs.delay" == event->Value("type")); +} + void CaseFile::RegisterCallout(const Event &event) { timeval now, countdown, elapsed, timestamp, zero, remaining; + /** + * The time ZFSD waits before promoting a tentative event + * into a permanent event. + */ + int sec = -1; + if (IsChecksumEvent(&event)) + sec = CaseFile::GetVdevProp(VDEV_PROP_CHECKSUM_T); + else if (IsIOEvent(&event)) + sec = CaseFile::GetVdevProp(VDEV_PROP_IO_T); + else if (IsDelayEvent(&event)) + sec = CaseFile::GetVdevProp(VDEV_PROP_SLOW_IO_T); + + if (sec == -1) + sec = 60; /* default */ + + timeval removeGracePeriod = { + sec, /*sec*/ + 0 /*usec*/ + }; gettimeofday(&now, 0); timestamp = event.GetTimestamp(); timersub(&now, ×tamp, &elapsed); - timersub(&s_removeGracePeriod, &elapsed, &countdown); + timersub(&removeGracePeriod, &elapsed, &countdown); /* * If countdown is <= zero, Reset the timer to the * smallest positive time value instead @@ -791,7 +857,8 @@ CaseFile::CaseFile(const Vdev &vdev) : m_poolGUID(vdev.PoolGUID()), m_vdevGUID(vdev.GUID()), m_vdevState(vdev.State()), - m_vdevPhysPath(vdev.PhysicalPath()) + m_vdevPhysPath(vdev.PhysicalPath()), + m_is_spare(vdev.IsSpare()) { stringstream guidString; @@ -801,6 +868,10 @@ CaseFile::CaseFile(const Vdev &vdev) guidString << m_poolGUID; m_poolGUIDString = guidString.str(); + ZpoolList zpl(ZpoolList::ZpoolByGUID, &m_poolGUID); + zpool_handle_t *zhp(zpl.empty() ? NULL : zpl.front()); + m_vdevName = vdev.Name(zhp, false); + s_activeCases.push_back(this); syslog(LOG_INFO, "Creating new CaseFile:\n"); @@ -1132,32 +1203,56 @@ CaseFile::Replace(const char* vdev_type, const char* path, bool isspare) { return (retval); } -/* Does the argument event refer to a checksum error? */ -static bool -IsChecksumEvent(const Event* const event) +/* Lookup the vdev prop. Used for checksum, IO, or slow IO props */ +int +CaseFile::GetVdevProp(vdev_prop_t vdev_prop) const { - return ("ereport.fs.zfs.checksum" == event->Value("type")); -} + char val[ZFS_MAXPROPLEN]; + zprop_source_t srctype; + DevdCtl::Guid poolGUID = PoolGUID(); + ZpoolList zpl(ZpoolList::ZpoolByGUID, &poolGUID); + zpool_handle_t *zhp(zpl.empty() ? NULL : zpl.front()); -/* Does the argument event refer to an IO error? */ -static bool -IsIOEvent(const Event* const event) -{ - return ("ereport.fs.zfs.io" == event->Value("type")); + char *prop_str = (char *) vdev_prop_to_name(vdev_prop); + if (zhp == NULL || zpool_get_vdev_prop(zhp, m_vdevName.c_str(), + vdev_prop, prop_str, val, sizeof (val), &srctype, B_FALSE) != 0) + return (-1); + + /* we'll get "-" from libzfs for a prop that is not set */ + if (zfs_isnumber(val) == B_FALSE) + return (-1); + + return (atoi(val)); } bool CaseFile::ShouldDegrade() const { + int checksum_n = GetVdevProp(VDEV_PROP_CHECKSUM_N); + if (checksum_n == -1) + checksum_n = DEFAULT_ZFS_DEGRADE_IO_COUNT; return (std::count_if(m_events.begin(), m_events.end(), - IsChecksumEvent) > ZFS_DEGRADE_IO_COUNT); + IsChecksumEvent) > checksum_n); } bool CaseFile::ShouldFault() const { - return (std::count_if(m_events.begin(), m_events.end(), - IsIOEvent) > ZFS_DEGRADE_IO_COUNT); + bool should_fault_for_io, should_fault_for_delay; + int io_n = GetVdevProp(VDEV_PROP_IO_N); + int slow_io_n = GetVdevProp(VDEV_PROP_SLOW_IO_N); + + if (io_n == -1) + io_n = DEFAULT_ZFS_DEGRADE_IO_COUNT; + if (slow_io_n == -1) + slow_io_n = DEFAULT_ZFS_FAULT_SLOW_IO_COUNT; + + should_fault_for_io = std::count_if(m_events.begin(), m_events.end(), + IsIOEvent) > io_n; + should_fault_for_delay = std::count_if(m_events.begin(), m_events.end(), + IsDelayEvent) > slow_io_n; + + return (should_fault_for_io || should_fault_for_delay); } nvlist_t * diff --git a/cddl/usr.sbin/zfsd/case_file.h b/cddl/usr.sbin/zfsd/case_file.h index b4dc2dee5d96..199918c4fead 100644 --- a/cddl/usr.sbin/zfsd/case_file.h +++ b/cddl/usr.sbin/zfsd/case_file.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** @@ -99,6 +97,19 @@ public: static CaseFile *Find(DevdCtl::Guid poolGUID, DevdCtl::Guid vdevGUID); /** + * \brief Find multiple CaseFile objects by a vdev's pool/vdev + * GUID tuple (special case for spare vdevs) + * + * \param poolGUID Pool GUID for the vdev of the CaseFile to find. + * If InvalidGuid, then only match the vdev GUID + * instead of both pool and vdev GUIDs. + * \param vdevGUID Vdev GUID for the vdev of the CaseFile to find. + * \param caseList List of cases associated with the vdev. + */ + static void Find(DevdCtl::Guid poolGUID, DevdCtl::Guid vdevGUID, + CaseFileList &caseList); + + /** * \brief Find a CaseFile object by a vdev's current/last known * physical path. * @@ -219,14 +230,32 @@ public: */ bool ShouldFault() const; + /** + * \brief If this vdev is spare + */ + int IsSpare(); + + /** + * \brief Get case vdev's specified property + */ + int GetVdevProp(vdev_prop_t) const; + protected: enum { + /* + * Use these defaults if we can't get the corresponding vdev + * prop or if the prop is not set + */ /** * The number of soft errors on a vdev required * to transition a vdev from healthy to degraded - * status. + * status */ - ZFS_DEGRADE_IO_COUNT = 50 + DEFAULT_ZFS_DEGRADE_IO_COUNT = 50, + /** + * The number of delay errors on a vdev required to fault it + */ + DEFAULT_ZFS_FAULT_SLOW_IO_COUNT = 8, }; static CalloutFunc_t OnGracePeriodEnded; @@ -360,12 +389,6 @@ protected: static const string s_caseFilePath; /** - * \brief The time ZFSD waits before promoting a tentative event - * into a permanent event. - */ - static const timeval s_removeGracePeriod; - - /** * \brief A list of soft error events counted against the health of * a vdev. */ @@ -384,6 +407,8 @@ protected: string m_poolGUIDString; string m_vdevGUIDString; string m_vdevPhysPath; + string m_vdevName; + int m_is_spare; /** * \brief Callout activated when a grace period diff --git a/cddl/usr.sbin/zfsd/tests/Makefile b/cddl/usr.sbin/zfsd/tests/Makefile index 1b776b217776..a4613e4cb1e8 100644 --- a/cddl/usr.sbin/zfsd/tests/Makefile +++ b/cddl/usr.sbin/zfsd/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include "${.CURDIR}/../Makefile.common" .PATH: ${.CURDIR:H} diff --git a/cddl/usr.sbin/zfsd/tests/libmocks.c b/cddl/usr.sbin/zfsd/tests/libmocks.c index e3c90a46920f..64eb02b1d480 100644 --- a/cddl/usr.sbin/zfsd/tests/libmocks.c +++ b/cddl/usr.sbin/zfsd/tests/libmocks.c @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Alan Somers (Spectra Logic Corporation) - * - * $FreeBSD$ */ #include <stdio.h> diff --git a/cddl/usr.sbin/zfsd/tests/libmocks.h b/cddl/usr.sbin/zfsd/tests/libmocks.h index 130f4389f70a..ffa2f0673e1d 100644 --- a/cddl/usr.sbin/zfsd/tests/libmocks.h +++ b/cddl/usr.sbin/zfsd/tests/libmocks.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Alan Somers (Spectra Logic Corporation) - * - * $FreeBSD$ */ #ifndef _LIBMOCKS_H_ diff --git a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc index e2833170f9ac..d76abb54c9ed 100644 --- a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc +++ b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc @@ -62,9 +62,6 @@ #include <zfsd/zpool_list.h> #include "libmocks.h" - -__FBSDID("$FreeBSD$"); - /*================================== Macros ==================================*/ #define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*x)) @@ -400,7 +397,7 @@ TEST_F(ZfsEventTest, ProcessPoolEventGetsCalled) { string evString("!system=ZFS " "subsystem=ZFS " - "type=misc.fs.zfs.vdev_remove " + "type=sysevent.fs.zfs.vdev_remove " "pool_name=foo " "pool_guid=9756779504028057996 " "vdev_guid=1631193447431603339 " @@ -515,7 +512,7 @@ TEST_F(CaseFileTest, PoolDestroy) "pool_guid=456 " "subsystem=ZFS " "timestamp=1348867914 " - "type=misc.fs.zfs.pool_destroy "); + "type=sysevent.fs.zfs.pool_destroy "); m_event = Event::CreateEvent(*m_eventFactory, evString); ZfsEvent *zfs_event = static_cast<ZfsEvent*>(m_event); EXPECT_CALL(*m_caseFile, Close()); @@ -523,6 +520,72 @@ TEST_F(CaseFileTest, PoolDestroy) } /* + * A Vdev with a very large number of Delay errors should fault + * For performance reasons, RefreshVdevState should be called at most once + */ +TEST_F(CaseFileTest, VeryManyDelayErrors) +{ + EXPECT_CALL(*m_caseFile, RefreshVdevState()) + .Times(::testing::AtMost(1)) + .WillRepeatedly(::testing::Return(true)); + + for(int i=0; i<100; i++) { + stringstream evStringStream; + evStringStream << + "!system=ZFS " + "class=ereport.fs.zfs.delay " + "ena=12091638756982918145 " + "parent_guid=13237004955564865395 " + "parent_type=raidz " + "pool=testpool.4415 " + "pool_context=0 " + "pool_failmode=wait " + "pool_guid=456 " + "pool_state= 0" + "subsystem=ZFS " + "time="; + evStringStream << i << "0000000000000000 "; + evStringStream << "timestamp=" << i << " "; + evStringStream << + "type=ereport.fs.zfs.delay " + "vdev_ashift=12 " + "vdev_cksum_errors=0 " + "vdev_complete_ts=948336226469 " + "vdev_delays=77 " + "vdev_delta_ts=123998485899 " + "vdev_guid=123 " + "vdev_path=/dev/da400 " + "vdev_read_errors=0 " + "vdev_spare_guids= " + "vdev_type=disk " + "vdev_write_errors=0 " + "zio_blkid=622 " + "zio_delay=31000041101 " + "zio_delta=123998485899 " + "zio_err=0 " + "zio_flags=1572992 " + "zio_level=-2 " + "zio_object=0 " + "zio_objset=37 " + "zio_offset=25598976 " + "zio_pipeline=48234496 " + "zio_priority=3 " + "zio_size=1024" + "zio_stage=33554432 " + "zio_timestamp=824337740570 "; + Event *event(Event::CreateEvent(*m_eventFactory, + evStringStream.str())); + ZfsEvent *zfs_event = static_cast<ZfsEvent*>(event); + EXPECT_TRUE(m_caseFile->ReEvaluate(*zfs_event)); + delete event; + } + + m_caseFile->SpliceEvents(); + EXPECT_FALSE(m_caseFile->ShouldDegrade()); + EXPECT_TRUE(m_caseFile->ShouldFault()); +} + +/* * A Vdev with a very large number of IO errors should fault * For performance reasons, RefreshVdevState should be called at most once */ @@ -685,7 +748,7 @@ string ReEvaluateByGuidTest::s_evString( "pool_name=foo " "subsystem=ZFS " "timestamp=1360620391 " - "type=misc.fs.zfs.config_sync"); + "type=sysevent.fs.zfs.config_sync"); /* @@ -769,3 +832,40 @@ TEST_F(ReEvaluateByGuidTest, ReEvaluateByGuid_five) delete CaseFile4; delete CaseFile5; } + +/* + * Test VdevIterator + */ +class VdevIteratorTest : public ::testing::Test +{ +}; + +bool VdevIteratorTestCB(Vdev &vdev, void *cbArg) { + return (false); +} + +/* + * VdevIterator::Next should not crash when run on a pool that has a previously + * removed vdev. Regression for + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273663 + */ +TEST_F(VdevIteratorTest, VdevRemoval) +{ + nvlist_t* poolConfig, *rootVdev; + + ASSERT_EQ(0, nvlist_alloc(&rootVdev, NV_UNIQUE_NAME, 0)); + ASSERT_EQ(0, nvlist_add_uint64(rootVdev, ZPOOL_CONFIG_GUID, 0x5678)); + /* + * Note: pools with previously-removed top-level VDEVs will contain a + * TLV in their labels that has 0 children. + */ + ASSERT_EQ(0, nvlist_add_nvlist_array(rootVdev, ZPOOL_CONFIG_CHILDREN, + NULL, 0)); + ASSERT_EQ(0, nvlist_alloc(&poolConfig, NV_UNIQUE_NAME, 0)); + ASSERT_EQ(0, nvlist_add_uint64(poolConfig, + ZPOOL_CONFIG_POOL_GUID, 0x1234)); + ASSERT_EQ(0, nvlist_add_nvlist(poolConfig, ZPOOL_CONFIG_VDEV_TREE, + rootVdev)); + + VdevIterator(poolConfig).Each(VdevIteratorTestCB, NULL); +} diff --git a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.supp b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.supp index 138ef6907e62..377ca1e10746 100644 --- a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.supp +++ b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.supp @@ -29,7 +29,6 @@ # # Authors: Alan Somers (Spectra Logic Corporation) # -# $FreeBSD$ # This is a valgrind suppression file used for running zfsd_unittest with diff --git a/cddl/usr.sbin/zfsd/vdev.cc b/cddl/usr.sbin/zfsd/vdev.cc index 508af8cda925..1a37340fb76e 100644 --- a/cddl/usr.sbin/zfsd/vdev.cc +++ b/cddl/usr.sbin/zfsd/vdev.cc @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** @@ -65,8 +63,6 @@ #include "zfsd.h" #include "zfsd_exception.h" #include "zpool_list.h" - -__FBSDID("$FreeBSD$"); /*============================ Namespace Control =============================*/ using std::string; using std::stringstream; @@ -336,7 +332,7 @@ Vdev::Name(zpool_handle_t *zhp, bool verbose) const string Vdev::Path() const { - char *path(NULL); + const char *path(NULL); if ((m_config != NULL) && (nvlist_lookup_string(m_config, ZPOOL_CONFIG_PATH, &path) == 0)) @@ -348,7 +344,7 @@ Vdev::Path() const string Vdev::PhysicalPath() const { - char *path(NULL); + const char *path(NULL); if ((m_config != NULL) && (nvlist_lookup_string(m_config, ZPOOL_CONFIG_PHYS_PATH, &path) == 0)) diff --git a/cddl/usr.sbin/zfsd/vdev.h b/cddl/usr.sbin/zfsd/vdev.h index 322efc8f4e53..ace5d5a009fa 100644 --- a/cddl/usr.sbin/zfsd/vdev.h +++ b/cddl/usr.sbin/zfsd/vdev.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/vdev_iterator.cc b/cddl/usr.sbin/zfsd/vdev_iterator.cc index b5a4f22c1c60..e9283108ed3c 100644 --- a/cddl/usr.sbin/zfsd/vdev_iterator.cc +++ b/cddl/usr.sbin/zfsd/vdev_iterator.cc @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** @@ -78,8 +76,10 @@ VdevIterator::Reset() { nvlist_t *rootVdev; nvlist **cache_child; + nvlist **spare_child; int result; uint_t cache_children; + uint_t spare_children; result = nvlist_lookup_nvlist(m_poolConfig, ZPOOL_CONFIG_VDEV_TREE, @@ -95,6 +95,13 @@ VdevIterator::Reset() if (result == 0) for (uint_t c = 0; c < cache_children; c++) m_vdevQueue.push_back(cache_child[c]); + result = nvlist_lookup_nvlist_array(rootVdev, + ZPOOL_CONFIG_SPARES, + &spare_child, + &spare_children); + if (result == 0) + for (uint_t c = 0; c < spare_children; c++) + m_vdevQueue.push_back(spare_child[c]); } nvlist_t * @@ -102,10 +109,7 @@ VdevIterator::Next() { nvlist_t *vdevConfig; - if (m_vdevQueue.empty()) - return (NULL); - - for (;;) { + for (vdevConfig = NULL; !m_vdevQueue.empty();) { nvlist_t **vdevChildren; int result; u_int numChildren; diff --git a/cddl/usr.sbin/zfsd/vdev_iterator.h b/cddl/usr.sbin/zfsd/vdev_iterator.h index 435582ec1f84..439f987ba6e1 100644 --- a/cddl/usr.sbin/zfsd/vdev_iterator.h +++ b/cddl/usr.sbin/zfsd/vdev_iterator.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/zfsd.8 b/cddl/usr.sbin/zfsd/zfsd.8 index ce7550b891a3..d6b0e1d4bd22 100644 --- a/cddl/usr.sbin/zfsd/zfsd.8 +++ b/cddl/usr.sbin/zfsd/zfsd.8 @@ -23,9 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" -.Dd April 18, 2020 +.Dd February 20, 2024 .Dt ZFSD 8 .Os .Sh NAME @@ -57,7 +55,7 @@ directly. Instead, they control its behavior indirectly through zpool configuration. There are two ways to influence .Nm : -assigning hotspares and setting pool properties. +assigning hot spares and setting pool properties. Currently, only the .Em autoreplace property has any effect. @@ -71,7 +69,7 @@ will attempt to resolve the following types of fault: .It device removal When a leaf vdev disappears, .Nm -will activate any available hotspare. +will activate any available hot spare. .It device arrival When a new GEOM device appears, .Nm @@ -79,40 +77,71 @@ will attempt to read its ZFS label, if any. If it matches a previously removed vdev on an active pool, .Nm will online it. -Once resilvering completes, any active hotspare will detach automatically. +Once resilvering completes, any active hot spare will detach automatically. .Pp If the new device has no ZFS label but its physical path matches the physical path of a previously removed vdev on an active pool, and that pool has the autoreplace property set, then .Nm will replace the missing vdev with the newly arrived device. -Once resilvering completes, any active hotspare will detach automatically. +Once resilvering completes, any active hot spare will detach automatically. .It vdev degrade or fault events If a vdev becomes degraded or faulted, .Nm -will activate any available hotspare. +will activate any available hot spare. .It I/O errors -If a leaf vdev generates more than 50 I/O errors in a 60 second period, then +By default, if a leaf vdev generates more than 50 I/O errors in a 60 second +period, then .Nm will mark that vdev as .Em FAULTED . ZFS will no longer issue any I/Os to it. .Nm -will activate a hotspare if one is available. +will activate a hot spare if one is available. The defaults can be changed by +setting the +.Em io_n +and/or +.Em io_t +vdev properties. See +.Xr vdevprops 7 +for details. +.It I/O delays +By default, if a leaf vdev generates more than delayed 8 I/O events in a 60 +second period, then +.Nm +will mark that vdev as +.Em FAULTED . +ZFS will no longer issue any I/Os to it. +.Nm +will activate a hot spare if one is available. The defaults can be changed by +setting the +.Em slow_io_n +and/or +.Em slow_io_t +vdev properties. See +.Xr vdevprops 7 +for details. .It Checksum errors -If a leaf vdev generates more than 50 checksum errors in a 60 second -period, then +By default, if a leaf vdev generates more than 50 checksum errors in a 60 +second period, then .Nm will mark that vdev as .Em DEGRADED . -ZFS will still use it, but zfsd will activate a spare anyway. +ZFS will still use it, but zfsd will also activate a hot spare if one is +available. The defaults can be changed by setting the +.Em checksum_n +and/or +.Em checksum_t +vdev properties. See +.Xr vdevprops 7 +for details. .It Spare addition -If the system administrator adds a hotspare to a pool that is already degraded, +If the system administrator adds a hot spare to a pool that is already degraded, .Nm will activate the spare. .It Resilver complete .Nm -will detach any hotspare once a permanent replacement finishes resilvering. +will detach any hot spare once a permanent replacement finishes resilvering. .It Physical path change If the physical path of an existing disk changes, .Nm @@ -136,6 +165,7 @@ then reads them back in when next it starts up. .El .Sh SEE ALSO .Xr devctl 4 , +.Xr vdevprops 7 , .Xr zpool 8 .Sh HISTORY .Nm diff --git a/cddl/usr.sbin/zfsd/zfsd.cc b/cddl/usr.sbin/zfsd/zfsd.cc index 876cca836e9e..210cc4b85a44 100644 --- a/cddl/usr.sbin/zfsd/zfsd.cc +++ b/cddl/usr.sbin/zfsd/zfsd.cc @@ -74,9 +74,6 @@ #include "zfsd.h" #include "zfsd_exception.h" #include "zpool_list.h" - -__FBSDID("$FreeBSD$"); - /*================================== Macros ==================================*/ #define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*x)) @@ -248,7 +245,7 @@ ZfsDaemon::BuildCaseFiles() snprintf(evString, 160, "!system=ZFS subsystem=ZFS " - "type=misc.fs.zfs.config_sync sub_type=synthesized " + "type=sysevent.fs.zfs.config_sync sub_type=synthesized " "pool_name=%s pool_guid=%" PRIu64 "\n", poolname, poolGUID); event = Event::CreateEvent(GetFactory(), string(evString)); if (event != NULL) { @@ -276,7 +273,7 @@ ZfsDaemon::RescanSystem() result = geom_gettree(&mesh); if (result != 0) { syslog(LOG_ERR, "ZfsDaemon::RescanSystem: " - "geom_gettree faild with error %d\n", result); + "geom_gettree failed with error %d\n", result); return; } diff --git a/cddl/usr.sbin/zfsd/zfsd.h b/cddl/usr.sbin/zfsd/zfsd.h index 7b4019c7ae10..8c7c63a7c9c4 100644 --- a/cddl/usr.sbin/zfsd/zfsd.h +++ b/cddl/usr.sbin/zfsd/zfsd.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/zfsd_event.cc b/cddl/usr.sbin/zfsd/zfsd_event.cc index 688e7c0354a2..7a19b95abeed 100644 --- a/cddl/usr.sbin/zfsd/zfsd_event.cc +++ b/cddl/usr.sbin/zfsd/zfsd_event.cc @@ -68,8 +68,6 @@ #include "zfsd.h" #include "zfsd_exception.h" #include "zpool_list.h" - -__FBSDID("$FreeBSD$"); /*============================ Namespace Control =============================*/ using DevdCtl::Event; using DevdCtl::Guid; @@ -229,7 +227,9 @@ bool GeomEvent::OnlineByLabel(const string &devPath, const string& physPath, nvlist_t *devConfig) { + bool ret = false; try { + CaseFileList case_list; /* * A device with ZFS label information has been * inserted. If it matches a device for which we @@ -238,10 +238,12 @@ GeomEvent::OnlineByLabel(const string &devPath, const string& physPath, syslog(LOG_INFO, "Interrogating VDEV label for %s\n", devPath.c_str()); Vdev vdev(devConfig); - CaseFile *caseFile(CaseFile::Find(vdev.PoolGUID(), - vdev.GUID())); - if (caseFile != NULL) - return (caseFile->ReEvaluate(devPath, physPath, &vdev)); + CaseFile::Find(vdev.PoolGUID(),vdev.GUID(), case_list); + for (CaseFileList::iterator curr = case_list.begin(); + curr != case_list.end(); curr++) { + ret |= (*curr)->ReEvaluate(devPath, physPath, &vdev); + } + return (ret); } catch (ZfsdException &exp) { string context("GeomEvent::OnlineByLabel: " + devPath + ": "); @@ -249,7 +251,7 @@ GeomEvent::OnlineByLabel(const string &devPath, const string& physPath, exp.GetString().insert(0, context); exp.Log(); } - return (false); + return (ret); } @@ -281,7 +283,7 @@ ZfsEvent::Process() const } /* On config syncs, replay any queued events first. */ - if (Value("type").find("misc.fs.zfs.config_sync") == 0) { + if (Value("type").find("sysevent.fs.zfs.config_sync") == 0) { /* * Even if saved events are unconsumed the second time * around, drop them. Any events that still can't be @@ -292,7 +294,7 @@ ZfsEvent::Process() const CaseFile::ReEvaluateByGuid(PoolGUID(), *this); } - if (Value("type").find("misc.fs.zfs.") == 0) { + if (Value("type").find("sysevent.fs.zfs.") == 0) { /* Configuration changes, resilver events, etc. */ ProcessPoolEvent(); return (false); @@ -405,7 +407,7 @@ ZfsEvent::ProcessPoolEvent() const bool degradedDevice(false); /* The pool is destroyed. Discard any open cases */ - if (Value("type") == "misc.fs.zfs.pool_destroy") { + if (Value("type") == "sysevent.fs.zfs.pool_destroy") { Log(LOG_INFO); CaseFile::ReEvaluateByGuid(PoolGUID(), *this); return; @@ -420,7 +422,7 @@ ZfsEvent::ProcessPoolEvent() const Log(LOG_INFO); caseFile->ReEvaluate(*this); } - else if (Value("type") == "misc.fs.zfs.resilver_finish") + else if (Value("type") == "sysevent.fs.zfs.resilver_finish") { /* * It's possible to get a resilver_finish event with no @@ -431,7 +433,7 @@ ZfsEvent::ProcessPoolEvent() const CleanupSpares(); } - if (Value("type") == "misc.fs.zfs.vdev_remove" + if (Value("type") == "sysevent.fs.zfs.vdev_remove" && degradedDevice == false) { /* See if any other cases can make use of this device. */ diff --git a/cddl/usr.sbin/zfsd/zfsd_event.h b/cddl/usr.sbin/zfsd/zfsd_event.h index fd3f9f7c5200..6398cb3c0c13 100644 --- a/cddl/usr.sbin/zfsd/zfsd_event.h +++ b/cddl/usr.sbin/zfsd/zfsd_event.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/zfsd_exception.cc b/cddl/usr.sbin/zfsd/zfsd_exception.cc index 7ebb74ca8c6a..d5b3cab24f02 100644 --- a/cddl/usr.sbin/zfsd/zfsd_exception.cc +++ b/cddl/usr.sbin/zfsd/zfsd_exception.cc @@ -52,8 +52,6 @@ #include "vdev.h" #include "zfsd_exception.h" - -__FBSDID("$FreeBSD$"); /*============================ Namespace Control =============================*/ using std::endl; using std::string; @@ -106,7 +104,7 @@ ZfsdException::Log() const output << "Pool "; - char *poolName; + const char *poolName; if (nvlist_lookup_string(m_poolConfig, ZPOOL_CONFIG_POOL_NAME, &poolName) == 0) output << poolName; diff --git a/cddl/usr.sbin/zfsd/zfsd_exception.h b/cddl/usr.sbin/zfsd/zfsd_exception.h index 5170b2d0dbb1..6cb182e7223b 100644 --- a/cddl/usr.sbin/zfsd/zfsd_exception.h +++ b/cddl/usr.sbin/zfsd/zfsd_exception.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/zfsd_main.cc b/cddl/usr.sbin/zfsd/zfsd_main.cc index f090631e21f2..cc9ce6044384 100644 --- a/cddl/usr.sbin/zfsd/zfsd_main.cc +++ b/cddl/usr.sbin/zfsd/zfsd_main.cc @@ -55,9 +55,6 @@ #include "vdev_iterator.h" #include "zfsd.h" - -__FBSDID("$FreeBSD$"); - /*=============================== Program Main ===============================*/ static void usage() diff --git a/cddl/usr.sbin/zfsd/zpool_list.cc b/cddl/usr.sbin/zfsd/zpool_list.cc index 82c35736df13..65612ca0591c 100644 --- a/cddl/usr.sbin/zfsd/zpool_list.cc +++ b/cddl/usr.sbin/zfsd/zpool_list.cc @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** diff --git a/cddl/usr.sbin/zfsd/zpool_list.h b/cddl/usr.sbin/zfsd/zpool_list.h index 6ee30892aedd..3043d35731eb 100644 --- a/cddl/usr.sbin/zfsd/zpool_list.h +++ b/cddl/usr.sbin/zfsd/zpool_list.h @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGES. * * Authors: Justin T. Gibbs (Spectra Logic Corporation) - * - * $FreeBSD$ */ /** @@ -95,7 +93,7 @@ public: static PoolFilter_t ZpoolByName; /** - * \brief ZpoolList contructor + * \brief ZpoolList constructor * * \param filter The filter function to use when constructing * the ZpoolList. This may be one of the static diff --git a/cddl/usr.sbin/zhack/Makefile b/cddl/usr.sbin/zhack/Makefile index ffac0785d18d..b2fa0e98b7e5 100644 --- a/cddl/usr.sbin/zhack/Makefile +++ b/cddl/usr.sbin/zhack/Makefile @@ -1,7 +1,7 @@ -# $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/cmd +PACKAGE= zfs PROG= zhack MAN= diff --git a/cddl/usr.sbin/zhack/Makefile.depend b/cddl/usr.sbin/zhack/Makefile.depend index dfb2563fa7d1..6e162364b929 100644 --- a/cddl/usr.sbin/zhack/Makefile.depend +++ b/cddl/usr.sbin/zhack/Makefile.depend @@ -1,28 +1,16 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - cddl/lib/libavl \ cddl/lib/libnvpair \ - cddl/lib/libumem \ - cddl/lib/libuutil \ + cddl/lib/libspl \ cddl/lib/libzfs \ - cddl/lib/libzfs_core \ cddl/lib/libzpool \ - gnu/lib/csu \ + cddl/lib/libzutil \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libexpat \ - lib/libgeom \ - lib/libmd \ - lib/libsbuf \ - lib/libthr \ - lib/libutil \ - lib/libz \ - lib/msun \ .include <dirdeps.mk> |