python: reimplement the babeltrace package as a bt2 wrapper
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Aug 2017 20:01:57 +0000 (16:01 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 17 Sep 2017 17:58:06 +0000 (13:58 -0400)
commitc72a561f585859b74c6b0e4729fd51e552a6eac2
tree5c8c1af9c0db9a0319a19154907b36353641ef9a
parent4505828d9db11ccb309768b611686816ffab3025
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:
bindings/python/Makefile.am
bindings/python/babeltrace/Makefile.am
bindings/python/babeltrace/__init__.py.in [deleted file]
bindings/python/babeltrace/babeltrace/__init__.py.in [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/common.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/reader.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/reader_event.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/reader_event_declaration.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/reader_field_declaration.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/reader_field_definition.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/reader_trace_collection.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/reader_trace_handle.py [new file with mode: 0644]
bindings/python/babeltrace/babeltrace/writer.py [new file with mode: 0644]
bindings/python/babeltrace/common.py [deleted file]
bindings/python/babeltrace/reader.py [deleted file]
bindings/python/babeltrace/setup.py.in [new file with mode: 0644]
bindings/python/babeltrace/writer.py [deleted file]
configure.ac
This page took 0.025783 seconds and 4 git commands to generate.