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]
26 TUNABLE_INT("debug.dtrace.debug", &dtrace_debug);
27 SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RW, &dtrace_debug, 0, "");
29 /* Report registered DTrace providers. */
31 sysctl_dtrace_providers(SYSCTL_HANDLER_ARGS)
35 *prov = dtrace_provider;
39 mutex_enter(&dtrace_provider_lock);
40 mutex_enter(&dtrace_lock);
42 /* Compute the length of the space-separated provider name string. */
43 while (prov != NULL) {
44 len += strlen(prov->dtpv_name) + 1;
45 prov = prov->dtpv_next;
48 if ((p_name = kmem_alloc(len, KM_SLEEP)) == NULL)
51 /* Start with an empty string. */
54 /* Point to the first provider again. */
55 prov = dtrace_provider;
57 /* Loop through the providers, appending the names. */
58 while (prov != NULL) {
59 if (prov != dtrace_provider)
60 (void) strlcat(p_name, " ", len);
62 (void) strlcat(p_name, prov->dtpv_name, len);
64 prov = prov->dtpv_next;
68 mutex_exit(&dtrace_lock);
69 mutex_exit(&dtrace_provider_lock);
72 error = sysctl_handle_string(oidp, p_name, len, req);
80 SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_RD,
81 0, 0, sysctl_dtrace_providers, "A", "");