[lttng-dev] python bindings for babel trace example fails

Jérémie Galarneau jeremie.galarneau at efficios.com
Tue Feb 3 09:59:56 EST 2015


Hi Yan,

The issue you are encountering on master seems related to what has been fixed by

commit 29d9d76c476cbf3fdf6fa709bfbdc24309974f06
Author: Jérémie Galarneau <jeremie.galarneau at efficios.com>
Date:   Wed Jan 28 16:52:28 2015 -0500

    Fix: lock stream class after assigning stream id

    Fixes a bug that was introduced by 2f100782 which made it possible
    to set custom stream class IDs.

    The stream class is frozen when a stream of its type is instanciated.
    However, the trace or writer must still assign a unique ID to the stream
    class if none were set prior. This modification moves the stream class
    locking (freeze) after the ID assignment check.

    Reported-by: Jiri Olsa <jolsa at redhat.com>
    Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>

Would you mind re-testing?

I'll have a look at the problem you experienced with the 1.2.4 release.

Thanks,
Jérémie


On Fri, Jan 23, 2015 at 11:00 AM, Yan Grange <ygrange at gmail.com> wrote:
> Good afternoon,
>
> I have been able to get lttng running on a machine and now would like to do some experiments with babeltrace. I’d like to write out a ctf file using babeltrace. Therefore I wanted to try out the babeltrace python bindings out and since you provide a set of examples, of which one is about writing a ctf, I wanted to try that one out.
>
> When I use the latste release of babeltrace (1.2.4), the library fails on the following line:
>
> print("Clock name is \"{}\"".format(clock.name))
>
> because it seems like the getter for clock.name doesn’t exist. to solve the issues I have with this example, I have checked out the most recent version of babeltrace from the git repo. If I run the ctf_writer using python, I get
>
> yan at paul ~/build_bbt/babeltrace/bindings/python/examples $ python3 ctf_writer.py
> Writing trace at /tmp/tmptlhq3i
> Clock name is "A_clock"
> Clock description is "Simple clock"
> Clock frequency is 1000000000
> Clock precision is 1
> Clock offset_seconds is 0
> Clock offset is 0
> Clock is absolute: False
> Clock time is 0
> Clock UUID is 874be90c-6c68-46ee-ac0d-6142cafe23f5
>
> Fields in default packet context:
> <class 'babeltrace.CTFWriter.IntegerFieldDeclaration'> timestamp_begin
> <class 'babeltrace.CTFWriter.IntegerFieldDeclaration'> timestamp_end
> <class 'babeltrace.CTFWriter.IntegerFieldDeclaration'> content_size
> <class 'babeltrace.CTFWriter.IntegerFieldDeclaration'> packet_size
> <class 'babeltrace.CTFWriter.IntegerFieldDeclaration'> events_discarded
> <babeltrace.CTFWriter.Writer object at 0x7f57058360d0>
> close: Bad file descriptor
> Traceback (most recent call last):
>   File "ctf_writer.py", line 130, in <module>
>     stream.append_event(event)
>   File "/usr/lib64/python3.3/site-packages/babeltrace.py", line 3462, in append_event
>     raise ValueError("Could not append event to stream.")
> ValueError: Could not append event to stream.
>
>
> Is this a reproducible issue? I am on a gentoo system (3.17.7), with python3 version Python 3.3.5 (default, Jan 14 2015, 19:01:12) [GCC 4.8.3] on linux
>
> For compilation, I used the following flags of the configure script:
>
> ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --libdir=/usr/lib64 --enable-glibtest --enable-python-bindings
>
> Is there anything I cold do to fix this?
>
> Regards,
>
> Yan Grange
>
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev



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



More information about the lttng-dev mailing list