python: reimplement the babeltrace package as a bt2 wrapper
This is how the old bindings work with the new bindings:
* A `babeltrace.TraceCollection` contains a set of
`babeltrace.TraceHandle`, each of which only contains a CTF trace path
and a generated ID, unique within the trace collection.
* When you call `babeltrace.TraceCollection.add_trace()`, the function
makes sure that you're adding a single CTF trace. It creates a trace
handle, adds it to the trace collection's set, and returns it.
* When you call `babeltrace.TraceCollection.remove_trace()`, the
function removes the given trace handle from the trace collection's
set.
* The `timestamp_begin()`, `timestamp_end()`, and `_has_intersection()`
methods of `babeltrace.TraceHandle` perform the `trace-info` query
with their path to retrieve the information.
* The `babeltrace.TraceHandle.events` property creates a `bt2` trace
collection notification iterator, gets the first notification of the
trace (which is expected to be a stream beginning notification), and
finds the CTF IR trace object to generate all the event declarations
from event classes using
`babeltrace.reader_event_declaration._create_event_declaration()`.
* The `babeltrace.TraceCollection.events` property creates a `bt2` trace
collection notification iterator, in stream intersection mode if
needed, and with a beginning and end time if needed, and generates
event objects using `babeltrace.reader_event._create_event()`.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
18 files changed:
This page took 0.03013 seconds and 4 git commands to generate.