1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
|
= YAML trace type object
A _**trace type object**_ is the type of a xref:trace-obj.adoc[trace
object].
A trace type describes everything a CTF consumer needs to decode all the
trace's xref:how-barectf-works:ctf-primer.adoc#ds[data
streams].
A trace type object is only found as the
xref:trace-obj.adoc#type-prop[`type` property] of a trace object.
[[props]]
== Properties
[%autowidth.stretch, cols="d,d,a,d,d", role="can-break"]
|===
|Name |Type |Description |{req-abbr} |Default
|[[native-bo-prop]]`native-byte-order`
|xref:common-values.adoc#byte-order[Byte order]
|Native byte order of the system which produces this trace type's
instance's xref:how-barectf-works:ctf-primer.adoc#ds[data streams].
You must not use this property and the
<<trace-bo-prop,`trace-byte-order`>> property at the same time.
|Yes, if the `trace-byte-order` property is missing
|
|[[trace-bo-prop]]`trace-byte-order`
|xref:common-values.adoc#byte-order[Byte order]
|Byte order of fields of this trace type's
instance's xref:how-barectf-works:ctf-primer.adoc#ds[data streams].
[IMPORTANT]
====
This property exists to support barectf{nbsp}2 configurations.
Prefer the <<native-bo-prop,`native-byte-order`>> property instead, as
enforcing the trace byte order could result in a less efficient
generated tracer.
====
You must not use this property and the `native-byte-order` property at
the same time.
|Yes, if the `native-byte-order` property is missing
|
|[[uuid-prop]]`uuid`
|xref:common-values.adoc#uuid[UUID] or string
|UUID of this trace type.
If this property's value is the string `auto`, barectf generates a UUID.
|No
|No UUID
|[[ft-aliases-prop]]`$field-type-aliases`
|Mapping of string keys to xref:ft-obj.adoc[field type objects]
or strings
|Field type aliases.
Keys of this mapping are field type alias names.
If an entry's value is a string, it must be the name of an existing
field type alias.
You can use a field type alias name anywhere you can use a
xref:ft-obj.adoc[field type object].
|No
|Empty mapping
|[[ll-aliases-prop]]`$log-level-aliases`
|Mapping of string keys to integers
|Log level aliases.
Keys of this mapping are log level alias names.
Values of this mapping are positive integral log levels.
You can use a log level alias name as the value of an event record type
object's xref:ert-obj.adoc#ll-prop[`log-level` property].
|No
|Empty mapping
|`$features`
|<<features-obj>>
|Features of this trace type's instance (trace).
|No
|See <<features-obj>> for default values.
|[[clk-types-prop]]`clock-types`
|Mapping of string keys to xref:clk-type-obj.adoc[clock type objects]
|Clock type store for this trace type.
Keys of this mapping are clock type names. They must be valid
xref:index.adoc#tsdl-ident[TSDL identifiers].
The
xref:dst-obj.adoc#def-clk-type-name-prop[`$default-clock-type-name`
property] of a data stream type object refers to a key of this mapping.
|No
|No clock type store
|[[dsts-prop]]`data-stream-types`
|Mapping of string keys to xref:dst-obj.adoc[data stream
type objects]
|Data stream types of this trace type.
Keys of this mapping are data stream type names. They must be valid
C{nbsp}identifiers.
This mapping must contain at least one entry.
|Yes
|
|[[include-prop]]`$include`
|Sequence of strings.
|See xref:include.adoc[].
|No
|No inclusions
|===
[[features-obj]]
== Features object
The features of a trace type object.
As of barectf{nbsp}{page-component-version}, each feature controls
whether or not some information will be part of the header of each
xref:how-barectf-works:ctf-primer.adoc#pkt[CTF packet] which the
generated tracer produces.
You can enable or disable a feature. When you enable one, you can set
its xref:ft-obj.adoc[field type] explicitly or make barectf choose a
sane default.
=== Properties
For all the feature properties below, if the value is a boolean:
True::
Make barectf use a default field type.
False::
Disable the feature.
All the properties are optional.
[%autowidth.stretch, cols="d,d,a,d", role="can-break"]
|===
|Name |Type |Description |Default
|[[magic-ft-prop]]`magic-field-type`
|32-bit{nbsp}unsigned xref:int-ft-obj.adoc[integer field type object],
string, or boolean
|Type of packet header's magic number field.
If this property's value is a string, it must be the name of an existing
<<ft-aliases-prop,field type alias>>.
|Use a default field type (true)
|[[uuid-ft-prop]]`uuid-field-type`
|xref:static-array-ft-obj.adoc[Static array field type object] of
16{nbsp}8-bit{nbsp}unsigned xref:int-ft-obj.adoc[integer field
type objects] (8-bit{nbsp}alignment), string, or boolean
|Type of packet header's trace type UUID field.
If this property's value is a string, it must be the name of an existing
<<ft-aliases-prop,field type alias>>.
|Use a default field type (true) if this trace type has a
<<uuid-prop,`uuid` property>>, or false otherwise
|[[dst-id-ft-prop]]`data-stream-type-id-field-type`
|Unsigned xref:int-ft-obj.adoc[integer field type object], string,
or boolean
|Type of packet header's xref:dst-obj.adoc[data stream type] ID field.
If this property's value is a string, it must be the name of an existing
<<ft-aliases-prop,field type alias>>.
This feature is required when this trace type has more than one
data stream type (<<dsts-prop,`data-stream-types` property>>).
|Use a default field type (true)
|===
== Examples
NOTE: The following examples can omit <<dsts-prop,data stream type
objects>> for clarity.
.Basic trace type object.
====
[source,yaml]
----
native-byte-order: little-endian
data-stream-types:
# ...
----
====
.Trace type object with a specific <<uuid-prop,UUID>>.
====
[source,yaml]
----
native-byte-order: little-endian
uuid: 1b706833-b56c-4960-b5f7-e43651ff01fb
data-stream-types:
# ...
----
====
.Trace type object with an automatic <<uuid-prop,UUID>>.
====
[source,yaml]
----
native-byte-order: little-endian
uuid: auto
data-stream-types:
# ...
----
====
.Trace type object with a disabled <<magic-ft-prop,magic field type feature>>.
====
[source,yaml]
----
native-byte-order: little-endian
$features:
magic-field-type: false
data-stream-types:
# ...
----
====
.Trace type object with a specific <<dst-id-ft-prop,data stream type ID field type feature>>.
====
[source,yaml]
----
native-byte-order: little-endian
$features:
data-stream-type-id-field-type:
class: unsigned-integer
size: 8
data-stream-types:
# ...
----
====
.Trace type object with a <<clk-types-prop,clock type object>>.
====
[source,yaml]
----
native-byte-order: little-endian
clock-types:
sys_clock:
frequency: 8000000
description: Clock A13 (8 MHz)
origin-is-unix-epoch: false
data-stream-types:
my_stream:
$default-clock-type-name: sys_clock
# ...
# ...
----
====
.Trace type object with <<ft-aliases-prop,field type aliases>>.
====
[source,yaml]
----
native-byte-order: little-endian
$field-type-aliases:
hex-uint8:
$inherit: uint8
preferred-display-base: hexadecimal
string-array:
class: dynamic-array
element-field-type:
class: string
$features:
magic-field-type: hex-uint8
data-stream-types:
my_stream:
event-record-types:
my_event:
payload-field-type:
client_id: hex-uint8
messages: string-array
# ...
# ...
# ...
----
====
.Trace type object with a <<ll-aliases-prop,log level alias>>.
====
[source,yaml]
----
native-byte-order: little-endian
$log-level-aliases:
WARN: 17
data-stream-types:
my_stream:
event-record-types:
my_event:
log-level: WARN
# ...
# ...
# ...
# ...
----
====
.Trace type object with <<include-prop,inclusions>>.
====
[source,yaml]
----
native-byte-order: little-endian
data-stream-types:
# ...
$include:
- stdint.yaml
- stdmisc.yaml
- network-field-type-aliases.yaml
- sched-field-type-aliases.yaml
- default-log-levels.yaml
- project-b-data-stream-types.yaml
----
====
|