import babeltrace.common as common
import bt2
+
class EnumerationMapping:
"""
Mapping from an enumeration label to a range of integers.
@offset_seconds.setter
def offset_seconds(self, offset_s):
try:
- self._clock.offset = bt2.ClockClassOffet(offset_s,
- self._clock.offset.cycles)
+ self._clock.offset = bt2.ClockClassOffset(offset_s,
+ self._clock.offset.cycles)
except:
raise ValueError("Invalid offset value.")
@offset.setter
def offset(self, offset):
try:
- self._clock.offset = bt2.ClockClassOffet(
- self._clock.offset.seconds, offset)
+ self._clock.offset = bt2.ClockClassOffset(self._clock.offset.seconds,
+ offset)
except:
raise ValueError("Invalid offset value.")
common.CTFStringEncoding.UTF8: bt2.Encoding.UTF8,
}
+
class FieldDeclaration:
"""
Base class of all field declarations. This class is not meant to
"""
try:
- self._field_type.append_mapping(name, range_start, range_end)
+ self._field_type.add_mapping(name, range_start, range_end)
except:
raise ValueError(
"Could not add mapping to enumeration declaration.")
raise TypeError(
"Could not get Floating point exponent digit count")
-
@exponent_digits.setter
def exponent_digits(self, exponent_digits):
try:
raise TypeError(
"Could not get Floating point mantissa digit count")
-
@mantissa_digits.setter
def mantissa_digits(self, mantissa_digits):
try:
raise TypeError("Invalid tag type; must be of type EnumerationFieldDeclaration.")
self._field_type = bt2.VariantFieldType(tag_name=tag_name,
- tag_field_type=enum_tag._field_type)
+ tag_field_type=enum_tag._field_type)
super().__init__()
@property
except:
raise ValueError("Invalid stream context field.")
+
class StreamClass:
"""
A stream class contains the properties of specific
try:
# Set default event header and packet context.
event_header_type = bt2.StructureFieldType()
- uint32_ft = bt2.IntegerFieldType(32, is_signed=False)
- uint64_ft = bt2.IntegerFieldType(32, is_signed=False)
+ uint32_ft = bt2.IntegerFieldType(32)
+ uint64_ft = bt2.IntegerFieldType(64)
event_header_type.append_field('id', uint32_ft)
event_header_type.append_field('timestamp', uint64_ft)
raise TypeError("Value type is not supported.")
try:
- self._w.trace.env += {name: value}
+ self._w.trace.env[name] = value
except:
raise ValueError("Could not add environment field to trace.")