'\" 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_TRACE_ATTRS_GET 3TNF "Mar 4, 1997" .SH NAME tnfctl_trace_attrs_get \- get the trace attributes from a tnfctl handle .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ltnfctl\fR [ \fIlibrary\fR... ] #include \fBtnfctl_errcode_t\fR \fBtnfctl_trace_attrs_get\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, \fBtnfctl_trace_attrs_t *\fR\fIattrs\fR); .fi .SH DESCRIPTION .sp .LP The \fBtnfctl_trace_attrs_get()\fR function returns the trace attributes associated with \fIhndl\fR in \fIattrs\fR. The trace attributes can be changed by some of the other interfaces in \fBlibtnfctl\fR(3TNF). It is the client's responsibility to use \fBtnfctl_trace_attrs_get()\fR to get the new trace attributes after use of interfaces that change them. Typically, a client will use \fBtnfctl_trace_attrs_get()\fR after a call to \fBtnfctl_continue\fR(3TNF) in order to make sure that tracing is still working. See the discussion of \fBtrace_buf_state\fR that follows. .sp .LP Trace attributes are represented by the \fBstruct tnfctl_trace_attrs\fR structure defined in <\fBtnf/tnfctl.h\fR>: .sp .in +2 .nf struct tnfctl_trace_attrs { pid_t targ_pid; /* not kernel mode */ const char *trace_file_name; /* not kernel mode */ size_t trace_buf_size; size_t trace_min_size; tnfctl_bufstate_t trace_buf_state; boolean_t trace_state; boolean_t filter_state; /* kernel mode only */ long pad; }; .fi .in -2 .sp .LP The semantics of the individual members of \fIattrs\fR are: .sp .ne 2 .na \fB\fBtarg_pid\fR\fR .ad .RS 19n The process id of the target process. This is not valid for kernel tracing. .RE .sp .ne 2 .na \fB\fBtrace_file_name\fR\fR .ad .RS 19n The name of the trace file to which the target writes. \fBtrace_file_name\fR will be \fBNULL\fR if no trace file exists or if kernel tracing is implemented. This pointer should not be used after calling other \fBlibtnfctl\fR interfaces. The client should copy this string if it should be saved for the use of other \fBlibtnfctl\fR interfaces. .RE .sp .ne 2 .na \fB\fBtrace_buf_size\fR\fR .ad .RS 19n The size of the trace buffer or file in bytes. .RE .sp .ne 2 .na \fB\fBtrace_min_size\fR\fR .ad .RS 19n The minimum size in bytes of the trace buffer that can be allocated by using the \fBtnfctl_buffer_alloc\fR(3TNF) interface. .RE .sp .ne 2 .na \fB\fBtrace_buf_state\fR\fR .ad .RS 19n The state of the trace buffer. \fBTNFCTL_BUF_OK\fR indicates that a trace buffer has been allocated. \fBTNFCTL_BUF_NONE\fR indicates that no buffer has been allocated. \fBTNFCTL_BUF_BROKEN\fR indicates that there is an internal error in the target for tracing. The target will continue to run correctly, but no trace records will be written. To fix tracing, restart the process. For kernel tracing, deallocate the existing buffer with \fBtnfctl_buffer_dealloc\fR(3TNF) and allocate a new one with \fBtnfctl_buffer_alloc\fR(3TNF). .RE .sp .ne 2 .na \fB\fBtrace_state\fR\fR .ad .RS 19n The global tracing state of the target. Probes that are enabled will not write out data unless this state is on. This state is off by default for the kernel and can be changed by \fBtnfctl_trace_state_set\fR(3TNF). For a process, this state is on by default and can only be changed by \fBtnf_process_disable\fR(3TNF) and \fBtnf_process_enable\fR(3TNF). .RE .sp .ne 2 .na \fB\fBfilter_state\fR\fR .ad .RS 19n The state of process filtering. For kernel probe control, it is possible to select a set of processes for which probes are enabled. See \fBtnfctl_filter_list_get\fR(3TNF), \fBtnfctl_filter_list_add\fR(3TNF), and \fBtnfctl_filter_list_delete\fR(3TNF). No trace output will be written when other processes traverse these probe points. By default process filtering is off, and all processes cause the generation of trace records when they hit an enabled probe. Use \fBtnfctl_filter_state_set\fR(3TNF) to change the filter state. .RE .SH RETURN VALUES .sp .LP The \fBtnfctl_trace_attrs_get()\fR function returns \fBTNFCTL_ERR_NONE\fR upon success. .SH ERRORS .sp .LP The \fBtnfctl_trace_attrs_get()\fR function will fail if: .sp .ne 2 .na \fB\fBTNFCTL_ERR_INTERNAL\fR\fR .ad .RS 23n An internal error occurred. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT Level MT-Safe .TE .SH SEE ALSO .sp .LP \fBprex\fR(1), \fBTNF_PROBE\fR(3TNF), \fBlibtnfctl\fR(3TNF), \fBtnfctl_buffer_alloc\fR(3TNF), \fBtnfctl_continue\fR(3TNF), \fBtnfctl_filter_list_get\fR(3TNF), \fBtnf_process_disable\fR(3TNF), \fBtracing\fR(3TNF), \fBattributes\fR(5)