YAML clock type object

A clock type object is the type of data stream clocks.

Clock type objects are only found under the clock-types property of a trace type object.

The only purpose of a clock type is to be a data stream type object's default clock type.

Properties

All the properties are optional.

Name Type Description Default

frequency

Integer, greater than 0

Frequency of instances (Hz).

1,000,000,000 (1 GHz)

offset

Clock type offset object

Offset of instances.

See Clock type offset object for default values.

origin-is-unix-epoch

Boolean

True if the origin of instances is the Unix epoch.

True

precision

Positive integer

Precision of instances (cycles).

0

uuid

UUID

Clock type’s UUID.

No UUID

description

String

Clock type’s description.

No description

$c-type

String

Return C type of the clock source function for this clock type.

See Write a barectf platform to learn more.

uint32_t

$include

Sequence of strings.

No inclusions

Clock type offset object

Offset information of a clock type’s instances.

Properties

All the properties are optional.

Name Type Description Default

seconds

Integer

Offset in seconds.

0

cycles

Positive integer

Offset in cycles.

0

The two properties form an effective offset (from the clock’s origin) as such:

seconds + cycles / frequency

frequency is a clock type property.

Examples

Example 1. Basic 1 GHz clock type object.

This empty mapping, when used where a clock type is expected, is a valid, default clock type.

{}
Example 2. Basic 100 kHz clock type object.
frequency: 100000
Example 3. Basic 1 GHz clock type object with an unsigned long long C type.
$c-type: unsigned long long
Example 4. Complete clock type object.
frequency: 8000000
offset:
  seconds: 1600463226
  cycles: 200000
origin-is-unix-epoch: false
precision: 8
uuid: 79e49040-21b5-42d4-a873-677261696e65
description: System clock
$c-type: uint64_t
Example 5. Clock type object with an inclusion.
$include: [base-clock-type.yaml]
frequency: 8000000