'\" te .\" Copyright 2002 Sun Microsystems Inc. .\" 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 tnf_process_disable 3TNF "5 Feb 2002" "SunOS 5.11" "TNF Library Functions" .SH NAME tnf_process_disable, tnf_process_enable, tnf_thread_disable, tnf_thread_enable \- probe control internal interface .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfprobe\fR [ \fIlibrary\fR ... ] #include \fBvoid\fR \fBtnf_process_disable\fR(\fBvoid\fR); .fi .LP .nf \fBvoid\fR \fBtnf_process_enable\fR(\fBvoid\fR); .fi .LP .nf \fBvoid\fR \fBtnf_thread_disable\fR(\fBvoid\fR); .fi .LP .nf \fBvoid\fR \fBtnf_thread_enable\fR(\fBvoid\fR); .fi .SH DESCRIPTION .sp .LP There are three levels of granularity for controlling tracing and probe functions (called probing from here on): probing for the entire process, a particular thread, and the probe itself can be disabled or enabled. The first two (process and thread) are controlled by this interface. The probe is controlled with the \fBprex\fR(1) utility. .sp .LP The \fBtnf_process_disable()\fR function turns off probing for the process. The default process state is to have probing enabled. The \fBtnf_process_enable()\fR function turns on probing for the process. .sp .LP The \fBtnf_thread_disable()\fR function turns off probing for the currently running thread. Threads are "born" or created with this state enabled. The \fBtnf_thread_enable()\fR function turns on probing for the currently running thread. If the program is a non-threaded program, these two thread interfaces disable or enable probing for the process. .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 _ Interface StabilityUnstable _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBprex\fR(1), \fBtnfdump\fR(1), \fBTNF_DECLARE_RECORD\fR(3TNF), \fBTNF_PROBE\fR(3TNF), \fBattributes\fR(5) .SH NOTES .sp .LP A probe is considered enabled only if: .RS +4 .TP .ie t \(bu .el o \fBprex\fR(1) has enabled the probe AND .RE .RS +4 .TP .ie t \(bu .el o the process has probing enabled, which is the default or could be set with \fBtnf_process_enable()\fR AND .RE .RS +4 .TP .ie t \(bu .el o the thread that hits the probe has probing enabled, which is every thread's default or could be set with \fBtnf_thread_enable()\fR. .RE .sp .LP There is a run time cost associated with determining that the probe is disabled. To reduce the performance effect of probes, this cost should be minimized. The quickest way that a probe can be determined to be disabled is by the enable control that \fBprex\fR(1) uses. Therefore, to disable all the probes in a process use the \fBdisable\fR command in \fBprex\fR(1) rather than \fBtnf_process_disable()\fR. .sp .LP The \fBtnf_process_disable()\fR and \fBtnf_process_enable()\fR functions should only be used to toggle probing based on some internal program condition. The \fBtnf_thread_disable()\fR function should be used to turn off probing for threads that are uninteresting.