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 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017
|
2025-07-22 Babeltrace 2.1.2 (National Hammock Day)
* src.ctf.fs: be less strict when encountering trailing byte at the end of packetized CTF 1.8 metadata
* tests: add bt_test_cli
* tests: make bt_cli accept non-positional options
* tests: bt_diff_cli: don't pass unexpected extra args to bt_diff
* tests: remove unnecessary nonlocal keywords
* Fix: Python: set local `typing` version to that of 3.5.2
* Fix: Python: missing __contains__ method for _PluginComponentClasses
* Fix: tests: Add explicit items method for Mapping compatibility
* Tests: sync normand.py with upstream
* Fix: tests: Add explicit __iter__ method for Iterator compatibility
* Fix: Use local_typing with Python < 3.5.3
* Update working version to Babeltrace v2.1.2
2025-04-14 Babeltrace 2.1.1 (Pecan Day)
* src.ctf.lttng-live: remove lttng_live_lazy_msg_init function
* src.ctf.lttng-live: fix comment formatting
* README.adoc: Update working version to 2.1
* fix: export bt_component_class_sink_simple_borrow
* fix: building from the release tarball without flex
* doc/api/libbabeltrace2: use `<code>` i.o. `<span>` in `<dt>`
* Fix: doc/api/libbabeltrace2/Doxyfile.in: set version to 2.1
* babeltrace2-sink.text.pretty(7): add missing default param. value
* Update working version to Babeltrace v2.1.1
# SPDX-FileCopyrightText: 2025 EfficiOS, Inc
#
# SPDX-License-Identifier: CC-BY-SA-4.0
2025-01-22 Babeltrace 2.1.0
Five years to the day [1] after launching Babeltrace 2.0 βAmquiβ, we're
releasing Babeltrace 2.1 βBrossardβ! π
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NOTE: An HTML version of those release notes is available here: β
β <https://babeltrace.org/docs/release-notes/babeltrace-2.1.0-release-notes.html>. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
BACKGROUND
ββββββββββ
The DiaMon Workgroup [2] worked on the CTF 2 specification [3] from 2016
until its publication in March 2024.
CTF 2 is a major revision of CTF 1.8 [4], bringing many improvements,
such as:
β’ Using JSON text sequences [5] for the metadata stream.
β’ Simplifying the metadata stream.
β’ Adding new field classes (bit array, bit map, boolean, LEB128 [6],
BLOB, and optional) and improving existing ones.
β’ Supporting UTF-16 and UTF-32 string fields.
β’ Using predefined roles instead of reserved structure member names to
identify meaningful fields.
β’ Adding the attribute and extension features to extend and customize
the format.
EfficiOS [7] is the primary organization driving the development of both
the LTTng [8] and Babeltrace projects. As of this date, the LTTng
project intends to add CTF 2 production support soon, potentially
enabling the addition of new features that aren't currently possible due
to the limitations of CTF 1.8. Consequently, it seemed important to us
that Babeltrace support this format and that it be released before any
tracer officially adopts CTF 2.
Although the visible impacts for CLI users are quite minimal, adding
CTF 2 support to the project required a significant amount of work on
the core library (libbabeltrace2) and, consequently, on all the
components of the project that depend on its C API, directly
or indirectly:
β’ The Python bindings API.
β’ All the official plugins, especially `ctf`.
β’ The command-line interface.
Of course, the documentation and testing of all those components were
also updated and improved.
WHAT'S NEW SINCE BABELTRACE 2.0?
ββββββββββββββββββββββββββββββββ
See babeltrace2-intro(7) [9] to learn more about Babeltrace 2.
The following subsections list the user-visible changes.
Library
βββββββ
β’ The most important change of libbabeltrace2 is the addition of a new
Message Interchange Protocol (MIP) [10].
libbabeltrace2 2.0 only offers MIP 0 which covers the message contents
you're used to since 2020. Starting from Babeltrace 2.1, _MIP 1_ is
available and adds many functions to support CTF 2 features. Moreover,
MIP 1 introduces some important new concepts to the clock class [11]
API, making some functions exclusive to either MIP 0 or MIP 1.
In summary, the specific MIP 1 changes are:
β£ Clock class [11], event class [12], stream class [13], and
trace [14] objects may have a namespace, a name, and a
unique ID (UID) [15].
The UUID property of clock class and trace objects is removed in
favor of the new UID property.
β£ Important parts of the clock class API are changed.
β£ A bit array field class [16] may have flags [17].
β£ An integer field class [18] may have field value hints [19].
β£ There are new BLOB field classes [20] and fields [21].
β£ The field location [22] system replaces the field path [23] one.
See the new βAdd MIP 1 support to your component classβ guide [24] to
learn more about all the changes brought by MIP 1.
β’ Your component class must implement the βget supported MIP versionsβ
method [25] to support MIP 1.
This method remains optional: without it, the component class
instances only support MIP 0.
β’ There are new MIP version access functions:
β£ bt_clock_class_get_graph_mip_version() [26]
β£ bt_field_class_get_graph_mip_version() [27]
β£ bt_trace_class_get_graph_mip_version() [28]
β£ bt_self_message_iterator_get_graph_mip_version() [29]
β’ The new bt_get_greatest_operative_mip_version_with_restriction() [30]
function is like the existing bt_get_greatest_operative_mip_version(),
but you may specify MIP version restrictions (a set of allowed MIP
version ranges).
Python bindings
βββββββββββββββ
The Python bindings wrap all the library changes in the same systematic
way as in Babeltrace 2.0.
More specifically:
β’ Add type hints to the public API to assist with static analysis of
your applications.
This is currently an ongoing effort, but we believe we've made
significant progress in this direction to improve application
code quality.
The new type hints also serve as typing documentation.
The `bt2` package has its own internal `typing` module to work with
Python 3.4 as the official `typing` module [31] was introduced in
Python 3.5.
β’ Add new names and functions to address naming inconsistencies:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¦ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Deprecated name/function β New name/function β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β `_DynamicArrayWithLengthFieldFieldClass` β `_DynamicArrayFieldClassWithLengthField` β
β `_DynamicArrayWithLengthFieldFieldClassConst` β `_DynamicArrayFieldClassWithLengthFieldConst` β
β `_OptionWithBoolSelectorFieldClass` β `_OptionFieldClassWithBoolSelectorField` β
β `_OptionWithBoolSelectorFieldClassConst` β `_OptionFieldClassWithBoolSelectorFieldConst` β
β `_OptionWithIntegerSelectorFieldClass` β `_OptionFieldClassWithIntegerSelectorField` β
β `_OptionWithIntegerSelectorFieldClassConst` β `_OptionFieldClassWithIntegerSelectorFieldConst` β
β `_OptionWithSelectorFieldClassConst` β `_OptionFieldClassWithSelectorField` β
β `_OptionWithSelectorFieldClassConst` β `_OptionFieldClassWithSelectorFieldConst` β
β `_OptionWithSignedIntegerSelectorFieldClass` β `_OptionFieldClassWithSignedIntegerSelectorField` β
β `_OptionWithSignedIntegerSelectorFieldClassConst` β `_OptionFieldClassWithSignedIntegerSelectorFieldConst` β
β `_OptionWithUnsignedIntegerSelectorFieldClass` β `_OptionFieldClassWithUnsignedIntegerSelectorField` β
β `_OptionWithUnsignedIntegerSelectorFieldClassConst` β `_OptionFieldClassWithUnsignedIntegerSelectorFieldConst` β
β `_TraceClass.create_option_with_bool_selector_field_class() β _TraceClass.create_option_field_class_with_bool_selector_field() β
β `_TraceClass.create_option_with_bool_selector_field_class() β _TraceClass.create_option_field_class_with_bool_selector_field() β
β `_TraceClass.create_option_with_integer_selector_field_class() β _TraceClass.create_option_field_class_with_integer_selector_field() β
β `_TraceClass.create_option_without_selector_field_class() β _TraceClass.create_option_field_class_without_selector_field() β
β `_VariantFieldClassWithIntegerSelector` β `_VariantFieldClassWithIntegerSelectorField` β
β `_VariantFieldClassWithIntegerSelectorConst` β `_VariantFieldClassWithIntegerSelectorFieldConst` β
β `_VariantFieldClassWithoutSelector` β `_VariantFieldClassWithoutSelectorField` β
β `_VariantFieldClassWithoutSelectorConst` β `_VariantFieldClassWithoutSelectorFieldConst` β
β `_VariantFieldClassWithSignedIntegerSelector` β `_VariantFieldClassWithSignedIntegerSelectorField` β
β `_VariantFieldClassWithSignedIntegerSelectorConst` β `_VariantFieldClassWithSignedIntegerSelectorFieldConst` β
β `_VariantFieldClassWithUnsignedIntegerSelector` β `_VariantFieldClassWithUnsignedIntegerSelectorField` β
β `_VariantFieldClassWithUnsignedIntegerSelectorConst` β `_VariantFieldClassWithUnsignedIntegerSelectorFieldConst` β
β `ClockOffset` β `ClockClassOffset` β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β’ Make some types which are useful for type hints public:
β£ `_ClockClass`
β£ `_ClockClassConst`
β£ `_DoublePrecisionRealFieldClass`
β£ `_DoublePrecisionRealFieldClassConst`
β£ `_DynamicArrayFieldWithLengthField`
β£ `_DynamicArrayFieldWithLengthFieldConst`
β£ `_EventClass`
β£ `_EventClassConst`
β£ `_Field`
β£ `_FieldClass`
β£ `_FieldClassConst`
β£ `_FieldConst`
β£ `_FieldPathConst`
β£ `_FieldPathConst`
β£ `_FieldPathItem`
β£ `_InputPortConst`
β£ `_ListenerHandle`
β£ `_MessageConst`
β£ `_MessageIteratorConfiguration`
β£ `_OptionFieldWithBoolSelectorField`
β£ `_OptionFieldWithBoolSelectorFieldConst`
β£ `_OptionFieldWithSignedIntegerSelectorField`
β£ `_OptionFieldWithSignedIntegerSelectorFieldConst`
β£ `_OptionFieldWithUnsignedIntegerSelectorField`
β£ `_OptionFieldWithUnsignedIntegerSelectorFieldConst`
β£ `_OutputPortConst`
β£ `_PluginSet`
β£ `_PrivateQueryExecutor`
β£ `_SignedEnumerationFieldClassMappingConst`
β£ `_SinglePrecisionRealFieldClass`
β£ `_SinglePrecisionRealFieldClassConst`
β£ `_Stream`
β£ `_Stream`
β£ `_StreamClass`
β£ `_StreamClassConst`
β£ `_StreamConst`
β£ `_StructureFieldClassMember`
β£ `_StructureFieldClassMemberConst`
β£ `_Trace`
β£ `_TraceClass`
β£ `_TraceClassConst`
β£ `_TraceConst`
β£ `_UnsignedEnumerationFieldClassMappingConst`
β£ `_UserComponentInputPort`
β£ `_UserComponentInputPortMessageIterator`
β£ `_UserComponentOutputPort`
β£ `_UserFilterComponentConfiguration`
β£ `_UserSinkComponentConfiguration`
β£ `_UserSourceComponentConfiguration`
β£ `_Value`
β£ `_ValueConst`
β£ `_VariantFieldClassOption`
β£ `_VariantFieldClassOptionConst`
β£ `_VariantFieldClassWithIntegerSelectorFieldOption`
β£ `_VariantFieldClassWithIntegerSelectorFieldOptionConst`
β£ `_VariantFieldClassWithSignedIntegerSelectorFieldOption`
β£ `_VariantFieldClassWithSignedIntegerSelectorFieldOptionConst`
β£ `_VariantFieldClassWithUnsignedIntegerSelectorFieldOption`
β£ `_VariantFieldClassWithUnsignedIntegerSelectorFieldOptionConst`
β£ `_VariantFieldWithSignedIntegerSelectorField`
β£ `_VariantFieldWithSignedIntegerSelectorFieldConst`
β£ `_VariantFieldWithUnsignedIntegerSelectorField`
β£ `_VariantFieldWithUnsignedIntegerSelectorFieldConst`
β’ Make some types inherit `enum.Enum`:
β£ `ComponentClassType`
β£ `EventClassLogLevel`
β£ `IntegerDisplayBase`
β£ `FieldPathScope`
β£ `LoggingLevel`
β’ Add a `members` parameter to
_TraceClass.create_structure_field_class() to be able to create a
complete structure field class at once.
Also make _StructureFieldClass.__iadd__() accept a tuple of three
elements, including optional member user attributes:
my_struct_fc = my_trace_cls.create_structure_field_class(members=[
('uid', my_trace_cls.create_string_field_class()),
('count', my_int_fc, {'context': 'bz.994', 'max': 2**16 - 1}),
('names', my_trace_cls.create_dynamic_array_field_class(
my_trace_cls.create_string_field_class())),
β’ Add an `options` parameter to _TraceClass.create_variant_field_class()
to be able to create a complete variant field class at once.
Also make the various __iadd__() methods of variant field class
classes accept a tuple of three elements, including optional option
user attributes:
my_var_fc = my_trace_cls.create_variant_field_class(options=[
('i8', my_trace_cls.create_signed_integer_field_class(8)),
('i16', my_trace_cls.create_signed_integer_field_class(16)),
('i24', my_trace_cls.create_signed_integer_field_class(24), {
'unorthodox': true,
}),
('i32', my_trace_cls.create_signed_integer_field_class(32)),
('i64', my_trace_cls.create_signed_integer_field_class(64)),
])
β’ Add a `mappings` parameter to
_TraceClass.create_unsigned_enumeration_field_class() and
_TraceClass.create_signed_enumeration_field_class() to be able to
create a complete enumeration field class at once:
my_enum_fc = my_trace_cls.create_unsigned_enumeration_field_class(32, mappings=[
('meow', bt2.UnsignedIntegerRangeSet([34])),
('mix', bt2.UnsignedIntegerRangeSet([(3, 17), (99, 101)])),
('π»ββοΈ', bt2.UnsignedIntegerRangeSet([(1, 2), 13])),
])
β’ Add the `graph_mip_version` property to the `_ClockClassConst`,
`_EventClassConst`, `_FieldConst`, `_FieldClassConst`,
`_StreamClassConst`, `_TraceConst`, and `_TraceClassConst` classes.
β’ Add MIP 1 support:
β£ Add the `namespace`, `name`, and `uid` read-only properties to the
`_ClockClassConst`, `_TraceConst`, `_StreamClassConst`, and
`_EventClassConst` classes.
Add the `namespace`, `name`, and `uid` parameters to the
_TraceClass.__call__(), _UserComponent._create_clock_class(),
_Trace.create_stream(), and _StreamClass.create_event_class()
methods.
β£ Make the `precision` parameter of
_UserComponent._create_clock_class() optional.
The `_ClockClassConst.precision` property may now return `None`.
β£ Add the `ClockOrigin` class, which you can instantiate directly to
make a custom clock origin.
The `unix_epoch_clock_origin` and `unknown_clock_origin` names are
two provided, well-known clock origins.
β£ Add the `_ClockClassConst.accuracy`,
`_ClockClassConst.origin_is_known`, and
`_ClockClassConst.origin` properties.
β£ Make the `_ClockClassConst.uuid` property and the `uuid` parameter
of _UserComponent._create_clock_class() exclusive to MIP 0.
β£ Add the `_FieldLocationConst` and `FieldLocationScope` classes to
wrap the field location API.
Create a new field location with _TraceClass.create_field_location().
Field class creation methods of the `_TraceClass` class which
accepted an optional length/selector field class parameter, except
for _TraceClass.create_variant_field_class(), now also accept a
length/selector field location parameter:
β _TraceClass.create_dynamic_array_field_class()
β _TraceClass.create_option_field_class_with_bool_selector_field()
β _TraceClass.create_option_field_class_with_unsigned_integer_selector_field()
β _TraceClass.create_option_field_class_with_signed_integer_selector_field()
Both parameters of a given method are mutually exclusive.
_TraceClass.create_variant_field_class() is now exclusive to MIP 0.
With MIP 1, use one of the following specific variant field class
creation methods:
β _TraceClass.create_variant_field_class_without_selector_field()
β _TraceClass.create_variant_field_class_with_unsigned_integer_selector_field()
β _TraceClass.create_variant_field_class_with_signed_integer_selector_field()
Make the
`_OptionFieldClassWithSelectorFieldConst.selector_field_path`,
`_VariantFieldClassWithIntegerSelectorFieldConst.selector_field_path`,
and `_DynamicArrayFieldClassWithLengthFieldConst.length_field_path`
properties exclusive to MIP 0.
Add the
`_OptionFieldClassWithSelectorFieldConst.selector_field_location`,
`_VariantFieldClassWithIntegerSelectorFieldConst.selector_field_location`,
and
`_DynamicArrayFieldClassWithLengthFieldConst.length_field_location`
read-only properties to access length/selector field locations.
β£ Add the `_BlobFieldClassConst`, `_BlobFieldClass`,
`_StaticBlobFieldClassConst`, `_StaticBlobFieldClass`,
`_DynamicBlobFieldClassConst`, `_DynamicBlobFieldClass`,
`_DynamicBlobFieldClassWithLengthFieldConst`,
`_DynamicBlobFieldClassWithLengthField` classes to wrap the BLOB
field class API.
Those are similar to their array field class equivalents, but the
only specific BLOB property is an optional IANA media type [32].
Create BLOB field classes with the
_TraceClass.create_static_blob_field_class() and
_TraceClass.create_dynamic_blob_field_class() methods.
β£ Add the `_BlobFieldConst`, `_BlobField`, `_StaticBlobFieldConst`,
`_StaticBlobField`, `_DynamicBlobFieldConst`, `_DynamicBlobField`,
`_DynamicBlobFieldWithLengthFieldConst`, and
`_DynamicBlobFieldWithLengthField` classes to wrap the BLOB
field API.
A BLOB field has a `data` property which returns a `memoryview` [33]
object and which you can set to an instance of `bytes`, `bytearray`,
or `memoryview`.
β£ Add the `_BitArrayFieldClassFlagConst` class to wrap the bit array
field class flag API.
`_BitArrayFieldClassFlagConst` is very similar
to `_UnsignedEnumerationFieldClassMappingConst`.
Add the _BitArrayFieldClassConst.__getitem__(),
_BitArrayFieldClassConst.__len__(), _BitArrayFieldClass.add_flag(),
and _BitArrayFieldClass.__iadd__() methods to access the optional
flags of a bit array field class.
β£ Add the `_BitArrayFieldConst.active_flag_labels` and
_BitArrayFieldClassConst.active_flags_for_value_as_integer()
utilities.
Those are similar to `_EnumerationFieldConst.labels`
and _EnumerationFieldClassConst.mappings_for_value().
β£ Make the `name` parameter of the append_option() method of the
various variant field class classes optional.
The `_VariantFieldClassOptionConst.name` property may now
return `None`.
Make _VariantFieldClassConst.__iter__() yield an index instead of an
option name with MIP 1.
Make the __getitem__() method of the various variant field class
classes accept an index instead of an option name with MIP 1.
Add the _VariantFieldClassConst.option_with_name() method to get an
option by name, or `None` if none.
β£ Make the `_TraceConst.uuid` property and the `uuid` parameter of
_TraceClass.__call__() exclusive to MIP 0.
Command-line interface
ββββββββββββββββββββββ
β’ Add the `--allowed-mip-versions` [34] option to the `run` [35] and
`convert` [36] commands.
This option makes the trace processing graph only honour a specific
version (0 or 1) of the Message Interchange Protocol (MIP) [10]
instead of allowing both versions.
The main purpose of this option is testing the implementation of
project plugins for specific MIP versions.
β’ Show the trace format when printing LTTng live sessions:
net://localhost:4859/host/salut/meow (timer = 100, 10 stream(s), 3 client(s) connected, CTF 1.8)
net://localhost:4859/host/salut/mix (timer = 10, 42 stream(s), 4 client(s) connected, CTF 2)
Plugins
βββββββ
This section shows noteworthy changes to the project plugins.
In general:
β’ The version of all the project plugins is now 2.0.0 instead of none.
For example, here's the output of `babeltrace2 help ctf`:
ctf:
Path: /usr/lib/babeltrace2/plugins/babeltrace-plugin-ctf.so
Version: 2.0.0
Description: CTF input and output
Author: EfficiOS <https://www.efficios.com/>
License: MIT
Source component classes: 2
Filter component classes: 0
Sink component classes: 1
This is useful for a user application which uses such a plugin to know
its features and default behaviour (see bt_plugin_get_version() [37]).
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NOTE: The plugin version is unrelated to the project version. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β’ Make all component classes support MIP 1, albeit sometimes
conditionally to the initialization parameters.
Component class specifics:
`source.ctf.fs`:
Add full CTF 2 support.
CTF 2 support is only available with MIP 1.
As such:
β’ Merge physical CTF 2 traces into a single logical one, to support
the LTTng recording session rotation feature [38], using the
namespace, name, and unique ID of traces (if available).
β’ Set the log level of a libbabeltrace2 event class from the value
of the `log-level` attribute, under either the `lttng.org,2009` or
`babeltrace.org,2020` namespace, of its corresponding CTF event
record class.
β’ Set the EMF URI of a libbabeltrace2 event class from the value of
the `emf-uri` attribute, under either the `lttng.org,2009` or
`babeltrace.org,2020` namespace, of its corresponding CTF event
record class.
β’ If the namespace NS, name NAME, and unique ID UID of the trace are
available, then the trace ID part of an output port name is:
{namespace: `NS`, name: `NAME`, uid: `UID`}
If the namespace of the trace isn't available, but the name NAME
and unique ID UID are, then it's:
{name: `NAME`, uid: `UID`}
Otherwise, it's the absolute directory path of the trace.
β’ For the `babeltrace.support-info` query object, if the namespace
NS, name NAME, and unique ID UID of the trace are available, then
the `group` property is:
namespace: NS, name: NAME, uid: UID
If the namespace of the trace isn't available, but the name NAME
and unique ID UID are, then it's:
name: NAME, uid: UID
Otherwise, the entry doesn't exist.
When reading a CTF 1.8 trace with MIP 1:
β’ For an LTTng trace:
β£ Set the namespace of any libbabeltrace2 trace
to `lttng.org,2009`.
β£ Set the origin of any libbabeltrace2 clock class to the
Unix epoch.
β’ If the UUID of a CTF trace is available, then set the UID of the
corresponding libbabeltrace2 trace to the textual representation
of the trace UUID and its name to an empty string.
β’ Set the UID of a libbabeltrace2 clock class to the textual
representation of the UUID of its corresponding CTF clock class,
if available.
β’ Make the accuracy of any libbabeltrace2 clock class unknown.
See babeltrace2-source.ctf.fs(7) [39] for more details.
`source.ctf.lttng-live`:
Add full CTF 2 support.
CTF 2 support is only available with MIP 1.
A `source.ctf.lttng-live` component can connect to an LTTng relay
daemon using the LTTng 2.4 or the upcoming LTTng 2.15 protocol. The
latter is required for CTF 2 support.
The βget supported MIP versionsβ method [25] always reports to
support MIP versions 0 and 1. If you attempt to make a
`source.ctf.lttng-live` component read a CTF 2 recording session
within a trace processing graph configured with MIP 0, then the
message iterator will fail at initialization or βnextβ method
call time.
For the `sessions` query object, add the `trace-format` property to
each map of the returned array. This property is either `ctf-1.8`
or `ctf-2.0`.
See babeltrace2-source.ctf.lttng-live(7) [40] for more details.
`sink.ctf.fs`:
Add full CTF 2 support.
CTF 2 support is only available with MIP 1, while CTF 1.8 support is
only available with MIP 0.
The new `ctf-version` initialization parameter controls the CTF
version of the resulting traces: `1` or `2` (the default starting
from Babeltrace 2.1).
With the `ctf-version` parameter set to `2`:
β’ The component sets the `sink.ctf.fs` attribute, under the
`babeltrace.org,2020` namespace, of the preamble fragment
to `true`.
β’ The structure member class names of packet context field classes
having a CTF 2 role have the metadata stream UUID as a prefix to
avoid clashes with user member classes.
For example, the packet content length member class could be
named `afe9ed0e-ce73-413f-8956-83663bab2047-content_size`.
β’ The component translates an event class log level to the
`log-level` attribute under the `babeltrace.org,2020` namespace.
β’ The component translates an event class EMF URI to the `emf-uri`
attribute under the `babeltrace.org,2020` namespace as a
JSON string.
β’ When the component needs to generate a length/selector
field class F for dynamic field classes _without_ a
length/selector field:
β£ The structure member name of F is unspecified.
β£ F contains the attribute `is-key-only`, under the
`babeltrace.org,2020` namespace, set to `true`.
β’ The component doesn't translate trace and stream user attributes:
a CTF 2 metadata stream has no way to represent them.
To write CTF 1.8 traces using the `babeltrace2` [41] CLI tool:
$ babeltrace2 /path/to/input --component=sink.ctf.fs \
--params='path="/path/to/output", ctf-version="1"'
See babeltrace2-sink.ctf.fs(7) [42] for more details.
`filter.utils.muxer`:
Improve performance by using a heap instead of an array to sort
messages by time.
Our own experiments show that this version is slightly more
efficient than the Babeltrace 2.0.6 one for a four-stream CTF trace
scenario, but the performance gain improves quickly as you add
streams (βRTβ means βrun timeβ; average of two runs):
βββββββββββ¦βββββββββββββββββββββ¦βββββββββββββββββββββ¦ββββββββββββββββββββββ
β Version β RT (4 streams) (s) β RT (8 streams) (s) β RT (40 streams) (s) β
β ββββββββββ¬βββββββββββββββββββββ¬βββββββββββββββββββββ¬ββββββββββββββββββββββ£
β 2.0.6 β 39.99 β 45.28 β 24.14 β
β 2.1.0 β 39.06 β 39.51 β 12.16 β
βββββββββββ©βββββββββββββββββββββ©βββββββββββββββββββββ©ββββββββββββββββββββββ
Thanks to the Argonne Leadership Computing Facility [43] for
sponsoring this feature! π
See babeltrace2-filter.utils.muxer(7) [44] for more details.
`sink.text.pretty`:
β’ Add the `print-enum-flags` boolean initialization parameter (false
by default).
This new parameter makes a `sink.text.pretty` component try to
print enumeration field values as a `|`-delimited list of bit
flags, if it applies.
When printing the value of an enumeration field _without any
corresponding mapping_, the component splits the value into its
individual bit values: if _each set bit_ has a corresponding
mapping, then it considers that those mappings are in fact
bit flags.
If a set bit has no corresponding mapping, then the component
prints `<unknown>`.
For example (`block_rq*` Linux kernel event record; structured
output to make it more readable):
[13:15:49.024354958] (+0.000003868) wilbrod block_rq_complete:
{ cpu_id = 4 },
{
dev = 8388624,
sector = 375490176,
nr_sector = 360,
error = 0,
rwbs = ( "RWBS_FLAG_READ" | "RWBS_FLAG_RAHEAD" : container = 12 )
}
This parameter is false by default to avoid any
unexpected behaviour.
To try this using the `babeltrace2` [41] CLI tool:
$ babeltrace2 /path/to/trace --component=sink.text.pretty \
--params=print-enum-flags=yes
Thanks to GeneviΓ¨ve Bastien for contributing this feature! π
β’ A `sink.text.pretty` component now prints a comma-delimited list
of _all_ the mapping labels of a given enumeration field value
within curly braces:
enum_field = ( { "bit0", "range1to3" } : container = 1 )
Thanks to GeneviΓ¨ve Bastien for this contribution! π
β’ Print the data of BLOB fields:
my-event: { my-blob = { 23 69 6e 63 6c 75 64 65 20 3c } }
See babeltrace2-sink.text.pretty(7) [45] for more details.
`sink.text.details`:
β’ Don't write the value of a trace environment entry or of a value
object when it's an empty string.
This is mostly to avoid trailing whitespaces in the output.
β’ Print field locations in a manner similar to field paths, except
structure field member names replace indexes:
Length field location [Event payload: walk, deep, surprise]
β’ Print BLOB field classes:
my-blob: Static BLOB (Length 32, Media type `application/mathematica`)
β’ Print BLOB fields:
my-blob: Static BLOB: Length 32:
44 6f 5b 50 72 69 6e 74 5b 22 48 65 6c 6c 6f 2c
20 57 6f 72 6c 64 22 5d 2c 20 7b 35 7d 5d 20 20
β’ Print namespace, name, and UID properties of traces, clock
classes, stream classes, and event classes:
Trace `radical` (Namespace `chrysler`, UID `imperial`):
Default clock class:
Namespace: lttng.org,2009
Name: monotonic
UID: boot-id:7d19f00b-f1c7-49ea-a0a1-5f1a6a062a29
Stream class `real` (Namespace `scion`, UID `tc`, ID 48):
Event class `genetic` (Namespace `manic`, UID `gt`, ID 334):
Add the `with-stream-class-namespace` and `with-uid` boolean
initialization parameters to control the visibility of stream
class namespaces and UIDs (both true by default).
β’ Print sorted bit array field class flags:
Bit array (8 flags):
Flags:
MAP_ANONYMOUS: [5]
MAP_DENYWRITE: [11]
MAP_FIXED: [4]
MAP_GROWSDOWN: [8]
MAP_NORESERVE: [6]
MAP_POPULATE: [15]
MAP_PRIVATE: [1]
MAP_SHARED: [0]
β’ Print new clock class properties: unknown precision, accuracy,
and origin.
Default clock class:
Namespace: lttng.org,2009
Name: monotonic
UID: boot-id:7d19f00b-f1c7-49ea-a0a1-5f1a6a062a29
User attributes:
lttng.org,2009:
tag: provigo
original-index: 4
Description: Monotonic Clock
Frequency (Hz): 1,000,000,000
Precision (cycles): 0
Accuracy (cycles): 1000
Offset from origin (s): 1,564,079,206
Offset from origin (cycles): 484,157,338
Origin:
Namespace: quebec.ca,2017
Name: referendum
UID: 1995
β’ Print the field value hints property of integer field classes:
Unsigned integer (64-bit, Base 10, Expect small values)
See babeltrace2-sink.text.details(7) [46] for more details.
FUTURE WORK
βββββββββββ
Without guaranteeing anything for Babeltrace 2.2, here are some
improvement ideas that often come up in our discussions:
β’ Make the plugin provider API public so that anyone may implement their
own libbabeltrace2 bindings.
Currently, there's an intimate relation between libbabeltrace2 and the
official Python bindings.
As of this date, a patch set [47], written by a generous external
contributor and which adds this feature, is already under review.
β’ Make it easier to create an efficient filter message iterator which
needs to modify or augment event messages.
Currently, if you need to modify an event message, considering that
you cannot change an event class once you use it, you need to create a
new event class, which means you also need to create a new stream
class and a new trace class. You also need to copy all the metadata
and data objects you don't alter. This is what
`filter.lttng-utils.debug-info` [48] does.
We do realize that trace-transforming filter message iterators
represent an important Babeltrace 2 use case. While it's possible to
write one for Babeltrace 2.1, it is cumbersome to do and the result is
not as efficient as we'd like.
β’ Add a filter component class to drop messages (like events) based on a
filter expression, similar to the `--filter` [49] option of the
`lttng enable-event` command.
β’ Optimize specific project component classes, especially
`source.ctf.fs` [39] and `source.ctf.lttng-live` [40].
For `source.ctf.fs`, implement the βseek ns from originβ method using
packet indexes to make a message iterator seek a specific time faster.
STATISTICS
ββββββββββ
Since Babeltrace 2.0.0:
Commits:
1438
Changed files:
1741
Diff:
227,712 insertions; 88,376 deletions
Significant contributors:
Simon Marchi, Philippe Proulx, Michael Jeanson,
Francis Deslauriers, Erica Bugden, JΓ©rΓ©mie Galarneau,
Mathieu Desnoyers, and Geneviève Bastien
Programming languages as of Babeltrace 2.1.0:
ββββββββββββββββ¦ββββββββββββββββββββββββββ
β Language β Effective lines of code β
β βββββββββββββββ¬ββββββββββββββββββββββββββ£
β C/C++ header β 50,437 β
β C β 84,504 β
β C++ β 78,620 β
β Python 3 β 12,035 β
ββββββββββββββββ©ββββββββββββββββββββββββββ
IMPORTANT LINKS
βββββββββββββββ
Babeltrace 2.1.0 tarball:
<https://www.efficios.com/files/babeltrace/babeltrace-2.1.0.tar.bz2>
Babeltrace website:
<https://babeltrace.org/>
Mailing list for support and development:
<https://lists.lttng.org/>
IRC channel:
`#lttng` on `irc.oftc.net`
Git repository:
<https://bugs.lttng.org/projects/babeltrace/>
GitHub project:
<https://github.com/efficios/babeltrace/>
Continuous integration:
<https://ci.lttng.org/view/Babeltrace/>
Code review:
<https://review.lttng.org/q/project:babeltrace>
REFERENCES
ββββββββββ
[1]: https://babeltrace.org/docs/release-notes/babeltrace-2.0.0-release-notes.html
[2]: https://diamon.org/
[3]: https://diamon.org/ctf/
[4]: https://diamon.org/ctf/v1.8.3/
[5]: https://datatracker.ietf.org/doc/html/rfc7464
[6]: https://en.wikipedia.org/wiki/LEB128
[7]: https://www.efficios.com/
[8]: https://lttng.org/
[9]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-intro.7
[10]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-intro.7/#doc-mip
[11]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-clock-cls.html
[12]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-ev-cls.html
[13]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-stream-cls.html
[14]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-trace.html
[15]: https://en.wikipedia.org/wiki/Unique_identifier
[16]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-fc.html#api-tir-fc-ba
[17]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-fc.html#api-tir-fc-ba-prop-flags
[18]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-fc.html#api-tir-fc-int
[19]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-fc.html#api-tir-fc-int-prop-hints
[20]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-fc.html#api-tir-fc-blob
[21]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-field.html#api-tir-field-blob
[22]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-field-loc.html
[23]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-field-path.html
[24]: https://babeltrace.org/docs/v2.1/libbabeltrace2/guide-mip-0-to-mip-1.html
[25]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-comp-cls-dev.html#api-comp-cls-dev-meth-mip
[26]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-clock-cls.html#ga8da11f39e67bab58848c71671c8192f0
[27]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-fc.html#ga3a3816edfcb31177574ddea4f456d657
[28]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-tir-trace-cls.html#gaedadf9f5626f5466b30653b47027d3ae
[29]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-self-msg-iter.html#gaa2767e72e6b86835898c9030884be77c
[30]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-msg.html#gab39e215853c38692cbc62a53d6107df9
[31]: https://docs.python.org/3/library/typing.html
[32]: https://datatracker.ietf.org/doc/html/rfc2046
[33]: https://docs.python.org/3/library/stdtypes.html#memoryview
[34]: https://babeltrace.org/docs/v2.1/man1/babeltrace2-run.1/#doc-opt--allowed-mip-versions
[35]: https://babeltrace.org/docs/v2.1/man1/babeltrace2-run.1/
[36]: https://babeltrace.org/docs/v2.1/man1/babeltrace2-convert.1/
[37]: https://babeltrace.org/docs/v2.1/libbabeltrace2/group__api-plugin.html#gacbb8a7f96cdb85e5f5361289a133c8c6
[38]: https://lttng.org/docs/v2.13/#doc-session-rotation
[39]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-source.ctf.fs.7
[40]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-source.ctf.lttng-live.7
[41]: https://babeltrace.org/docs/v2.1/man1/babeltrace2.1/
[42]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-sink.ctf.fs.7
[43]: https://www.alcf.anl.gov/
[44]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-filter.utils.muxer.7
[45]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-sink.text.pretty.7
[46]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-sink.text.details.7
[47]: https://review.lttng.org/c/babeltrace/+/11716/
[48]: https://babeltrace.org/docs/v2.1/man7/babeltrace2-filter.lttng-utils.debug-info.7
[49]: https://lttng.org/man/1/lttng-enable-event/v2.13/#doc-opt--filter
2024-12-19 Babeltrace 2.1.0-rc1 (National Oatmeal Muffin Day)
The main focus of Babeltrace 2.1 was to bring CTF 2 support to the project. This
required major changes across the C API, the Python API, all the official
plugins, the command-line interface, the documentation, as well as several
internal aspects, including the tests. This is because CTF 2 introduces new
concepts which are incompatible with the libbabeltrace 2.0 API, and then
this library is the foundation of all the other parts of the project.
2020-01-22 Babeltrace 2.0.0 (National Hot Sauce Day)
* cli: colorize version printing
* cli: print full version name
* lib: add bt_version_get_extra_{name,description,patch_names}
* lib: add bt_version_get_vcs_revision_description()
* common: support custom, extra information for build's version
* configure.ac, lib: rename "extra" (version) to "development stage"
* lib: add bt_version_get_name() and bt_version_get_name_description()
* lib: bt_version_get_extra(): return `NULL` if none instead of empty str.
* configure.ac: add version name/description definitions and report them
* Document libbabeltrace2's C API
* Fix: src.ctf.lttng-live: emitting stream end msg with no stream
* lib: msg. iter. inactivity message has a simple CS, not a default CS
* lib: remove self component param. from msg. iterator init. method
* lib: graph API: return borrowed references when adding to an object
* lib: plugin-dev.h: rename `MESSAGE_ITERATOR` -> `MESSAGE_ITERATOR_CLASS`
* lib: rename "self comp. input port message iter." -> "message iterator"
* lib: append `_FUNC` to `BT_PLUGIN_{INITIALIZE,FINALIZE}*`
* Replace `diamon.org/babeltrace` with `babeltrace.org`
* lib: create common base for bt_component_class_{source,filter}
* lib: introduce bt_message_iterator_class
* lib: run most of bt_self_component_port_input_message_iterator_try_finalize when iterator is in NON_INITIALIZED state
* tests: plug memory leak in test_bin_info
* debug-info: free existing build-id in bin_info_set_build_id
* cli: free log level string value
* bt2: free port user data when finalizing components
* build: try calling python-config with --embed
* tests: remove unnecessary message iterator classes
* tests: make test_sink_self_port_user_data actually test a sink
* lib: remove unnecessary (void *) cast in extend_map_element
* cli: fix bt_plugin leak when using `-i ctf`
* cli: remove unused structures and enums
* tests: fix test failure with msys2's Python 3.8.1-1 package
* trimmer: free GMatchInfo object in set_bound_from_str
* bt2: rename `object` parameter -> `object_name`
* lib: remove bt_query_executor_interrupt, add bt_query_executor_borrow_default_interrupter
* lib: remove bt_graph_interrupt, add bt_graph_borrow_default_interrupter
* lib: graph API: remove "listener removed" callback parameters
* lib, bt2: graph API: remove "ports connected" listeners
* babeltrace2-plugin-ctf(7): "theirs" -> "its" (single CTF trace)
* .gitignore: add missing `/tests/lib/test_remove_..._destruction_listener`
* Sync argpar with upstream
* Use argpar from upstream
* bt2: use format_bt_error and format_bt_error_cause to generate _Error and _ErrorCause string representations
* string-format: introduce function to format a bt_error_cause
* string-format: introduce function to format a bt_error
* string-format: introduce function to format component class name
* common: introduce struct bt_common_color_codes and function bt_common_color_get_codes
* lib: standardize variant field option function names
* bt2: don't print previous causes in causes created from bt2._Error
* bt2: reverse order of printed causes in _Error.__str__
* bt2: remove ptr parameter of _Error.__init__
* tests: add test for list-plugins CLI command
* tests: test removing a destruction listener from a destruction listener
* tests/lib/Makefile.am: Move libbabeltrace2-common and libbabeltrace2-logging to COMMON_TEST_LDADD
* bt2: make _ListenerHandle not hold a strong reference on the target object
* bt2: fix error message in trace_class.py
* bt2: make Graph add listener methods return None
* param-parse: allow duplicate map keys
* bt2: validate parameters to _StreamClass.create_event_class before creating the native object
* bt2: add invalid parameter type test for _UserComponent._create_trace_class
* src.ctf.fs: sort inputs paths
* cli: print error causes in all error paths
* tests: add missing backslash in tests/Makefile.am
* tests: test_auto_source_discovery_grouping: remove dir_sep variable
* tests: silence "variable/expression in single quote" shellcheck warnings
* tests: quote ${BT_CTF_TRACES_PATH} in test_trace_read and test_trace_copy
* tests: declare and assign variables separately in test_exit_status
* Make some bt_param_validation_map_value_entry_descr variables static
* src.ctf.fs: make ctf_fs_ds_group_medops symbol hidden
* ctf: make ctf scanner symbols hidden
* param-validation: make symbols hidden
* python-plugin-provider: make python_state static
* lib: add comments to exposed but internal symbols
* lib: add comment to bt_plugin_so_create_all_from_static
* lib: make bt_object_pool symbols hidden
* lib: make symbols in prio-head hidden
* tests: add CLI query tests
* param-parse: use g_string_append_c instead of g_string_append_printf
* lib: remove bt_packet_context_field API
* ctf: make msg-iter not use bt_packet_context_field
* ctf: remove ctf_msg_iter::set_stream
* src.ctf.fs: fix typo in comment
* lib: mark bt_common_assert_failed as hidden
|