'\" te .\" 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] .TH tnfctl_kernel_open 3TNF "4 Mar 1997" "SunOS 5.11" "TNF Library Functions" .SH NAME tnfctl_kernel_open \- create handle for kernel probe control .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] #include \fBtnfctl_errcode_t\fR \fBtnfctl_kernel_open\fR(\fBtnfctl_handle_t **\fR\fIret_val\fR); .fi .SH DESCRIPTION .sp .LP \fBtnfctl_kernel_open()\fR starts a kernel tracing session and returns in \fBret_val\fR 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 \fBTNFCTL_ERR_BUSY\fR is returned if there is another process using kernel tracing. Use the command .sp .in +2 .nf \fBfuser\fR \fB-f\fR \fB/dev/tnfctl\fR .fi .in -2 .sp .sp .LP to print the process id of the process currently using kernel tracing. Only a superuser may use \fBtnfctl_kernel_open()\fR. An error code of \fBTNFCTL_ERR_ACCES\fR is returned if the caller does not have the necessary privileges. .SH RETURN VALUES .sp .LP \fBtnfctl_kernel_open\fR returns \fBTNFCTL_ERR_NONE\fR upon success. .SH ERRORS .sp .ne 2 .mk .na \fB\fBTNFCTL_ERR_ACCES\fR\fR .ad .RS 27n .rt Permission denied. Superuser privileges are needed for kernel tracing. .RE .sp .ne 2 .mk .na \fB\fBTNFCTL_ERR_BUSY\fR\fR .ad .RS 27n .rt Another client is currently using kernel tracing. .RE .sp .ne 2 .mk .na \fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR .ad .RS 27n .rt Memory allocation failed. .RE .sp .ne 2 .mk .na \fB\fBTNFCTL_ERR_FILENOTFOUND\fR\fR .ad .RS 27n .rt \fB/dev/tnfctl\fR not found. .RE .sp .ne 2 .mk .na \fB\fBTNFCTL_ERR_INTERNAL\fR\fR .ad .RS 27n .rt Some other failure occurred. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ MT LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBprex\fR(1), \fBfuser\fR(1M), \fBTNF_PROBE\fR(3TNF), \fBlibtnfctl\fR(3TNF), \fBtracing\fR(3TNF), \fBtnf_kernel_probes\fR(4), \fBattributes\fR(5)