Commit | Line | Data |
---|---|---|
e70712b3 | 1 | = babeltrace2-source.ctf.fs(7) |
0659f3af | 2 | :manpagetype: component class |
e70712b3 | 3 | :revdate: 14 September 2019 |
0659f3af PP |
4 | |
5 | ||
e70712b3 PP |
6 | == NAME |
7 | ||
8 | babeltrace2-source.ctf.fs - Babeltrace 2's file system CTF source | |
0659f3af PP |
9 | component class |
10 | ||
11 | ||
e70712b3 | 12 | == DESCRIPTION |
0659f3af | 13 | |
e70712b3 PP |
14 | A Babeltrace~2 compcls:source.ctf.fs message iterator reads one or |
15 | more https://diamon.org/ctf/[CTF]~1.8 streams on the file system | |
16 | and emits corresponding messages. | |
0659f3af | 17 | |
e70712b3 PP |
18 | ---- |
19 | CTF streams on | |
20 | the file system | |
21 | | | |
22 | | +---------------------+ | |
23 | | | src.ctf.fs | | |
24 | | | | | |
25 | '-->| ...5c847 | 0 | 0 @--> Stream 0 messages | |
26 | | ...5c847 | 0 | 1 @--> Stream 1 messages | |
27 | | ...5c847 | 0 | 2 @--> Stream 2 messages | |
28 | +---------------------+ | |
29 | ---- | |
0659f3af | 30 | |
e70712b3 | 31 | include::common-see-babeltrace2-intro.txt[] |
0659f3af | 32 | |
0659f3af | 33 | |
e70712b3 PP |
34 | [[input]] |
35 | === Input | |
0659f3af | 36 | |
e70712b3 PP |
37 | A compcls:source.ctf.fs component opens a single _logical_ CTF trace. A |
38 | logical CTF trace contains one or more _physical_ CTF traces. A physical | |
39 | CTF trace on the file system is a directory which contains: | |
0659f3af | 40 | |
e70712b3 PP |
41 | * One metadata stream file named `metadata`. |
42 | * One or more data stream files, that is, any file with a name that does | |
43 | not start with `.` and which is not `metadata`. | |
44 | * **Optional**: One https://lttng.org/[LTTng] index directory named | |
45 | `index`. | |
0659f3af | 46 | |
e70712b3 PP |
47 | If the logical CTF trace to handle contains more than one physical CTF |
48 | trace, then all the physical CTF traces must have a trace UUID and all | |
49 | UUIDs must be the same. Opening more than one physical CTF trace to | |
50 | constitute a single logical CTF trace is needed to support LTTng's | |
51 | tracing session rotation feature, for example (see man:lttng-rotate(1) | |
52 | starting from LTTng~2.11). | |
0659f3af | 53 | |
e70712b3 PP |
54 | You specify which physical CTF traces to open and read with the |
55 | param:inputs array parameter. Each entry in this array is the path to a | |
56 | physical CTF trace directory, that is, the directory directly containing | |
57 | the stream files. | |
0659f3af | 58 | |
e70712b3 PP |
59 | A compcls:source.ctf.fs component does not recurse into directories to |
60 | find CTF traces. However, the component class provides the | |
61 | `babeltrace.support-info` query object which indicates whether or not a | |
62 | given directory looks like a CTF trace directory (see | |
63 | <<support-info,```babeltrace.support-info`''>>). | |
0659f3af | 64 | |
e70712b3 PP |
65 | The component creates one output port for each logical CTF data stream. |
66 | More than one physical CTF data stream file can support a single logical | |
67 | CTF data stream (LTTng's trace file rotation and tracing session | |
68 | rotation can cause this). | |
0659f3af | 69 | |
0659f3af | 70 | |
e70712b3 | 71 | === Trace quirks |
0659f3af | 72 | |
e70712b3 PP |
73 | Many tracers produce CTF traces. A compcls:source.ctf.fs component makes |
74 | some effort to support as many CTF traces as possible, even those with | |
75 | malformed streams. | |
0659f3af | 76 | |
e70712b3 | 77 | Generally: |
0659f3af | 78 | |
e70712b3 PP |
79 | * If the `timestamp_begin` or `timestamp_end` packet context field class |
80 | exists, but it is not mapped to a clock class, and there's only one | |
81 | clock class at this point in the metadata stream, the component maps | |
82 | the field class to this unique clock class. | |
0659f3af | 83 | |
e70712b3 PP |
84 | A compcls:source.ctf.fs component has special quirk handling for some |
85 | https://lttng.org/[LTTng] and https://lttng.org/[barectf] traces, | |
86 | depending on the tracer's version: | |
0659f3af | 87 | |
e70712b3 PP |
88 | All LTTng versions:: |
89 | + | |
90 | -- | |
91 | * The component sets the `monotonic` clock class's origin to the Unix | |
92 | epoch so that different LTTng traces are always correlatable. | |
93 | + | |
94 | This is the equivalent of setting the | |
95 | param:force-clock-class-origin-unix-epoch parameter to true. | |
0659f3af | 96 | |
e70712b3 PP |
97 | * For a given data stream, for all the contiguous last packets of which |
98 | the `timestamp_end` context field is 0, the message iterator uses the | |
99 | packet's last event record's time as the packet end message's time. | |
100 | + | |
101 | This is useful for the traces which man:lttng-crash(1) generates. | |
102 | -- | |
103 | ||
104 | LTTng-UST up to, but excluding, 2.11.0:: | |
105 | LTTng-modules up to, but excluding, 2.9.13:: | |
106 | LTTng-modules from 2.10.0 to 2.10.9:: | |
107 | + | |
108 | -- | |
109 | * For a given packet, the message iterator uses the packet's last | |
110 | event record's time as the packet end message's time, ignoring the | |
111 | packet context's `timestamp_end` field. | |
112 | -- | |
113 | ||
114 | barectf up to, but excluding, 2.3.1:: | |
115 | + | |
116 | -- | |
117 | * For a given packet, the message iterator uses the packet's first event | |
118 | record's time as the packet beginning message's time, ignoring the | |
119 | packet context's `timestamp_begin` field. | |
120 | -- | |
0659f3af PP |
121 | |
122 | ||
e70712b3 | 123 | == INITIALIZATION PARAMETERS |
0659f3af | 124 | |
e70712b3 PP |
125 | param:clock-class-offset-ns='NS' vtype:[optional signed integer]:: |
126 | Add 'NS' nanoseconds to the offset of all the clock classes that the | |
127 | component creates. | |
0659f3af PP |
128 | + |
129 | You can combine this parameter with the param:clock-class-offset-s | |
130 | parameter. | |
131 | ||
e70712b3 PP |
132 | param:clock-class-offset-s='SEC' vtype:[optional signed integer]:: |
133 | Add 'SEC' seconds to the offset of all the clock classes that the | |
134 | component creates. | |
0659f3af PP |
135 | + |
136 | You can combine this parameter with the param:clock-class-offset-ns | |
137 | parameter. | |
138 | ||
e70712b3 PP |
139 | param:force-clock-class-origin-unix-epoch=`yes` vtype:[optional boolean]:: |
140 | Force the origin of all clock classes that the component creates to | |
141 | have a Unix epoch origin, whatever the detected tracer. | |
0659f3af | 142 | |
e70712b3 PP |
143 | param:inputs='DIRS' vtype:[array of strings]:: |
144 | Open and read the physical CTF traces located in 'DIRS'. | |
145 | + | |
146 | Each element of 'DIRS' is the path to a physical CTF trace directory | |
147 | containing the trace's stream files. | |
148 | + | |
149 | All the specified physical CTF traces must belong to the same logical | |
150 | CTF trace. See <<input,``Input''>> to learn more about logical and | |
151 | physical CTF traces. | |
0659f3af | 152 | |
e70712b3 PP |
153 | param:trace-name='NAME' vtype:[optional string]:: |
154 | Set the name of the trace object that the component creates to | |
155 | 'NAME'. | |
0659f3af PP |
156 | |
157 | ||
e70712b3 | 158 | == PORTS |
0659f3af | 159 | |
e70712b3 PP |
160 | ---- |
161 | +--------------------+ | |
162 | | src.ctf.fs | | |
163 | | | | |
164 | | ...5c847 | 0 | 1 @ | |
165 | | ... @ | |
166 | +--------------------+ | |
167 | ---- | |
0659f3af | 168 | |
0659f3af | 169 | |
e70712b3 | 170 | === Output |
0659f3af | 171 | |
e70712b3 PP |
172 | A compcls:source.ctf.fs component creates one output port for each |
173 | logical CTF data stream. See <<input,``Input''>> to learn more about | |
174 | logical and physical CTF data streams. | |
0659f3af | 175 | |
e70712b3 | 176 | Each output port's name has one of the following forms: |
0659f3af | 177 | |
e70712b3 PP |
178 | [verse] |
179 | __TRACE-ID__ | __STREAM-CLASS-ID__ | __STREAM-ID__ | |
180 | __TRACE-ID__ | __STREAM-ID__ | |
0659f3af | 181 | |
e70712b3 PP |
182 | The component uses the second form when the stream class ID is not |
183 | available. | |
0659f3af | 184 | |
e70712b3 PP |
185 | __TRACE-ID__:: |
186 | Trace's UUID if available, otherwise trace's absolute directory | |
187 | path. | |
0659f3af | 188 | |
e70712b3 PP |
189 | __STREAM-CLASS-ID__:: |
190 | Stream class ID. | |
0659f3af | 191 | |
e70712b3 PP |
192 | __STREAM-ID__:: |
193 | Stream ID if available, otherwise stream's absolute file path. | |
0659f3af | 194 | |
0659f3af | 195 | |
e70712b3 PP |
196 | [[query-objs]] |
197 | == QUERY OBJECTS | |
0659f3af | 198 | |
e70712b3 PP |
199 | [[support-info]] |
200 | === `babeltrace.support-info` | |
0659f3af | 201 | |
e70712b3 PP |
202 | See man:babeltrace2-query-babeltrace.support-info(7) to learn more |
203 | about this query object. | |
0659f3af | 204 | |
e70712b3 PP |
205 | For a directory input which is the path to a CTF trace directory, |
206 | the result object contains: | |
0659f3af | 207 | |
e70712b3 PP |
208 | nlqres:weight:: |
209 | 0.75 | |
0659f3af | 210 | |
e70712b3 PP |
211 | nlqres:group:: |
212 | Trace's UUID if available, otherwise the entry does not exist. | |
0659f3af | 213 | |
e70712b3 PP |
214 | You can leverage this query object's nlqres:group entry to assemble many |
215 | physical CTF traces as a single logical CTF trace (see | |
216 | <<input,``Input''>> to learn more about logical and physical CTF | |
217 | traces). This is how the man:babeltrace2-convert(1) command makes it | |
218 | possible to specify as non-option arguments the paths to multiple | |
219 | physical CTF traces which belong to the same logical CTF trace and | |
220 | create a single compcls:source.ctf.fs component. | |
0659f3af | 221 | |
0659f3af | 222 | |
e70712b3 | 223 | === `babeltrace.trace-infos` |
0659f3af | 224 | |
e70712b3 PP |
225 | See man:babeltrace2-query-babeltrace.trace-infos(7) to learn more |
226 | about this query object. | |
227 | ||
228 | ||
229 | === `metadata-info` | |
230 | ||
231 | You can query the `metadata-info` object for a specific CTF trace to get | |
232 | its plain text metadata stream as well as whether or not it is | |
233 | packetized. | |
0659f3af | 234 | |
e70712b3 PP |
235 | Parameters: |
236 | ||
237 | nlparam:path='PATH' vtype:[string]:: | |
238 | Path to the physical CTF trace directory which contains the | |
239 | `metadata` file. | |
0659f3af | 240 | |
e70712b3 | 241 | Result object (map): |
0659f3af | 242 | |
e70712b3 PP |
243 | qres:is-packetized vtype:[boolean]:: |
244 | True if the metadata stream file is packetized. | |
0659f3af | 245 | |
e70712b3 PP |
246 | qres:text vtype:[string]:: |
247 | Plain text metadata stream. | |
0659f3af PP |
248 | |
249 | ||
250 | include::common-footer.txt[] | |
251 | ||
252 | ||
e70712b3 PP |
253 | == SEE ALSO |
254 | ||
255 | man:babeltrace2-intro(7), | |
a8be4294 | 256 | man:babeltrace2-plugin-ctf(7), |
e70712b3 | 257 | man:lttng-crash(1) |