4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
25 /* Report registered DTrace providers. */
27 sysctl_dtrace_providers(SYSCTL_HANDLER_ARGS)
31 *prov = dtrace_provider;
35 mutex_enter(&dtrace_provider_lock);
36 mutex_enter(&dtrace_lock);
38 /* Compute the length of the space-separated provider name string. */
39 while (prov != NULL) {
40 len += strlen(prov->dtpv_name) + 1;
41 prov = prov->dtpv_next;
44 if ((p_name = kmem_alloc(len, KM_SLEEP)) == NULL)
47 /* Start with an empty string. */
50 /* Point to the first provider again. */
51 prov = dtrace_provider;
53 /* Loop through the providers, appending the names. */
54 while (prov != NULL) {
55 if (prov != dtrace_provider)
56 (void) strlcat(p_name, " ", len);
58 (void) strlcat(p_name, prov->dtpv_name, len);
60 prov = prov->dtpv_next;
64 mutex_exit(&dtrace_lock);
65 mutex_exit(&dtrace_provider_lock);
68 error = sysctl_handle_string(oidp, p_name, len, req);
76 SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters");
78 SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers,
79 CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_RD, 0, 0, sysctl_dtrace_providers,
80 "A", "available DTrace providers");
82 SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters");
84 SYSCTL_INT(_kern_dtrace, OID_AUTO, err_verbose, CTLFLAG_RW,
85 &dtrace_err_verbose, 0,
86 "print DIF and DOF validation errors to the message buffer");
88 SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max,
89 0, "largest allowed argument to memstr(), 0 indicates no limit");
91 SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW,
92 &dtrace_dof_maxsize, 0, "largest allowed DOF table");
94 SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
95 &dtrace_helper_actions_max, 0, "maximum number of allowed helper actions");
97 SYSCTL_INT(_security_bsd, OID_AUTO, allow_destructive_dtrace, CTLFLAG_RDTUN,
98 &dtrace_allow_destructive, 1, "Allow destructive mode DTrace scripts");