1tnfctl_trace_attrs_get(3TNF) TNF Library Functionstnfctl_trace_attrs_get(3TNF)
2
3
4

NAME

6       tnfctl_trace_attrs_get - get the trace attributes from a tnfctl handle
7

SYNOPSIS

9       cc [ flag... ] file... -ltnfctl [ library... ]
10       #include <tnf/tnfctl.h>
11
12       tnfctl_errcode_t tnfctl_trace_attrs_get(tnfctl_handle_t *hndl,
13            tnfctl_trace_attrs_t *attrs);
14
15

DESCRIPTION

17       The  tnfctl_trace_attrs_get()  function  returns  the  trace attributes
18       associated with hndl in attrs. The trace attributes can be  changed  by
19       some  of  the  other  interfaces in libtnfctl(3TNF). It is the client's
20       responsibility to use  tnfctl_trace_attrs_get() to get  the  new  trace
21       attributes  after  use  of  interfaces  that change them.  Typically, a
22       client will use tnfctl_trace_attrs_get() after a  call  to  tnfctl_con‐
23       tinue(3TNF)  in  order to make sure that tracing is still working.  See
24       the discussion of trace_buf_state that follows.
25
26
27       Trace attributes  are  represented  by  the  struct  tnfctl_trace_attrs
28       structure defined in <tnf/tnfctl.h>:
29
30         struct tnfctl_trace_attrs {
31         pid_t              targ_pid;           /* not kernel mode */
32         const char         *trace_file_name;   /* not kernel mode */
33         size_t             trace_buf_size;
34         size_t             trace_min_size;
35         tnfctl_bufstate_t  trace_buf_state;
36         boolean_t          trace_state;
37         boolean_t          filter_state;       /* kernel mode only */
38         long               pad;
39         };
40
41
42
43       The semantics of the individual members of attrs are:
44
45       targ_pid           The  process  id of the target process.  This is not
46                          valid for kernel tracing.
47
48
49       trace_file_name    The name of the  trace  file  to  which  the  target
50                          writes.   trace_file_name  will  be NULL if no trace
51                          file exists or if  kernel  tracing  is  implemented.
52                          This  pointer should not be used after calling other
53                          libtnfctl interfaces. The client  should  copy  this
54                          string  if  it  should be saved for the use of other
55                          libtnfctl interfaces.
56
57
58       trace_buf_size     The size of the trace buffer or file in bytes.
59
60
61       trace_min_size     The minimum size in bytes of the trace  buffer  that
62                          can   be   allocated   by   using   the  tnfctl_buf‐
63                          fer_alloc(3TNF) interface.
64
65
66       trace_buf_state    The state of the trace buffer.  TNFCTL_BUF_OK  indi‐
67                          cates  that  a  trace  buffer  has  been  allocated.
68                          TNFCTL_BUF_NONE indicates that no  buffer  has  been
69                          allocated. TNFCTL_BUF_BROKEN indicates that there is
70                          an internal error in the  target  for  tracing.  The
71                          target  will continue to run correctly, but no trace
72                          records will be written. To fix tracing, restart the
73                          process. For kernel tracing, deallocate the existing
74                          buffer with tnfctl_buffer_dealloc(3TNF) and allocate
75                          a new one with tnfctl_buffer_alloc(3TNF).
76
77
78       trace_state        The  global tracing state of the target. Probes that
79                          are enabled will not  write  out  data  unless  this
80                          state  is  on.  This state is off by default for the
81                          kernel     and      can      be      changed      by
82                          tnfctl_trace_state_set(3TNF).  For  a  process, this
83                          state is on by default and can only  be  changed  by
84                          tnf_process_disable(3TNF)                        and
85                          tnf_process_enable(3TNF).
86
87
88       filter_state       The state of process filtering.   For  kernel  probe
89                          control, it is possible to select a set of processes
90                          for  which  probes  are  enabled.  See   tnfctl_fil‐
91                          ter_list_get(3TNF),    tnfctl_filter_list_add(3TNF),
92                          and tnfctl_filter_list_delete(3TNF). No trace output
93                          will  be written when other processes traverse these
94                          probe points.  By default process filtering is  off,
95                          and  all  processes  cause  the  generation of trace
96                          records  when  they  hit  an  enabled  probe.    Use
97                          tnfctl_filter_state_set(3TNF)  to  change the filter
98                          state.
99
100

RETURN VALUES

102       The tnfctl_trace_attrs_get() function returns TNFCTL_ERR_NONE upon suc‐
103       cess.
104

ERRORS

106       The tnfctl_trace_attrs_get() function will fail if:
107
108       TNFCTL_ERR_INTERNAL    An internal error occurred.
109
110

ATTRIBUTES

112       See attributes(5) for descriptions of the following attributes:
113
114
115
116
117       ┌─────────────────────────────┬─────────────────────────────┐
118       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
119       ├─────────────────────────────┼─────────────────────────────┤
120       │Availability                 │SUNWtnfc                     │
121       ├─────────────────────────────┼─────────────────────────────┤
122       │MT Level                     │MT-Safe                      │
123       └─────────────────────────────┴─────────────────────────────┘
124

SEE ALSO

126       prex(1),  TNF_PROBE(3TNF),  libtnfctl(3TNF), tnfctl_buffer_alloc(3TNF),
127       tnfctl_continue(3TNF),  tnfctl_filter_list_get(3TNF),  tnf_process_dis‐
128       able(3TNF), tracing(3TNF), attributes(5)
129
130
131
132SunOS 5.11                        4 Mar 1997      tnfctl_trace_attrs_get(3TNF)
Impressum