All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Python Babeltrace - Write multiple streams
       [not found] <CAK-w0Ddnf5TXJfmv=scZ0j6DJ0+PNbPOynKpahN8t1qVDqy=ug@mail.gmail.com>
@ 2015-11-10 15:12 ` Jérémie Galarneau
       [not found] ` <CA+jJMxvv3OV76yzAs2JZrFaop4ZRSwYpgn8n_YqKeJDsrM8opw@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Jérémie Galarneau @ 2015-11-10 15:12 UTC (permalink / raw)
  To: Rocky Dunlap; +Cc: lttng-dev

Hi Rocky,

The code looks good at first glance. Can you try with master and see
if that might be problem that has been fixed since then?

Thanks,
Jérémie

On Fri, Nov 6, 2015 at 9:40 PM, Rocky Dunlap <rsdunlapiv@gmail.com> wrote:
> Using the Babletrace Python binding version 1.3, I adapted a simple example
> to try to write a trace with two streams.  It appears to write okay (no
> errors), but when I attempt to read it back (again using Babeltrace) I get
> an error:
>
> [error] Stream 1 is not declared in metadata.
> [error] Stream index creation error.
> [error] Open file stream error.
> [warning] [Context] Cannot open_trace of format ctf at path ./trace.
>
> Here is my code to write the streams:
>
> ################################
>
> from babeltrace import *
>
> trace_path = "./trace"
>
> print('trace path: {}'.format(trace_path))
>
> writer = CTFWriter.Writer(trace_path)
>
> clock = CTFWriter.Clock('my_clock')
> clock.description = 'this is my clock'
> writer.add_clock(clock)
>
> stream_class = CTFWriter.StreamClass('my_stream')
> stream_class.clock = clock
>
> event_class = CTFWriter.EventClass('my_event')
>
> int32_field_decl = CTFWriter.IntegerFieldDeclaration(32)
> int32_field_decl.signed = True
>
> event_class.add_field(int32_field_decl, 'my_field')
>
> stream_class.add_event_class(event_class)
>
> stream = writer.create_stream(stream_class)
> stream2 = writer.create_stream(stream_class)
>
> event = CTFWriter.Event(event_class)
> event.payload('my_field').value = -23
> stream.append_event(event)
>
> event = CTFWriter.Event(event_class)
> event.payload('my_field').value = -89
> stream.append_event(event)
>
> event = CTFWriter.Event(event_class)
> event.payload('my_field').value = -849
> stream2.append_event(event)
>
> event = CTFWriter.Event(event_class)
> event.payload('my_field').value = 42
> stream2.append_event(event)
>
> stream.flush()
> stream2.flush()
>
> ######################
>
> I am sure I am just not quite using the API correctly.  If you can spot the
> error, please let me know.  Also, if anyone can point me to an example of
> using the python bindings to write out multiple streams, I would appreciate
> it.
>
> Thanks!
> Rocky
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

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

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

* Re: Python Babeltrace - Write multiple streams
       [not found] ` <CA+jJMxvv3OV76yzAs2JZrFaop4ZRSwYpgn8n_YqKeJDsrM8opw@mail.gmail.com>
@ 2015-11-10 16:37   ` Rocky Dunlap
       [not found]   ` <CAK-w0DcPucjp6Fjnf04gtDDEFJGwGKKSmCbhny2EaQsv=0VT2w@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Rocky Dunlap @ 2015-11-10 16:37 UTC (permalink / raw)
  To: Jérémie Galarneau; +Cc: lttng-dev


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

Jérémie,

Fantastic - it works using the master branch. Will there be a new tag
anytime soon?

Thanks,
Rocky

On Tue, Nov 10, 2015 at 8:12 AM, Jérémie Galarneau <
jeremie.galarneau@efficios.com> wrote:

> Hi Rocky,
>
> The code looks good at first glance. Can you try with master and see
> if that might be problem that has been fixed since then?
>
> Thanks,
> Jérémie
>
> On Fri, Nov 6, 2015 at 9:40 PM, Rocky Dunlap <rsdunlapiv@gmail.com> wrote:
> > Using the Babletrace Python binding version 1.3, I adapted a simple
> example
> > to try to write a trace with two streams.  It appears to write okay (no
> > errors), but when I attempt to read it back (again using Babeltrace) I
> get
> > an error:
> >
> > [error] Stream 1 is not declared in metadata.
> > [error] Stream index creation error.
> > [error] Open file stream error.
> > [warning] [Context] Cannot open_trace of format ctf at path ./trace.
> >
> > Here is my code to write the streams:
> >
> > ################################
> >
> > from babeltrace import *
> >
> > trace_path = "./trace"
> >
> > print('trace path: {}'.format(trace_path))
> >
> > writer = CTFWriter.Writer(trace_path)
> >
> > clock = CTFWriter.Clock('my_clock')
> > clock.description = 'this is my clock'
> > writer.add_clock(clock)
> >
> > stream_class = CTFWriter.StreamClass('my_stream')
> > stream_class.clock = clock
> >
> > event_class = CTFWriter.EventClass('my_event')
> >
> > int32_field_decl = CTFWriter.IntegerFieldDeclaration(32)
> > int32_field_decl.signed = True
> >
> > event_class.add_field(int32_field_decl, 'my_field')
> >
> > stream_class.add_event_class(event_class)
> >
> > stream = writer.create_stream(stream_class)
> > stream2 = writer.create_stream(stream_class)
> >
> > event = CTFWriter.Event(event_class)
> > event.payload('my_field').value = -23
> > stream.append_event(event)
> >
> > event = CTFWriter.Event(event_class)
> > event.payload('my_field').value = -89
> > stream.append_event(event)
> >
> > event = CTFWriter.Event(event_class)
> > event.payload('my_field').value = -849
> > stream2.append_event(event)
> >
> > event = CTFWriter.Event(event_class)
> > event.payload('my_field').value = 42
> > stream2.append_event(event)
> >
> > stream.flush()
> > stream2.flush()
> >
> > ######################
> >
> > I am sure I am just not quite using the API correctly.  If you can spot
> the
> > error, please let me know.  Also, if anyone can point me to an example of
> > using the python bindings to write out multiple streams, I would
> appreciate
> > it.
> >
> > Thanks!
> > Rocky
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>
>
>
> --
> Jérémie Galarneau
> EfficiOS Inc.
> http://www.efficios.com
>

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

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

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

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

* Re: Python Babeltrace - Write multiple streams
       [not found]   ` <CAK-w0DcPucjp6Fjnf04gtDDEFJGwGKKSmCbhny2EaQsv=0VT2w@mail.gmail.com>
@ 2015-11-10 17:49     ` Jérémie Galarneau
  0 siblings, 0 replies; 4+ messages in thread
From: Jérémie Galarneau @ 2015-11-10 17:49 UTC (permalink / raw)
  To: Rocky Dunlap; +Cc: lttng-dev

On Tue, Nov 10, 2015 at 11:37 AM, Rocky Dunlap <rsdunlapiv@gmail.com> wrote:
> Jérémie,
>
> Fantastic - it works using the master branch. Will there be a new tag
> anytime soon?
>

I will try to backport the fix from master today or tomorrow.
Following that, I think a new tag will be in order :)

Thanks for the quick testing!
Jérémie

> Thanks,
> Rocky
>
> On Tue, Nov 10, 2015 at 8:12 AM, Jérémie Galarneau
> <jeremie.galarneau@efficios.com> wrote:
>>
>> Hi Rocky,
>>
>> The code looks good at first glance. Can you try with master and see
>> if that might be problem that has been fixed since then?
>>
>> Thanks,
>> Jérémie
>>
>> On Fri, Nov 6, 2015 at 9:40 PM, Rocky Dunlap <rsdunlapiv@gmail.com> wrote:
>> > Using the Babletrace Python binding version 1.3, I adapted a simple
>> > example
>> > to try to write a trace with two streams.  It appears to write okay (no
>> > errors), but when I attempt to read it back (again using Babeltrace) I
>> > get
>> > an error:
>> >
>> > [error] Stream 1 is not declared in metadata.
>> > [error] Stream index creation error.
>> > [error] Open file stream error.
>> > [warning] [Context] Cannot open_trace of format ctf at path ./trace.
>> >
>> > Here is my code to write the streams:
>> >
>> > ################################
>> >
>> > from babeltrace import *
>> >
>> > trace_path = "./trace"
>> >
>> > print('trace path: {}'.format(trace_path))
>> >
>> > writer = CTFWriter.Writer(trace_path)
>> >
>> > clock = CTFWriter.Clock('my_clock')
>> > clock.description = 'this is my clock'
>> > writer.add_clock(clock)
>> >
>> > stream_class = CTFWriter.StreamClass('my_stream')
>> > stream_class.clock = clock
>> >
>> > event_class = CTFWriter.EventClass('my_event')
>> >
>> > int32_field_decl = CTFWriter.IntegerFieldDeclaration(32)
>> > int32_field_decl.signed = True
>> >
>> > event_class.add_field(int32_field_decl, 'my_field')
>> >
>> > stream_class.add_event_class(event_class)
>> >
>> > stream = writer.create_stream(stream_class)
>> > stream2 = writer.create_stream(stream_class)
>> >
>> > event = CTFWriter.Event(event_class)
>> > event.payload('my_field').value = -23
>> > stream.append_event(event)
>> >
>> > event = CTFWriter.Event(event_class)
>> > event.payload('my_field').value = -89
>> > stream.append_event(event)
>> >
>> > event = CTFWriter.Event(event_class)
>> > event.payload('my_field').value = -849
>> > stream2.append_event(event)
>> >
>> > event = CTFWriter.Event(event_class)
>> > event.payload('my_field').value = 42
>> > stream2.append_event(event)
>> >
>> > stream.flush()
>> > stream2.flush()
>> >
>> > ######################
>> >
>> > I am sure I am just not quite using the API correctly.  If you can spot
>> > the
>> > error, please let me know.  Also, if anyone can point me to an example
>> > of
>> > using the python bindings to write out multiple streams, I would
>> > appreciate
>> > it.
>> >
>> > Thanks!
>> > Rocky
>> >
>> > _______________________________________________
>> > lttng-dev mailing list
>> > lttng-dev@lists.lttng.org
>> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>> >
>>
>>
>>
>> --
>> Jérémie Galarneau
>> EfficiOS Inc.
>> http://www.efficios.com
>
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

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

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

* Python Babeltrace - Write multiple streams
@ 2015-11-07  2:40 Rocky Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Rocky Dunlap @ 2015-11-07  2:40 UTC (permalink / raw)
  To: lttng-dev


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

Using the Babletrace Python binding version 1.3, I adapted a simple example
to try to write a trace with two streams.  It appears to write okay (no
errors), but when I attempt to read it back (again using Babeltrace) I get
an error:

[error] Stream 1 is not declared in metadata.
[error] Stream index creation error.
[error] Open file stream error.
[warning] [Context] Cannot open_trace of format ctf at path ./trace.

Here is my code to write the streams:

################################

from babeltrace import *

trace_path = "./trace"

print('trace path: {}'.format(trace_path))

writer = CTFWriter.Writer(trace_path)

clock = CTFWriter.Clock('my_clock')
clock.description = 'this is my clock'
writer.add_clock(clock)

stream_class = CTFWriter.StreamClass('my_stream')
stream_class.clock = clock

event_class = CTFWriter.EventClass('my_event')

int32_field_decl = CTFWriter.IntegerFieldDeclaration(32)
int32_field_decl.signed = True

event_class.add_field(int32_field_decl, 'my_field')

stream_class.add_event_class(event_class)

stream = writer.create_stream(stream_class)
stream2 = writer.create_stream(stream_class)

event = CTFWriter.Event(event_class)
event.payload('my_field').value = -23
stream.append_event(event)

event = CTFWriter.Event(event_class)
event.payload('my_field').value = -89
stream.append_event(event)

event = CTFWriter.Event(event_class)
event.payload('my_field').value = -849
stream2.append_event(event)

event = CTFWriter.Event(event_class)
event.payload('my_field').value = 42
stream2.append_event(event)

stream.flush()
stream2.flush()

######################

I am sure I am just not quite using the API correctly.  If you can spot the
error, please let me know.  Also, if anyone can point me to an example of
using the python bindings to write out multiple streams, I would appreciate
it.

Thanks!
Rocky

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

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

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

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

end of thread, other threads:[~2015-11-10 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAK-w0Ddnf5TXJfmv=scZ0j6DJ0+PNbPOynKpahN8t1qVDqy=ug@mail.gmail.com>
2015-11-10 15:12 ` Python Babeltrace - Write multiple streams Jérémie Galarneau
     [not found] ` <CA+jJMxvv3OV76yzAs2JZrFaop4ZRSwYpgn8n_YqKeJDsrM8opw@mail.gmail.com>
2015-11-10 16:37   ` Rocky Dunlap
     [not found]   ` <CAK-w0DcPucjp6Fjnf04gtDDEFJGwGKKSmCbhny2EaQsv=0VT2w@mail.gmail.com>
2015-11-10 17:49     ` Jérémie Galarneau
2015-11-07  2:40 Rocky Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.