From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte-Julien)
Subject: [lttng-dev] Python CTF writer example
Date: Tue, 17 Sep 2019 15:17:56 -0400 [thread overview]
Message-ID: <20190917191756.GD143064@joraj-alpa> (raw)
In-Reply-To: <CAC6yHM7iNtK7nt30mq2xeX5Z_K9nhEND6XP6jHS-s7dAJGkgZA@mail.gmail.com>
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
parent reply other threads:[~2019-09-17 19:17 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAC6yHM7iNtK7nt30mq2xeX5Z_K9nhEND6XP6jHS-s7dAJGkgZA@mail.gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190917191756.GD143064@joraj-alpa \
--to=jonathan.rajotte-julien@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox