[lttng-dev] babletrace with python bindings

Danny Serres serres at live.ca
Wed Dec 19 17:35:58 EST 2012


On 12-12-19 05:30 PM, Danny Serres wrote:
> On 12-12-19 01:39 PM, Mathieu Desnoyers wrote:
>> * ajonwa ajonwa (ajonwa at gmx.com) wrote:
>>> Hello everyone,
>>>
>>>   I get the following error message while attempting to compile 
>>> babeltrace with python bindings:
>>>
>>>   CC _babeltrace_la-babeltrace_wrap.lo
>>> babeltrace_wrap.c: In function '_wrap__bt_ctf_field_type':
>>> babeltrace_wrap.c:4621:56: warning: passing argument 1 of 
>>> 'bt_ctf_field_type' from incompatible pointer type [enabled by default]
>>> ../../include/babeltrace/ctf/events.h:158:18: note: expected 'const 
>>> struct declaration *' but argument is of type 'const struct 
>>> definition *'
>>> babeltrace_wrap.c: In function '_wrap__bt_ctf_get_int_signedness':
>>> babeltrace_wrap.c:4643:51: warning: passing argument 1 of 
>>> 'bt_ctf_get_int_signedness' from incompatible pointer type [enabled 
>>> by default]
>>> ../../include/babeltrace/ctf/events.h:167:5: note: expected 'const 
>>> struct declaration *' but argument is of type 'const struct 
>>> definition *'
>>> babeltrace_wrap.c: In function '_wrap__bt_ctf_get_int_base':
>>> babeltrace_wrap.c:4665:45: warning: passing argument 1 of 
>>> 'bt_ctf_get_int_base' from incompatible pointer type [enabled by 
>>> default]
>>> ../../include/babeltrace/ctf/events.h:172:5: note: expected 'const 
>>> struct declaration *' but argument is of type 'const struct 
>>> definition *'
>>> babeltrace_wrap.c: In function '_wrap__bt_ctf_get_int_byte_order':
>>> babeltrace_wrap.c:4687:51: warning: passing argument 1 of 
>>> 'bt_ctf_get_int_byte_order' from incompatible pointer type [enabled 
>>> by default]
>>> ../../include/babeltrace/ctf/events.h:178:5: note: expected 'const 
>>> struct declaration *' but argument is of type 'const struct 
>>> definition *'
>>> babeltrace_wrap.c: In function '_wrap__bt_ctf_get_int_len':
>>> babeltrace_wrap.c:4709:39: warning: passing argument 1 of 
>>> 'bt_ctf_get_int_len' from incompatible pointer type [enabled by 
>>> default]
>>> ../../include/babeltrace/ctf/events.h:184:9: note: expected 'const 
>>> struct declaration *' but argument is of type 'const struct 
>>> definition *'
>>> babeltrace_wrap.c: In function '_wrap__bt_ctf_get_encoding':
>>> babeltrace_wrap.c:4731:66: warning: passing argument 1 of 
>>> 'bt_ctf_get_encoding' from incompatible pointer type [enabled by 
>>> default]
>>> ../../include/babeltrace/ctf/events.h:190:26: note: expected 'const 
>>> struct declaration *' but argument is of type 'const struct 
>>> definition *'
>>> babeltrace_wrap.c: In function '_wrap__bt_ctf_get_array_len':
>>> babeltrace_wrap.c:4753:46: warning: passing argument 1 of 
>>> 'bt_ctf_get_array_len' from incompatible pointer type [enabled by 
>>> default]
>>> ../../include/babeltrace/ctf/events.h:196:5: note: expected 'const 
>>> struct declaration *' but argument is of type 'const struct 
>>> definition *'
>>> babeltrace_wrap.c: In function 'init_babeltrace':
>>> babeltrace_wrap.c:6020:61: error: 'BT_SEEK_END' undeclared (first 
>>> use in this function)
>>> babeltrace_wrap.c:6020:61: note: each undeclared identifier is 
>>> reported only once for each function it appears in
>>> make[3]: *** [_babeltrace_la-babeltrace_wrap.lo] Error 1
>>>
>>>   I got the source code by checking out bindings/python (git 
>>> checkout bindings/python).
>>>
>>>   I will be grateful if someone would tell how to fix the error.
> Babeltrace API changed since this was made.  To fix it, simply edit 
> the appropriate lines of the
>  lttng.i.in swig file in extras/bindings/swig/python (see the 
> CTF/EVENTS.H section of the file) and 
I meant bindings/python/babeltrace.i.in
> make sure all function declarations match the ones in 
> include/ctf/events.h
> From the error message, most (if not all) *const struct definition* 
> args must be changed to
> *const struct declaration*
> This might yield some errors in the Python code itself regarding 
> Definition objects.
> That class would need to be rewritten to fit the new API, along with 
> the corresponding functions.
> But it should compile anyway
> Also the 3 BT_SEEK_END lines must be changed to BT_SEEK_LAST
>
> Hope this helps
> Danny
>
>> This branch is currently in development, and might be out of sync with
>> the master branch of babeltrace at the moment. We don't have immediate
>> plans to work on it, but bontributions are welcome.
>>
>> Thanks,
>>
>> Mathieu
>>
>>>
>>> B
>>>   Thanks,
>>>
>>>   Geoffreyget_int_s
>>> _______________________________________________
>>> lttng-dev mailing list
>>> lttng-dev at lists.lttng.org
>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
>




More information about the lttng-dev mailing list