2 .\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH TNFCTL_TRACE_ATTRS_GET 3TNF "Mar 4, 1997"
8 tnfctl_trace_attrs_get \- get the trace attributes from a tnfctl handle
12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ltnfctl\fR [ \fIlibrary\fR... ]
13 #include <tnf/tnfctl.h>
15 \fBtnfctl_errcode_t\fR \fBtnfctl_trace_attrs_get\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR,
16 \fBtnfctl_trace_attrs_t *\fR\fIattrs\fR);
22 The \fBtnfctl_trace_attrs_get()\fR function returns the trace attributes
23 associated with \fIhndl\fR in \fIattrs\fR. The trace attributes can be changed
24 by some of the other interfaces in \fBlibtnfctl\fR(3TNF). It is the client's
25 responsibility to use \fBtnfctl_trace_attrs_get()\fR to get the new trace
26 attributes after use of interfaces that change them. Typically, a client will
27 use \fBtnfctl_trace_attrs_get()\fR after a call to \fBtnfctl_continue\fR(3TNF)
28 in order to make sure that tracing is still working. See the discussion of
29 \fBtrace_buf_state\fR that follows.
32 Trace attributes are represented by the \fBstruct tnfctl_trace_attrs\fR
33 structure defined in <\fBtnf/tnfctl.h\fR>:
37 struct tnfctl_trace_attrs {
38 pid_t targ_pid; /* not kernel mode */
39 const char *trace_file_name; /* not kernel mode */
40 size_t trace_buf_size;
41 size_t trace_min_size;
42 tnfctl_bufstate_t trace_buf_state;
43 boolean_t trace_state;
44 boolean_t filter_state; /* kernel mode only */
52 The semantics of the individual members of \fIattrs\fR are:
59 The process id of the target process. This is not valid for kernel tracing.
65 \fB\fBtrace_file_name\fR\fR
68 The name of the trace file to which the target writes. \fBtrace_file_name\fR
69 will be \fBNULL\fR if no trace file exists or if kernel tracing is implemented.
70 This pointer should not be used after calling other \fBlibtnfctl\fR interfaces.
71 The client should copy this string if it should be saved for the use of other
72 \fBlibtnfctl\fR interfaces.
78 \fB\fBtrace_buf_size\fR\fR
81 The size of the trace buffer or file in bytes.
87 \fB\fBtrace_min_size\fR\fR
90 The minimum size in bytes of the trace buffer that can be allocated by using
91 the \fBtnfctl_buffer_alloc\fR(3TNF) interface.
97 \fB\fBtrace_buf_state\fR\fR
100 The state of the trace buffer. \fBTNFCTL_BUF_OK\fR indicates that a trace
101 buffer has been allocated. \fBTNFCTL_BUF_NONE\fR indicates that no buffer has
102 been allocated. \fBTNFCTL_BUF_BROKEN\fR indicates that there is an internal
103 error in the target for tracing. The target will continue to run correctly, but
104 no trace records will be written. To fix tracing, restart the process. For
105 kernel tracing, deallocate the existing buffer with
106 \fBtnfctl_buffer_dealloc\fR(3TNF) and allocate a new one with
107 \fBtnfctl_buffer_alloc\fR(3TNF).
113 \fB\fBtrace_state\fR\fR
116 The global tracing state of the target. Probes that are enabled will not write
117 out data unless this state is on. This state is off by default for the kernel
118 and can be changed by \fBtnfctl_trace_state_set\fR(3TNF). For a process, this
119 state is on by default and can only be changed by
120 \fBtnf_process_disable\fR(3TNF) and \fBtnf_process_enable\fR(3TNF).
126 \fB\fBfilter_state\fR\fR
129 The state of process filtering. For kernel probe control, it is possible to
130 select a set of processes for which probes are enabled. See
131 \fBtnfctl_filter_list_get\fR(3TNF), \fBtnfctl_filter_list_add\fR(3TNF), and
132 \fBtnfctl_filter_list_delete\fR(3TNF). No trace output will be written when
133 other processes traverse these probe points. By default process filtering is
134 off, and all processes cause the generation of trace records when they hit an
135 enabled probe. Use \fBtnfctl_filter_state_set\fR(3TNF) to change the filter
142 The \fBtnfctl_trace_attrs_get()\fR function returns \fBTNFCTL_ERR_NONE\fR upon
147 The \fBtnfctl_trace_attrs_get()\fR function will fail if:
151 \fB\fBTNFCTL_ERR_INTERNAL\fR\fR
154 An internal error occurred.
160 See \fBattributes\fR(5) for descriptions of the following attributes:
168 ATTRIBUTE TYPE ATTRIBUTE VALUE
176 \fBprex\fR(1), \fBTNF_PROBE\fR(3TNF), \fBlibtnfctl\fR(3TNF),
177 \fBtnfctl_buffer_alloc\fR(3TNF), \fBtnfctl_continue\fR(3TNF),
178 \fBtnfctl_filter_list_get\fR(3TNF), \fBtnf_process_disable\fR(3TNF),
179 \fBtracing\fR(3TNF), \fBattributes\fR(5)