lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* [lttng-dev] sink.ctf.fs vs bt_ctf_writer
@ 2020-08-24 21:21 Michael Gruner via lttng-dev
  2020-08-24 22:33 ` Philippe Proulx via lttng-dev
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Gruner via lttng-dev @ 2020-08-24 21:21 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 1135 bytes --]

Hi all

I’m integrating CTF support to a third party framework. To do so, I decided to go with the Babeltrace 2 API (I love the rewrite BTW). So basically I made my custom plug-in and the framework spawns the following processing graph:

My Framework ->  SOURCE.MYPLUGIN.MYCOMPONENT -> SINK.CTF.FS

This effectively generates a valid set of CTF traces. However, when exploring the Babeltrace2 source I found the existence of a bt_ctf_writer, which seems like a convenience object to write CTF directly (without the need of the graph). This would’ve been a much simpler approach for my use case, so I’m evaluating to rewrite using bt_ctf_writer in favor of simplicity and maintainability. My questions are:

Should bt_ctf_writer be used? 
bt_ctf_writer is not documented, is it because is being deprecated?
Seems like sink.ctf.fs performs the trace and metadata write back to disk when it receives the end message, whereas with bt_ctf_writer I can manually flush them (which is very convenient to me). Is there a way to achieve this using the graph?

Thanks!
Michael
www.ridgerun.com <http://www.ridgerun.com/>



[-- Attachment #1.2: Type: text/html, Size: 1842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [lttng-dev] sink.ctf.fs vs bt_ctf_writer
  2020-08-24 21:21 [lttng-dev] sink.ctf.fs vs bt_ctf_writer Michael Gruner via lttng-dev
@ 2020-08-24 22:33 ` Philippe Proulx via lttng-dev
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Proulx via lttng-dev @ 2020-08-24 22:33 UTC (permalink / raw)
  To: Michael Gruner; +Cc: lttng-dev

Philippe Proulx

On Mon, Aug 24, 2020 at 5:41 PM Michael Gruner via lttng-dev
<lttng-dev@lists.lttng.org> wrote:
>
> Hi all
>
> I’m integrating CTF support to a third party framework. To do so, I decided to go with the Babeltrace 2 API (I love the rewrite BTW).

Thank you.

> So basically I made my custom plug-in and the framework spawns the following processing graph:
>
> My Framework ->  SOURCE.MYPLUGIN.MYCOMPONENT -> SINK.CTF.FS
>
> This effectively generates a valid set of CTF traces. However, when exploring the Babeltrace2 source I found the existence of a bt_ctf_writer, which seems like a convenience object to write CTF directly (without the need of the graph). This would’ve been a much simpler approach for my use case, so I’m evaluating to rewrite using bt_ctf_writer in favor of simplicity and maintainability. My questions are:
>
> Should bt_ctf_writer be used?

You can use it.

Should you use it? The project doesn't recommend it.

See
<https://babeltrace.org/docs/release-notes/babeltrace-2.0.0-release-notes.html#_background>
which mentions CTF writer.

The Babeltrace 2 CTF writer API exists for backward compatibility
reasons, to make users of BT 1's CTF writer migrate to BT 2 more easily.

However, it's not a part of the project on which we plan to put efforts
in the future. For example, when CTF 2 is released, `sink.ctf.fs` will
support producing it, but `bt_ctf_writer` probably won't.

This is also why we didn't craft Python 3 bindings for the BT 2 CTF
writer API.

> bt_ctf_writer is not documented, is it because is being deprecated?

... and this is also why we didn't document it.

The project's position is to encourage the creation of reusable
component classes (what you did so far).

> Seems like sink.ctf.fs performs the trace and metadata write back to disk when it receives the end message, whereas with bt_ctf_writer I can manually flush them (which is very convenient to me). Is there a way to achieve this using the graph?

Which "end message"?

Currently, both `sink.ctf.fs` and CTF writer use the same internal CTF
serialization API which uses an automatically growing memory map to
write data to the file system.

What's your use case here exactly?

BR,

Phil

>
>
> Thanks!
> Michael
> www.ridgerun.com
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-24 22:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 21:21 [lttng-dev] sink.ctf.fs vs bt_ctf_writer Michael Gruner via lttng-dev
2020-08-24 22:33 ` Philippe Proulx via lttng-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).