documentation update
[ust.git] / doc / man / ustctl.1
CommitLineData
c3947c25 1.\" generated with Ronn/v0.5
43550d37
JB
2.\" http://github.com/rtomayko/ronn/
3.
c3947c25 4.TH "USTCTL" "1" "May 2010" "" ""
43550d37
JB
5.
6.SH "NAME"
7\fBustctl\fR \-\- a program to control the tracing of userspace applications
8.
9.SH "SYNOPSIS"
10\fBustctl\fR [\fIcommand\fR] [\fIPIDs\fR]...
11.
12.SH "DESCRIPTION"
c3947c25 13\fBustctl\fR is a program to control the tracing of userspace applications. It can
43550d37
JB
14list markers, start the tracing, stop the tracing, enable/disable markers, etc.
15.
16.SH "OPTIONS"
17These programs follow the usual GNU command line syntax, with long options
18starting with two dashes(`\-'). A summary of options is included below.
19.
20.TP
21\fB\-h\fR, \fB\-\-help\fR
22Show summary of options.
23.
24.TP
25\fB\-\-create\-trace\fR
26Create trace.
27.
28.TP
29\fB\-\-alloc\-trace\fR
c3947c25 30Allocate trace.
43550d37
JB
31.
32.TP
33\fB\-\-start\-trace\fR
34Start tracing.
35.
36.TP
37\fB\-\-stop\-trace\fR
38Stop tracing.
39.
40.TP
41\fB\-\-destroy\-trace\fR
42Destroy the trace.
43.
44.TP
45\fB\-\-set\-subbuf\-size\fR \fICHANNEL\fR/\fIbytes\fR
c3947c25 46Set the size of subbuffers in CHANNEL.
43550d37
JB
47.
48.TP
49\fB\-\-set\-subbuf\-num\fR \fICHANNEL\fR
c3947c25 50Set the number of subbuffers per buffer for CHANNEL. Must be a power of 2.
43550d37
JB
51.
52.TP
53\fB\-\-get\-subbuf\-size\fR \fICHANNEL\fR
c3947c25 54Print the size of subbuffers per buffer for CHANNEL.
43550d37
JB
55.
56.TP
57\fB\-\-get\-subbuf\-num\fR \fICHANNEL\fR
c3947c25 58Print the number of subbuffers per buffer for CHANNEL.
43550d37
JB
59.
60.TP
61\fB\-\-enable\-marker\fR \fICHANNEL\fR/\fIMARKER\fR
62Enable a marker.
63.
64.TP
65\fB\-\-disable\-marker\fR \fICHANNEL\fR/\fIMARKER\fR
66Disable a marker.
67.
68.TP
69\fB\-\-list\-markers\fR
70List the markers of the process, their state and format string.
71.
c3947c25
PMF
72.SH "LIFE CYCLE OF A TRACE"
73Typically, the first step is to enable markers with \fB\-\-enable\-marker\fR. An
74enabled marker generates an event when the control flow passes over it
75(assuming the trace is recording). A disabled marker produces nothing. Enabling
76and disabling markers may however be done at any point, including while the
77trace is being recorded.
78.
79.P
80In order to record events, a trace is first created with \fB\-\-create\-trace\fR. At
81this point, the subbuffer count and size may be changed with \fB\-\-set\-subbuf\-num\fR
82and \fB\-\-set\-subbuf\-size\fR.
83.
84.P
85Afterward, the trace may be allocated with \fB\-\-alloc\-trace\fR. This allocates the
86buffers in memory, so once this is done, the subbuffer size and count can not
87be changed. Trace allocation also causes the daemon to connect to the trace
88buffers and wait for data to arrive. Explicit allocation is optional, as it is
89done automatically at trace start.
90.
91.P
92The trace may then be started with \fB\-\-start\-trace\fR. This results in events
93being recorded in the buffer. The daemon automatically collects these events.
94.
95.P
96The trace may be stopped with \fB\-\-stop\-trace\fR, either definitely after all the
97wanted information is collected, or temporarily, before being started again
98with \fB\-\-start\-trace\fR. This results in effectively "pausing" the recording.
99.
100.P
101Finally, when \fB\-\-destroy\-trace\fR is used, the trace buffers are unallocated.
102However, the memory may not be effectively freed until the daemon finishes to
103collect them.
104.
105.SH "STRUCTURE OF A TRACE"
106Each instrumentation point that is added in a program is associated to a
107channel.
108.
109.P
110Trace events are put in buffers. There is one buffer per channel, per cpu.
111For example, on a system with 4 cores and tracing an application with 3
112channels, there will be 12 buffers in total. The content of each of these
113buffers is put in a distinct file in the trace directory. For example, the \fBmetadata_2\fR file contains the data that was extracted from the buffer that
114contained the events from the metadata channel and having occurred on cpu 2.
115.
116.P
117In memory, each buffer is divided in subbuffers. Subbuffers are equally\-sized,
118contiguous parts of a buffer. The size of a buffer is equal to the number of
119subbuffers it contains times the size of each subbuffer. When a subbuffer is
120full, it is collected by the daemon while the others are filled. If, however,
121the buffer size is too small, buffer overflows may occur and result in event
122loss. By default, the number of subbuffers per buffer is 2. Subbuffer size
123for a given channel may be chosen with \fB\-\-set\-subbuf\-size\fR while the subbuffer
124count is set with \fB\-\-set\-subbuf\-num\fR.
125.
126.SH "SEE ALSO"
127usttrace(1), ustd(1)
128.
43550d37
JB
129.SH "AUTHOR"
130\fBustctl\fR was written by Pierre\-Marc Fournier.
131.
132.P
133This manual page was written by Jon Bernard <jbernard@debian.org>, for
c3947c25
PMF
134the Debian project (and may be used by others). It was updated by Pierre\-Marc
135Fournier.
This page took 0.028369 seconds and 4 git commands to generate.