bt2: Add bindings for trace classes
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 8 May 2019 20:55:37 +0000 (16:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Jun 2019 21:24:21 +0000 (17:24 -0400)
commit0bee8ea9e637885efff12a157ff2116fb5f2f0cc
tree83728e5a8a85e8771c0ed1a8442d96c08b9f0f7a
parent69868f440d14cc5065b66cf1e89ee9e14843281e
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.026227 seconds and 4 git commands to generate.