Typo: occured -> occurred
[babeltrace.git] / doc / man / babeltrace2-sink.ctf.fs.7.txt
CommitLineData
e70712b3 1= babeltrace2-sink.ctf.fs(7)
0659f3af 2:manpagetype: component class
e70712b3 3:revdate: 14 September 2019
0659f3af
PP
4
5
e70712b3
PP
6== NAME
7
8babeltrace2-sink.ctf.fs - Babeltrace 2's file system CTF sink component
0659f3af
PP
9class
10
11
e70712b3
PP
12== DESCRIPTION
13
14A Babeltrace~2 compcls:sink.ctf.fs component writes the messages it
15consumes to one or more https://diamon.org/ctf/[CTF]~1.8 traces on
0659f3af
PP
16the file system.
17
e70712b3
PP
18----
19 +-------------+
20 | sink.ctf.fs |
21 | +--> CTF trace(s) on
22Messages -->@ in | the file system
23 +-------------+
24----
25
26include::common-see-babeltrace2-intro.txt[]
27
28A compcls:sink.ctf.fs component does not merge traces: it writes the
29messages of different input traces to different output traces.
30
31
32=== Special trace IR to CTF translations
33
34A compcls:sink.ctf.fs component makes a best effort to write CTF traces
35that are semantically equivalent to the input traces. As of this
36version, the component writes CTF~1.8 traces, so the following
37field class translations can occur:
38
39* The component translates a boolean field class to a CTF unsigned 8-bit
40 integer field class.
41+
42The unsigned integer field's value is 0 when the boolean field's value
43is false and 1 when the boolean field's value is true.
44
45* The component translates a bit array field to a CTF unsigned
46 integer field class having the same length.
47
48* The component translates an option field class to a CTF variant
49 field class where the options are an empty structure field class
50 and the optional field class itself.
51+
52The empty structure field is selected when the option field has no
53field.
54
55In all the cases above, the component adds a comment in the metadata
56stream, above the field class, to indicate that a special translation
118ae153 57occurred.
e70712b3
PP
58
59
60=== Input message constraints
61
62Because of limitations in CTF~1.8 regarding how discarded events
63and packets are encoded:
64
65* If a stream class supports discarded events and the
66 param:ignore-discarded-events parameter is :not: true:
67
68** The stream class must support packets.
69** Discarded events messages must have times.
70** Any discarded events message must occur between a packet end
71 and a packet beginning message.
72** The beginning time of a discarded events message must be the same
73 as the time of the last packet end message.
74** The end time of a discarded events message must be the same
75 as the time of the next packet end message.
76** Time ranges of discarded events messages must not overlap.
77
78* If a stream class supports discarded packets and the
79 param:ignore-discarded-packets parameter is :not: true:
80
81** The stream class must support packets.
82** Discarded packets messages must have times.
83** The beginning time of a discarded events message must be the same
84 as the time of the last packet end message.
85** The end time of a discarded events message must be the same
86 as the time of the next packet beginning message.
87** Time ranges of discarded packets messages must not overlap.
0659f3af 88
e70712b3
PP
89The messages which a compcls:source.ctf.fs component creates satisfy all
90the requirements above.
0659f3af 91
e70712b3
PP
92If a discarded events or packets message has no events/packets count,
93the compcls:sink.ctf.fs component adds 1 to the corresponding CTF
94stream's counter.
0659f3af 95
0659f3af 96
e70712b3 97=== Alignment and byte order
0659f3af 98
e70712b3
PP
99A compcls:sink.ctf.fs component always aligns data fields as such:
100
101Integer fields with a size which is not a multiple of 8::
102 1-bit.
103
104All other scalar fields (integer, enumeration, real, string)::
105 8-bit.
106
107The component writes fields using the machine's native byte order. As of
108this version, there's no way to force a custom byte order.
109
110
111[[output-path]]
112=== Output path
0659f3af 113
0659f3af 114The path of a CTF trace is the directory which directly contains the
e70712b3 115metadata and data stream files.
0659f3af 116
e70712b3
PP
117The current strategy to build a path in which to write the streams of
118a given input trace is, in this order:
0659f3af 119
e70712b3
PP
120. If the param:assume-single-trace parameter is true, then the output
121 trace path to use for the single input trace is the directory
122 specified by the param:path parameter.
123
124. If the component recognizes the input trace as an LTTng (2.11 or
125 greater) trace, then it checks specific trace environment values to
126 build a trace path relative to the directory specified by the
127 param:path parameter:
0659f3af 128+
e70712b3
PP
129--
130
131Linux kernel domain::
132+
133[verse]
134__HOST__/__SNAME__-__STIME__/kernel
135
136User space domain, per-UID buffering::
0659f3af 137+
e70712b3
PP
138[verse]
139__HOST__/__SNAME__-__STIME__/ust/uid/__UID__/__ARCHW__-bit
140
141User space domain, per-PID buffering::
142+
143[verse]
144__HOST__/__SNAME__-__STIME__/ust/pid/__PNAME__-__PID__-__PTIME__
145
0659f3af 146--
0659f3af 147+
e70712b3 148With:
0659f3af 149+
0659f3af 150--
e70712b3
PP
151__HOST__::
152 Target's hostname.
0659f3af 153
e70712b3
PP
154__SNAME__::
155 Tracing session name.
0659f3af 156
e70712b3
PP
157__STIME__::
158 Tracing session creation date/time.
0659f3af 159
e70712b3
PP
160__UID__::
161 User ID.
0659f3af 162
e70712b3
PP
163__ARCHW__::
164 Architecture's width (`32` or `64`).
0659f3af 165
e70712b3
PP
166__PNAME__::
167 Process name.
0659f3af 168
e70712b3
PP
169__PID__::
170 Process ID.
0659f3af 171
e70712b3
PP
172__PTIME__::
173 Process's date/time.
174--
0659f3af 175
e70712b3
PP
176. If the input trace has a name, then the component sanitizes this name
177 and uses it as a relative path to the directory specified by the
178 param:path parameter.
179+
180The trace name sanitization operation:
181+
182* Replaces `.` subdirectories with `_`.
183* Replaces `..` subdirectories with `__`.
184* Removes any trailing `/` character.
0659f3af 185
e70712b3
PP
186. The component uses the subdirectory `trace` relative to the directory
187 specified by the param:path parameter.
0659f3af 188
e70712b3
PP
189In all the cases above, if the effective output trace path already
190exists on the file system, the component appends a numeric suffix to the
191name of the last subdirectory. The suffix starts at 0 and increments
192until the path does not exist.
0659f3af 193
0659f3af 194
e70712b3
PP
195== INITIALIZATION PARAMETERS
196
197param:assume-single-trace=`yes` vtype:[optional boolean]::
198 Assume that the component only receives messages related to a single
199 input trace.
200+
201This parameter affects how the component builds the output trace path
202(see <<output-path,``Output path''>>).
203
204param:ignore-discarded-events=`yes` vtype:[optional boolean]::
205 Ignore discarded events messages.
206
207param:ignore-discarded-packets=`yes` vtype:[optional boolean]::
208 Ignore discarded packets messages.
209
210param:path='PATH' vtype:[string]::
211 Base output path.
212+
213See <<output-path,``Output path''>> to learn how the component uses this
214parameter to build the output path for a given input trace.
215
216param:quiet=`yes` vtype:[optional boolean]::
217 Do not write anything to the standard output.
218
219
220== PORTS
221
222----
223+-------------+
224| sink.ctf.fs |
225| |
226@ in |
227+-------------+
228----
229
230
231=== Input
232
233`in`::
234 Single input port.
0659f3af
PP
235
236
237include::common-footer.txt[]
238
239
e70712b3
PP
240== SEE ALSO
241
242man:babeltrace2-intro(7),
243man:babeltrace2-plugin-ctf(7)
This page took 0.053504 seconds and 4 git commands to generate.