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 SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters");
28 TUNABLE_INT("debug.dtrace.debug", &dtrace_debug);
29 SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RW, &dtrace_debug, 0, "");
31 /* Report registered DTrace providers. */
33 sysctl_dtrace_providers(SYSCTL_HANDLER_ARGS)
37 *prov = dtrace_provider;
41 mutex_enter(&dtrace_provider_lock);
42 mutex_enter(&dtrace_lock);
44 /* Compute the length of the space-separated provider name string. */
45 while (prov != NULL) {
46 len += strlen(prov->dtpv_name) + 1;
47 prov = prov->dtpv_next;
50 if ((p_name = kmem_alloc(len, KM_SLEEP)) == NULL)
53 /* Start with an empty string. */
56 /* Point to the first provider again. */
57 prov = dtrace_provider;
59 /* Loop through the providers, appending the names. */
60 while (prov != NULL) {
61 if (prov != dtrace_provider)
62 (void) strlcat(p_name, " ", len);
64 (void) strlcat(p_name, prov->dtpv_name, len);
66 prov = prov->dtpv_next;
70 mutex_exit(&dtrace_lock);
71 mutex_exit(&dtrace_provider_lock);
74 error = sysctl_handle_string(oidp, p_name, len, req);
82 SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_RD,
83 0, 0, sysctl_dtrace_providers, "A", "available DTrace providers");
85 SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters");
87 SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW,
88 &dtrace_dof_maxsize, 0, "largest allowed DOF table");
90 SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
91 &dtrace_helper_actions_max, 0, "maximum number of allowed helper actions");
93 SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max,
94 0, "largest allowed argument to memstr(), 0 indicates no limit");