Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] Python CTF writer example
       [not found] <CAC6yHM7iNtK7nt30mq2xeX5Z_K9nhEND6XP6jHS-s7dAJGkgZA@mail.gmail.com>
@ 2019-09-17 19:17 ` Jonathan Rajotte-Julien
  0 siblings, 0 replies; only message in thread
From: Jonathan Rajotte-Julien @ 2019-09-17 19:17 UTC (permalink / raw)


Hi,

On Fri, Sep 13, 2019 at 07:03:59PM -0400, Francis Giraldeau wrote:
> Hello!
> 
> It looks like there are some issues with the Python CTF writer example with
> babeltrace stable-1.5.

I will infer that you are looking at this doc:

  https://diamon.org/babeltrace/docs/python/examples/#ctf-writer-api-examples

This doc is currently outdated(invalid). We are in the process of
revamping it/removing it.

If you need an example for bt 1.5 use:

  https://github.com/efficios/babeltrace/blob/stable-1.5/bindings/python/babeltrace/examples/ctf_writer.py

This example works as expected.

> 
> * Import error, should replace "import babeltrace.writer as btw" by "from
> babeltrace import CTFWriter as btw"
> * The FloatingPointDeclaration does not exists and should be replaced
> by FloatFieldDeclaration
> * babeltrace.common.CTFStringEncoding.UTF8 is
> instead babeltrace.CTFStringEncoding.UTF8
> * The variant still had issue that I cannot fix (ValueError("Invalid tag
> provided.") babeltrace.py:2221)

If you still wish to follow the documentation, please make sure to read the
green notice here:
  https://diamon.org/babeltrace/docs/python/examples/#examples

> 
> Events with simple fields are working okay with these changes. I thought
> that the clock would be updated automatically when appending the event, but
> that would be nice also to add it to the example.
> 
> I tried babeltrace 2.0.0-pre6, but the writer API seems to have
> disappeared. I was looking at how to create a ctf.fs.sink, but I was not
> successful. Is writing CTF traces with the Python bindings still possible?

The ctf-writer capability are not part of the bindings anymore.
 https://review.lttng.org/c/babeltrace/+/1392

What can be done is writing a source plugin using the bindings and use a ctf
sink on the cli to generate a ctf trace.

A quick source plugin: http://paste.ubuntu.com/p/8CBqTt8cSj/

Note that babeltrace 1.5 and babeltrace 2 can coexist on the same system.
Allowing you to still use the bindings from bt1.5 to generate traces.

I recommend that you stick with the babeltrace 1.5 bindings (import babeltrace).

Cheers

-- 
Jonathan Rajotte-Julien
EfficiOS


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-17 19:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAC6yHM7iNtK7nt30mq2xeX5Z_K9nhEND6XP6jHS-s7dAJGkgZA@mail.gmail.com>
2019-09-17 19:17 ` [lttng-dev] Python CTF writer example Jonathan Rajotte-Julien

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox