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