/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <sys/resource.h>
#include <strings.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <alloca.h>
#include <errno.h>
#include <fcntl.h>
#include <dt_impl.h>
#include <dt_string.h>
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
dt_dprintf("set compiler attribute minimum to %s\n",
} else {
}
return (0);
}
static void
dt_coredump(void)
{
abort();
}
/*ARGSUSED*/
static int
{
static int enabled = 0;
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
char *cpp;
return (0);
}
static int
{
char *buf;
return (0);
}
/*ARGSUSED*/
static int
{
int fd;
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
int fd;
return (0);
}
/*ARGSUSED*/
static int
{
_dtrace_debug = 1;
return (0);
}
/*ARGSUSED*/
static int
{
int n;
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
char *ld;
return (0);
}
/*ARGSUSED*/
static int
{
}
return (0);
}
/*ARGSUSED*/
static int
{
else
return (0);
}
/*ARGSUSED*/
static int
{
else
return (0);
}
/*ARGSUSED*/
static int
{
else
return (0);
}
/*ARGSUSED*/
static int
{
else
return (0);
}
/*ARGSUSED*/
static int
{
int n;
return (0);
}
static int
{
char **p;
char *var;
int i;
/*
* We can't effectively set environment variables from #pragma lines
* since the processes have already been spawned.
*/
continue;
i--;
}
}
if (option) {
}
dtp->dt_proc_env = p;
}
return (0);
}
/*ARGSUSED*/
static int
{
else
return (0);
}
/*ARGSUSED*/
static int
{
char *path;
return (0);
}
/*ARGSUSED*/
static int
{
int m;
dtp->dt_treedump = m;
return (0);
}
/*ARGSUSED*/
static int
{
int n;
return (0);
}
/*ARGSUSED*/
static int
{
else
return (0);
}
/*ARGSUSED*/
static int
{
else
return (0);
}
static int
{
return (0);
}
static int
{
else
return (0);
}
/*ARGSUSED*/
static int
{
dt_version_t v;
if (!dt_version_defined(v))
}
static int
{
char *end;
int i;
const struct {
char *positive;
char *negative;
} couples[] = {
{ "yes", "no" },
{ "enable", "disable" },
{ "enabled", "disabled" },
{ "true", "false" },
{ "on", "off" },
{ "set", "unset" },
{ NULL }
};
if (arg[0] == '\0') {
goto out;
}
val = 1;
goto out;
}
goto out;
}
}
errno = 0;
}
out:
return (0);
}
static int
{
char *end;
errno = 0;
case 't':
case 'T':
mul *= 1024;
/*FALLTHRU*/
case 'g':
case 'G':
mul *= 1024;
/*FALLTHRU*/
case 'm':
case 'M':
mul *= 1024;
/*FALLTHRU*/
case 'k':
case 'K':
mul *= 1024;
/*FALLTHRU*/
default:
break;
}
errno = 0;
return (-1);
return (0);
}
static int
{
return (0);
}
static int
{
char *end;
int i;
const struct {
char *name;
} suffix[] = {
{ "hz", 0 },
{ NULL }
};
errno = 0;
break;
}
}
if (mul == 0) {
/*
* The rate has been specified in frequency-per-second.
*/
if (val != 0)
} else {
}
}
return (0);
}
/*
* When setting the strsize option, set the option in the dt_options array
* using dt_opt_size() as usual, and then update the definition of the CTF
* type for the D intrinsic "string" to be an array of the corresponding size.
* If any errors occur, reset dt_options[option] to its previous value.
*/
static int
{
ctf_arinfo_t r;
return (-1); /* dt_errno is set for us */
}
}
}
return (0);
}
static const struct {
const char *dtbp_name;
int dtbp_policy;
} _dtrace_bufpolicies[] = {
{ "ring", DTRACEOPT_BUFPOLICY_RING },
{ "fill", DTRACEOPT_BUFPOLICY_FILL },
{ "switch", DTRACEOPT_BUFPOLICY_SWITCH },
{ NULL, 0 }
};
/*ARGSUSED*/
static int
{
int i;
break;
}
}
if (policy == DTRACEOPT_UNSET)
return (0);
}
static const struct {
const char *dtbr_name;
int dtbr_policy;
} _dtrace_bufresize[] = {
{ "auto", DTRACEOPT_BUFRESIZE_AUTO },
{ "manual", DTRACEOPT_BUFRESIZE_MANUAL },
{ NULL, 0 }
};
/*ARGSUSED*/
static int
{
int i;
break;
}
}
if (policy == DTRACEOPT_UNSET)
return (0);
}
int
{
int i;
/*
* To load the option values, we need to ask the kernel to provide its
* DOF, which we'll sift through to look for OPTDESC sections.
*/
for (i = 0; i < DTRACEOPT_MAX; i++)
for (i = 0; i < dof->dofh_secnum; i++) {
continue;
break;
}
continue;
continue;
}
return (0);
}
typedef struct dt_option {
const char *o_name;
} dt_option_t;
/*
* Compile-time options.
*/
{ "amin", dt_opt_amin },
{ "core", dt_opt_core },
{ "cpphdrs", dt_opt_cpp_hdrs },
{ "cpppath", dt_opt_cpp_path },
{ "ctypes", dt_opt_ctypes },
{ "dtypes", dt_opt_dtypes },
{ "debug", dt_opt_debug },
{ "droptags", dt_opt_droptags },
{ "encoding", dt_opt_encoding },
{ "evaltime", dt_opt_evaltime },
{ "iregs", dt_opt_iregs },
{ "late", dt_opt_xlate },
{ "lazyload", dt_opt_lazyload },
{ "ldpath", dt_opt_ld_path },
{ "libdir", dt_opt_libdir },
{ "linkmode", dt_opt_linkmode },
{ "linktype", dt_opt_linktype },
{ "pgmax", dt_opt_pgmax },
{ "stdc", dt_opt_stdc },
{ "syslibdir", dt_opt_syslibdir },
{ "tree", dt_opt_tree },
{ "tregs", dt_opt_tregs },
{ "unsetenv", dt_opt_setenv, 0 },
{ "version", dt_opt_version },
{ NULL }
};
/*
* Run-time options.
*/
{ NULL }
};
/*
* Dynamic run-time options.
*/
{ NULL }
};
int
{
/*
* We only need to search the run-time options -- it's not legal
* to get the values of compile-time options.
*/
return (0);
}
}
return (0);
}
}
}
int
{
}
}
/*
* Only dynamic run-time options may be set while
* tracing is active.
*/
}
}
}