Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved
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 or http://www.opensolaris.org/os/licensing. 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]
cc [ flag ... ] file ... -ltnfctl [ library ... ] #include <tnf/tnfctl.h> tnfctl_errcode_t tnfctl_kernel_open(tnfctl_handle_t **ret_val);
tnfctl_kernel_open() starts a kernel tracing session and returns in ret_val an opaque handle that can be used to control tracing and probes in the kernel. Only one kernel tracing session is possible at a time on a given machine. An error code of TNFCTL_ERR_BUSY is returned if there is another process using kernel tracing. Use the command
fuser -f /dev/tnfctl
to print the process id of the process currently using kernel tracing. Only a superuser may use tnfctl_kernel_open(). An error code of TNFCTL_ERR_ACCES is returned if the caller does not have the necessary privileges.
tnfctl_kernel_open returns TNFCTL_ERR_NONE upon success.
TNFCTL_ERR_ACCES
Permission denied. Superuser privileges are needed for kernel tracing.
TNFCTL_ERR_BUSY
Another client is currently using kernel tracing.
TNFCTL_ERR_ALLOCFAIL
Memory allocation failed.
TNFCTL_ERR_FILENOTFOUND
TNFCTL_ERR_INTERNAL
Some other failure occurred.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT Level | MT-Safe |
prex(1), fuser(1M), TNF_PROBE(3TNF), libtnfctl(3TNF), tracing(3TNF), tnf_kernel_probes(4), attributes(5)