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