bt2: Add bindings for trace classes
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 8 May 2019 20:55:37 +0000 (16:55 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 5 Jun 2019 17:47:34 +0000 (13:47 -0400)
commitfbbe93021d7cd3793003911931bb3abd5e69596a
treed300a31f3a29426867230a72a73343fbc5dac693
parentc47a6bece6786574f9241c836f98571026dacedf
bt2: Add bindings for trace classes

This patch adds a Python wrapper for the bt_trace_class concept.

Trace classes in Python are created using the _create_trace_class on a
_UserComponent.

A TraceClass is seen as a mapping of stream class ids to stream classes.
This means that with trace class `tc`, it's possible to access its
stream classes by id using `tc[id]`.  It's also possible to iterate on
`tc` to iterate on stream class ids.

A brand new test is also added, along with some test utils that should
be useful in future tests as well.

It is not feature-complete yet, for example there is no way to
instantiate a trace using this trace class, this will come in a
subsequent patch (that will handle test_trace.py).  It is possible to
create stream classes in a trace class, but not with every possible
option, just enough to support the trace class tests.

Change-Id: Ib9f29d7ebc21b6ade19e9ffbad3f4b85e790321d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1283
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
bindings/python/bt2/Makefile.am
bindings/python/bt2/bt2/__init__.py.in
bindings/python/bt2/bt2/component.py
bindings/python/bt2/bt2/native_bt_trace_class.i
bindings/python/bt2/bt2/stream_class.py
bindings/python/bt2/bt2/trace_class.py [new file with mode: 0644]
tests/bindings/python/bt2/test_trace_class.py [new file with mode: 0644]
tests/bindings/python/bt2/utils.py [new file with mode: 0644]
This page took 0.025733 seconds and 4 git commands to generate.