babeltrace.git
9 years agoPython-bindings fix: Out of tree build fails to find babeltrace.i
Jérémie Galarneau [Thu, 28 Nov 2013 18:19:10 +0000 (13:19 -0500)] 
Python-bindings fix: Out of tree build fails to find babeltrace.i

This fixes the out of tree builds by using the appropriate top_srcdir
and top_builddir variables in the bindings' Makefile.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoPython-bindings fix: outdated dist target babeltrace.i
Jérémie Galarneau [Sat, 23 Nov 2013 21:30:59 +0000 (16:30 -0500)] 
Python-bindings fix: outdated dist target babeltrace.i

This fixes the dist target for the python bindings. The
python-complements.h/.c files must be distributed, but not installed,
in order to build the python bindings.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoPython-bindings: Refactor the CTFWriter API
Jérémie Galarneau [Fri, 22 Nov 2013 05:02:33 +0000 (00:02 -0500)] 
Python-bindings: Refactor the CTFWriter API

Refactor the CTFWriter API to be more in line with the reader
modifications.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: bt_ctf_field_generic_validate should return < 0 on error
Jérémie Galarneau [Fri, 22 Nov 2013 04:46:37 +0000 (23:46 -0500)] 
Fix: bt_ctf_field_generic_validate should return < 0 on error

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Take the iterator's end position into account
Jérémie Galarneau [Fri, 22 Nov 2013 01:19:25 +0000 (20:19 -0500)] 
Fix: Take the iterator's end position into account

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Use the bt_iter_set_pos function to set the begin_pos
Jérémie Galarneau [Thu, 21 Nov 2013 23:07:20 +0000 (18:07 -0500)] 
Fix: Use the bt_iter_set_pos function to set the begin_pos

The current implementation of bt_iter_init asserts on begin_pos
that are not BT_SEEK_BEGIN. This uses the iterator set_pos function
to achieve the intended behavior.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoPython-bindings: Move declaration bindings out of the _Definition class
Jérémie Galarneau [Thu, 21 Nov 2013 20:45:50 +0000 (15:45 -0500)] 
Python-bindings: Move declaration bindings out of the _Definition class

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoPython-bindings: Refactor the FieldDecl and EventDecl classes
Jérémie Galarneau [Thu, 21 Nov 2013 03:15:43 +0000 (22:15 -0500)] 
Python-bindings: Refactor the FieldDecl and EventDecl classes

Renamed the FieldDecl and EventDecl classes to FieldDeclaration and
EventDeclaration. Getters are now exposed as properties.

Fixed an out of bounds array access.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoPython-bindings: Move the _scopes array out of the Event class
Jérémie Galarneau [Thu, 21 Nov 2013 02:33:16 +0000 (21:33 -0500)] 
Python-bindings: Move the _scopes array out of the Event class

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoPython-bindings: Refactor the Event class
Jérémie Galarneau [Thu, 21 Nov 2013 01:35:51 +0000 (20:35 -0500)] 
Python-bindings: Refactor the Event class

The Event class now implements the collections.Mapping interface and
provides properties where appropriate.

The Definition class is now private and renamed to _Definition.

The examples are modified to take these changes into account.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoPython-bindings: Refactor the TraceHandle class to use properties
Jérémie Galarneau [Wed, 20 Nov 2013 06:09:31 +0000 (01:09 -0500)] 
Python-bindings: Refactor the TraceHandle class to use properties

TraceHandle now exposes properties instead of getters. It also keeps
a reference to its parent TraceCollection.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoPython-bindings: Refactor the Context class
Jérémie Galarneau [Wed, 20 Nov 2013 05:28:05 +0000 (00:28 -0500)] 
Python-bindings: Refactor the Context class

The context class is now called TraceCollection and provides generator
functions to iterate over the traces' events. This makes it possible to
get rid of the Iterator, IterPos and File classes.

The examples are adapted to match the changes.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoExpose text arrays the same way as regular arrays
Jérémie Galarneau [Tue, 12 Nov 2013 21:22:10 +0000 (16:22 -0500)] 
Expose text arrays the same way as regular arrays

Store the content of text arrays both in the "elems" array and in a
string. While it does duplicate the data, this makes it possible to
access arrays containing UTF-8 or ASCII data the same way as regular
arrays.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDon't generate Python bindings by default
Jérémie Galarneau [Wed, 25 Sep 2013 18:21:47 +0000 (14:21 -0400)] 
Don't generate Python bindings by default

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd a usage example for the CTF Writer Python bindings
Jérémie Galarneau [Wed, 25 Sep 2013 00:51:13 +0000 (20:51 -0400)] 
Add a usage example for the CTF Writer Python bindings

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd CTF Writer Python bindings
Jérémie Galarneau [Tue, 17 Sep 2013 22:34:25 +0000 (18:34 -0400)] 
Add CTF Writer Python bindings

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoRename the ctf class to CTFReader
Jérémie Galarneau [Tue, 17 Sep 2013 15:47:07 +0000 (11:47 -0400)] 
Rename the ctf class to CTFReader

This prevents name collisions with the upcoming CTFWriter classes.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Python bindings array access functions write out of bounds
Jérémie Galarneau [Mon, 16 Sep 2013 23:59:00 +0000 (19:59 -0400)] 
Fix: Python bindings array access functions write out of bounds

The array access functions in the Python complements are writing
past the last element to add a NULL pointer and then using it from the
Python code to detect the end of the array. This may cause stability
issues.

This changes the functions to return multiple values (array and length)
in Python using SWIG's built-in OUTPUT typemaps.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd support for structure fields in the Python bindings
Jérémie Galarneau [Fri, 13 Sep 2013 19:39:39 +0000 (15:39 -0400)] 
Add support for structure fields in the Python bindings

get_value() returns a dictionary when the field is a structure.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd support for variant fields in the Python bindings
Jérémie Galarneau [Fri, 13 Sep 2013 01:37:21 +0000 (21:37 -0400)] 
Add support for variant fields in the Python bindings

get_value() now returns the variant's selected field's value
when called on a variant.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd support for floating point fields in the Python bindings
Jérémie Galarneau [Fri, 13 Sep 2013 21:35:41 +0000 (17:35 -0400)] 
Add support for floating point fields in the Python bindings

get_value() now returns a floating point field's value.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Throw a FieldError exception when get_value() fails
Jérémie Galarneau [Fri, 13 Sep 2013 21:32:58 +0000 (17:32 -0400)] 
Fix: Throw a FieldError exception when get_value() fails

Throw an exception whenever bt_ctf_field_get_error() reports an error.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoRemove Python 2 specific examples
Jérémie Galarneau [Mon, 19 Aug 2013 19:48:12 +0000 (15:48 -0400)] 
Remove Python 2 specific examples

These examples rely on the cairoplot module which is not compatible with
Python 3.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd a python bindings sequence test
Xiaona Han [Fri, 2 Aug 2013 21:42:32 +0000 (05:42 +0800)] 
Add a python bindings sequence test

This example is meant to test whether we can get a sequence's values in
the python binding well or not. It is used in conjunction with the
sequence test in the dir tests/ctf-traces/succeed/sequence.

Signed-off-by: Xiaona Han <xiaonahappy13@163.com>
Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoSupport for the sequence type
Xiaona Han [Fri, 26 Jul 2013 10:32:36 +0000 (18:32 +0800)] 
Support for the sequence type

Add support for getting a sequence's value in the python binding.

Signed-off-by: Xiaona Han <xiaonahappy13@163.com>
Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd a generic get_value() implementation
Xiaona Han [Fri, 26 Jul 2013 10:32:36 +0000 (18:32 +0800)] 
Add a generic get_value() implementation

Use get_value to get a field's value. Currently it does not support
compound types. Also it does not support floating point, since getting
a float's value is not implemented in babeltrace now.

Edit by Jérémie Galarneau: Arrays' value should not be returned using
get_char_array(). Implemented get_array_element_at() which returns a
Definition object corresponding to the array's element.

Exposed the bt_array_index function in the Python bindings

Signed-off-by: Xiaona Han <xiaonahappy13@163.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoSupport getting the value of enums
Xiaona Han [Fri, 26 Jul 2013 09:48:02 +0000 (17:48 +0800)] 
Support getting the value of enums

Use 'get_enum_str' to get the string matching the current enumeration.

Signed-off-by: Xiaona Han <xiaonahappy13@163.com>
Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoRemove the unnecessary underscore prefix
Xiaona Han [Fri, 26 Jul 2013 08:07:43 +0000 (16:07 +0800)] 
Remove the unnecessary underscore prefix

When getting the fields of an event by name, it is not necessary
to add an underscore prefix. This removes the underscore prefix of
the field names in the examples.

Signed-off-by: Xiaona Han <xiaonahappy13@163.com>
Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoReturn event fields by field name
Xiaona Han [Thu, 25 Jul 2013 23:56:04 +0000 (07:56 +0800)] 
Return event fields by field name

Since a field may be present both in an event and its stream's scope,
this returns a list which contains all the fields by the name. The
examples are also changed to match this new API.

Signed-off-by: Xiaona Han <xiaonahappy13@163.com>
Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoMerge branch 'master' into bindings/python
Jérémie Galarneau [Tue, 12 Nov 2013 16:23:52 +0000 (11:23 -0500)] 
Merge branch 'master' into bindings/python

9 years agoctf writer BSD compatibily: remove O_DIRECTORY
Mathieu Desnoyers [Wed, 6 Nov 2013 19:52:59 +0000 (14:52 -0500)] 
ctf writer BSD compatibily: remove O_DIRECTORY

Not strictly needed, especially since we are creating the directory
ourself.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix ctf writer lints
Mathieu Desnoyers [Sat, 2 Nov 2013 02:52:06 +0000 (22:52 -0400)] 
Fix ctf writer lints

Coverity found:

**CHECKED_RETURN
formats/ctf/writer/writer.c
**bt_ctf_writer_destroy()

**CHECKED_RETURN
formats/ctf/writer/stream.c
**bt_ctf_stream_destroy()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agolinter fix: comparison of fd >= 0
Mathieu Desnoyers [Sat, 2 Nov 2013 02:50:35 +0000 (22:50 -0400)] 
linter fix: comparison of fd >= 0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agotest ctf writer: fix lints
Mathieu Desnoyers [Thu, 31 Oct 2013 20:52:42 +0000 (16:52 -0400)] 
test ctf writer: fix lints

Coverity found the following defects:

** CID 1124096: Null pointer dereference (FORWARD_NULL)
/tests/lib/test_ctf_writer.c: 140

** CID 1124095: Dereference after null check (FORWARD_NULL)
/tests/lib/test_ctf_writer.c: 139

** CID 1124094: Dereference after null check (FORWARD_NULL)
/tests/lib/test_ctf_writer.c: 211

** CID 1124093: Argument cannot be negative (NEGATIVE_RETURNS)
/tests/lib/test_ctf_writer.c: 144

** CID 1124092: Argument cannot be negative (NEGATIVE_RETURNS)
/tests/lib/test_ctf_writer.c: 144

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoctf-writer: fix linter defects
Mathieu Desnoyers [Thu, 31 Oct 2013 19:04:01 +0000 (15:04 -0400)] 
ctf-writer: fix linter defects

Coverity found the following defects:

** CID 1124098: Unchecked return value (CHECKED_RETURN)
/formats/ctf/writer/event-types.c: 200

** CID 1124097: Unchecked return value (CHECKED_RETURN)
/formats/ctf/writer/writer.c: 376

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoctf-writer: Coding style fix
Mathieu Desnoyers [Thu, 31 Oct 2013 19:02:38 +0000 (15:02 -0400)] 
ctf-writer: Coding style fix

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTests: Add a CTF Writer test
Jérémie Galarneau [Wed, 16 Oct 2013 18:35:02 +0000 (14:35 -0400)] 
Tests: Add a CTF Writer test

The test will be ran as part of the "tests" test plan.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd CTF Writer implementation
Jérémie Galarneau [Wed, 16 Oct 2013 18:35:01 +0000 (14:35 -0400)] 
Add CTF Writer implementation

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd public CTF Writer API headers
Jérémie Galarneau [Wed, 16 Oct 2013 18:35:00 +0000 (14:35 -0400)] 
Add public CTF Writer API headers

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Don't create a new packet if ctf_move_pos() seeks out of a packet
Jérémie Galarneau [Tue, 15 Oct 2013 17:23:46 +0000 (13:23 -0400)] 
Fix: Don't create a new packet if ctf_move_pos() seeks out of a packet

This change ensures that ctf_move_pos() does not create a new packet
when ctf_move_pos() moves out of the current packet's bounds. The next
call to ctf_pos_access_ok() will report EFAULT which can then be
handled appropriately by the caller.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Uninitialized ctf_stream_pos structure in ctf_float_write()
Jérémie Galarneau [Tue, 15 Oct 2013 17:23:33 +0000 (13:23 -0400)] 
Fix: Uninitialized ctf_stream_pos structure in ctf_float_write()

This structure is passed to _ctf_float_copy() which uses the
uninitialized mmap_offset and offset values to read the source
floating point value.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Use the packet's final size when mmap-ing the next packet
Jérémie Galarneau [Tue, 15 Oct 2013 17:23:18 +0000 (13:23 -0400)] 
Fix: Use the packet's final size when mmap-ing the next packet

ctf_packet_seek() assumed that a packet would be of fixed size
"WRITE_PACKET_LEN" when seeking to the next packet in write mode.
This ensures that the real size used.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Close traces on context destruction
Jérémie Galarneau [Thu, 10 Oct 2013 16:08:30 +0000 (12:08 -0400)] 
Fix: Close traces on context destruction

bt_trace_handle_destroy is called on destruction of the trace_handle
hash table's elements. This function only frees the trace handle,
leaving the input traces open.

This fix sets remove_trace_handle as the value_destroy_func ensuring
that the format's close_trace function is called before the trace_handle
is destroyed.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agogcc warning fix: -Wextra
Mathieu Desnoyers [Tue, 8 Oct 2013 21:33:55 +0000 (17:33 -0400)] 
gcc warning fix: -Wextra

For the "ordered comparison of pointer with integer zero" warning, fix
this by comparing (type) -1 against (type) 0 instead of just 0, so if
"type" is a pointer type, this pointer type will be applied to the right
operand too, thus fixing the warning.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoDeclare enum type to use from C++
Francis Giraldeau [Fri, 13 Sep 2013 20:19:20 +0000 (16:19 -0400)] 
Declare enum type to use from C++

Anonymous enum can't be referenced from C++. to fix this issue, declare enum
bt_iter_pos_type and use this type in struct bt_iter_pos.

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: test_seek should only output one TAP plan
Christian Babeux [Mon, 26 Aug 2013 18:15:14 +0000 (14:15 -0400)] 
Fix: test_seek should only output one TAP plan

On critical failure paths, the test_seek test was outputting multiple
TAP plans, which according to the specification [1] is invalid. This
causes parsing issues on very strict TAP parsers.

[1] - http://podwiki.hexten.net/TAP/TAP.html?page=TAP

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRevert "Add missing declaration of ssize_t as unsigned long for SWIG"
Mathieu Desnoyers [Mon, 26 Aug 2013 17:46:54 +0000 (13:46 -0400)] 
Revert "Add missing declaration of ssize_t as unsigned long for SWIG"

This reverts commit 515d3e63070e76440856bb9a123e9b3fb82d5fb5.

Jeremie pointed out that he recommended _not_ to merge this patch.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd missing declaration of ssize_t as unsigned long for SWIG
Amit Margalit [Tue, 20 Aug 2013 07:41:30 +0000 (10:41 +0300)] 
Add missing declaration of ssize_t as unsigned long for SWIG

The file babeltrace.i.in contains a declaration of bt_get_int_len()
returning ssize_t, which SWIG does not recognize as an integer (perhaps
only in some cases).

Add a typedef to generate correct code.

Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Amit Margalit <amitm@il.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix (python): use of braces in format strings
Amit Margalit [Tue, 20 Aug 2013 06:30:38 +0000 (09:30 +0300)] 
Fix (python): use of braces in format strings

Using braces in format strings without specifying a number (e.g. "The
number {} is incorrect".format(some_variable)) is available since Python
2.7, and older Python 2.6 required a number, zero-based (e.g. "The
number {0} is incorrect").

This patch adds these numbers for the sake of older systems.

Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Amit Margalit <amitm@il.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd missing call to _bt_ctf_get_decl_from_def() when calling _bt_ctf_get_int_len().
Amit Margalit [Tue, 20 Aug 2013 06:29:02 +0000 (09:29 +0300)] 
Add missing call to _bt_ctf_get_decl_from_def() when calling _bt_ctf_get_int_len().

The python code that call _bt_ctf_get_int_len() fails to wrap self._d
with the call to _bt_ctf_get_decl_from_def.

Acked-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Amit Margalit <amitm@il.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMerge branch 'master' into bindings/python
Mathieu Desnoyers [Mon, 26 Aug 2013 17:34:48 +0000 (13:34 -0400)] 
Merge branch 'master' into bindings/python

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: test_seek static linking
Mathieu Desnoyers [Mon, 26 Aug 2013 17:28:13 +0000 (13:28 -0400)] 
Fix: test_seek static linking

./configure --disable-shared --enable-static
make
make check

The make check fails for test_seek.

Fix this by ensuring that test_seek has a dependency on libbabeltrace
and libbabeltrace-ctf. This is a temporary work-around until we improve
our plugin handling.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTests: fix string octal encoding
Mathieu Desnoyers [Fri, 23 Aug 2013 21:50:31 +0000 (17:50 -0400)] 
Tests: fix string octal encoding

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd missing Makefile.am
Mathieu Desnoyers [Thu, 22 Aug 2013 18:37:38 +0000 (14:37 -0400)] 
Add missing Makefile.am

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agomake check VPATH build
Mathieu Desnoyers [Thu, 22 Aug 2013 17:48:36 +0000 (13:48 -0400)] 
make check VPATH build

Copy scripts to builddir if VPATH build is detected.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd missing test files to make dist
Mathieu Desnoyers [Thu, 22 Aug 2013 17:15:44 +0000 (13:15 -0400)] 
Add missing test files to make dist

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTests: Use Perl prove as the testsuite runner
Christian Babeux [Thu, 22 Aug 2013 17:02:31 +0000 (13:02 -0400)] 
Tests: Use Perl prove as the testsuite runner

This commit modify the make check target to run Perl prove as the
testsuite runner.

$ cd babeltrace/tests
$ ./run.sh tests

One can also run tests manually using prove:

$ prove --exec '' path/to/test

    OR

$ prove --exec '' - < testlist

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTests: Add trace reading test with babeltrace bin
Christian Babeux [Thu, 22 Aug 2013 17:01:48 +0000 (13:01 -0400)] 
Tests: Add trace reading test with babeltrace bin

This test uses the sample traces found in tests/ctf-traces and the
babeltrace cli tool to parse them. The traces found in
ctf-traces/succeed should return a successful exit code and those in
ctf-traces/fail should return a failure exit code.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTests: Split lib tests in multiple standalone test scripts
Christian Babeux [Thu, 22 Aug 2013 17:00:48 +0000 (13:00 -0400)] 
Tests: Split lib tests in multiple standalone test scripts

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTests: Rename tests under lib with tests naming convention
Christian Babeux [Thu, 22 Aug 2013 17:00:11 +0000 (13:00 -0400)] 
Tests: Rename tests under lib with tests naming convention

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTests: Move TAP helpers to tests/utils/tap
Christian Babeux [Thu, 22 Aug 2013 16:59:24 +0000 (12:59 -0400)] 
Tests: Move TAP helpers to tests/utils/tap

tests/utils/tap/tap.{h,c}:
For use in C tests. You can link against libtap with the usual automake
mechanisms.

New TAP helper:

tests/utils/tap/tap.sh:
For use in shell scripts tests. Source the script
(e.g. source "tests/utils/tap/tap.sh") to use the relevants TAP
functions.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix ctf_clock_declaration_visit returning an error when reading a boolean
Jérémie Galarneau [Thu, 22 Aug 2013 16:46:46 +0000 (12:46 -0400)] 
Fix ctf_clock_declaration_visit returning an error when reading a boolean

The ret variable is used to read the "absolute" field's value and was
not reset to zero, thus returning an error whenever that value was TRUE.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix CTF parser hang with bison 3.0
Mathieu Desnoyers [Fri, 16 Aug 2013 15:15:27 +0000 (11:15 -0400)] 
Fix CTF parser hang with bison 3.0

Replace deprecated YYLEX_PARAM with %lex-param

See http://article.gmane.org/gmane.org.fsf.announce/2006 for details.

Tested with bison 2.5 and bison 3.0.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd missing lex/bison generated files to make clean
Mathieu Desnoyers [Fri, 16 Aug 2013 14:45:50 +0000 (10:45 -0400)] 
Add missing lex/bison generated files to make clean

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoPut the libbabeltrace-ctf specific parts of babeltrace.pc into a babeltrace-ctf.pc...
Yannick Brosseau [Thu, 15 Aug 2013 22:10:44 +0000 (18:10 -0400)] 
Put the libbabeltrace-ctf specific parts of babeltrace.pc into a babeltrace-ctf.pc file

On some distributions libbabeltrace and libbabeltrace-ctf are packaged
into separate packages. This means they should have their own pkg-config
file.

The babeltrace-ctf.pc file requires the babeltrace.pc one.

With this change, to have the ctf support in libbabeltrace a pkg-config
user will need to specify the babeltrace-ctf package. To compile and
link with only the base libbabeltrace, the package babeltrace would be
used.

Fixes #550

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoTest for presence of bison and flex when building from git
Yannick Brosseau [Thu, 15 Aug 2013 20:21:28 +0000 (16:21 -0400)] 
Test for presence of bison and flex when building from git

Fixes #74

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Unchecked asprintf/vasprintf return values
Jérémie Galarneau [Fri, 12 Jul 2013 17:08:54 +0000 (13:08 -0400)] 
Fix: Unchecked asprintf/vasprintf return values

strp·may·be·modified·even·in·case·of·failure·according·to·the
ASPRINTF(3) man page.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMissing NULL pointer init in tap.c
Mathieu Desnoyers [Fri, 12 Jul 2013 15:45:09 +0000 (11:45 -0400)] 
Missing NULL pointer init in tap.c

Could lead to free() of unitialized pointer.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd bt_unregister_format function support
Xiaona Han [Mon, 8 Jul 2013 23:40:32 +0000 (19:40 -0400)] 
Add bt_unregister_format function support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: libcompat should be noinst (statically linked)
Mathieu Desnoyers [Mon, 8 Jul 2013 21:55:34 +0000 (17:55 -0400)] 
Fix: libcompat should be noinst (statically linked)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd MinGW definitions to endian.h
JP Ikaheimonen [Mon, 8 Jul 2013 14:03:27 +0000 (10:03 -0400)] 
Add MinGW definitions to endian.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd MinGW implementation of UUID functions
JP Ikaheimonen [Mon, 8 Jul 2013 14:01:44 +0000 (10:01 -0400)] 
Add MinGW implementation of UUID functions

Add implementation of the UUID functions for MinGW.
The Windows UUID standard has a different endian from what we expect,
so also do endian conversion for the UUID data types as needed.
Add the MinGW implementation file to the build system.
In configure.ac, assume that MinGW UUID functions exist.

[ Edit by Mathieu Desnoyers: coding style fixes, use strncmp rather than
  strcmp. Use already existing defines rather than hardcoded integers. ]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd Windows exe files to .gitignore
JP Ikaheimonen [Mon, 8 Jul 2013 13:49:54 +0000 (09:49 -0400)] 
Add Windows exe files to .gitignore

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd MinGW32 libraries to executables
JP Ikaheimonen [Mon, 8 Jul 2013 13:48:24 +0000 (09:48 -0400)] 
Add MinGW32 libraries to executables

Make configure.ac aware of MinGW, and set up a variable we can use
in make files.
Under MinGW, add platform specific libraries to all link commands.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMove strerror_r to compat directory
JP Ikaheimonen [Mon, 8 Jul 2013 13:02:02 +0000 (09:02 -0400)] 
Move strerror_r to compat directory

The usage of strerror_r is platform dependent.
Add new function compat_strerror_r to
include/babeltrace/compat/string.h,
and hide the platform-dependent usage there.
Use the aforementioned header file instead of standard string.h where
necessary.

[ Updates by Mathieu Desnoyers: fix coding style, fix possible buffer
  overflow by using strncpy rather than strcpy. ]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoDocument: manpage: chronologically ordered events
Mathieu Desnoyers [Mon, 8 Jul 2013 12:45:51 +0000 (08:45 -0400)] 
Document: manpage: chronologically ordered events

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMake python bindings compile with trunk
Xiaona Han [Fri, 5 Jul 2013 23:27:22 +0000 (19:27 -0400)] 
Make python bindings compile with trunk

Signed-off-by: Xiaona Han <xiaonahappy13@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMerge branch 'master' into bindings/python
Mathieu Desnoyers [Fri, 5 Jul 2013 23:26:57 +0000 (19:26 -0400)] 
Merge branch 'master' into bindings/python

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agobabeltrace-log: UTC timestamps
Soumya Kanti Chakraborty [Sat, 29 Jun 2013 14:02:55 +0000 (10:02 -0400)] 
babeltrace-log: UTC timestamps

Signed-off-by: Soumya Kanti Chakraborty <soumya.kanti.chakraborty@ericsson.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoCleanup: comment mismatch with code
Mathieu Desnoyers [Wed, 26 Jun 2013 18:46:57 +0000 (14:46 -0400)] 
Cleanup: comment mismatch with code

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd unit test validating seeking to last event of a trace
Yannick Brosseau [Wed, 26 Jun 2013 18:44:34 +0000 (14:44 -0400)] 
Add unit test validating seeking to last event of a trace

[ Edited by Mathieu Desnoyers from patch "Move some validation in
  ctf_packet_seek in the SEEK_CUR section" ]

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRemove unused function bt_trace_handle_get_id
Jérémie Galarneau [Wed, 26 Jun 2013 17:32:03 +0000 (13:32 -0400)] 
Remove unused function bt_trace_handle_get_id

This function was removed from trace-handle.h as part of commit
e3d12cf93f067601df4179ef4b7e2a30aa0065f7 which changed the trace-handle
API to use handle_ids instead of pointers to a struct bt_trace_handle.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoCleanup: remove whitespaces at end of lines
Mathieu Desnoyers [Tue, 25 Jun 2013 19:32:40 +0000 (15:32 -0400)] 
Cleanup: remove whitespaces at end of lines

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRemove extra -I for python bindings
Yannick Brosseau [Fri, 21 Jun 2013 15:20:00 +0000 (11:20 -0400)] 
Remove extra -I for python bindings

Same fix as for lttng-tools commit f7cbc765ad2526667f1f20b3a89c596b3422ac34

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoVersion 1.1.1 v1.1.1
Mathieu Desnoyers [Wed, 19 Jun 2013 01:02:05 +0000 (21:02 -0400)] 
Version 1.1.1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoCompare traces by stream path as secondary key
Mathieu Desnoyers [Mon, 17 Jun 2013 20:17:17 +0000 (16:17 -0400)] 
Compare traces by stream path as secondary key

Ensure runs of babeltrace in different environments give the same output
for the same trace collection. There are usually few events with the
same timestamp in a trace, so this secondary key comparison should not
be often required.

Fixes #540

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: use index, not cur_index, for SEEK_SET validation
Mathieu Desnoyers [Mon, 17 Jun 2013 19:48:55 +0000 (15:48 -0400)] 
Fix: use index, not cur_index, for SEEK_SET validation

Fixes #551

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: ctf-text irregular output with disabled field names
Mathieu Desnoyers [Mon, 17 Jun 2013 16:00:51 +0000 (12:00 -0400)] 
Fix: ctf-text irregular output with disabled field names

Fixes #532

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoSupport old compilers
Thomas Petazzoni [Tue, 28 May 2013 17:31:43 +0000 (13:31 -0400)] 
Support old compilers

Some old compilers do not use C99 as their default C language variant,
for example gcc 4.3.x, which is used on some old machines. When such a
compiler is used, by default, ULLONG_MAX is not visible. Adding
-std=gnu99 is needed to make this definition visible.

In autoconf speak, this translates into the need of using
AC_PROC_CC_STDC instead of AC_PROG_CC. See
http://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/C-Compiler.html
for more details.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRemove useless variable assignment
Jérémie Galarneau [Tue, 28 May 2013 17:28:32 +0000 (13:28 -0400)] 
Remove useless variable assignment

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Remove extra quote after an include directive
Jérémie Galarneau [Wed, 15 May 2013 19:03:58 +0000 (21:03 +0200)] 
Fix: Remove extra quote after an include directive

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoDon't dereference before NULL check
Mathieu Desnoyers [Wed, 15 May 2013 14:49:36 +0000 (16:49 +0200)] 
Don't dereference before NULL check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoeliminate dead code
Mathieu Desnoyers [Wed, 15 May 2013 14:47:55 +0000 (16:47 +0200)] 
eliminate dead code

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agofix babeltrace-log error checking
Mathieu Desnoyers [Wed, 15 May 2013 14:46:23 +0000 (16:46 +0200)] 
fix babeltrace-log error checking

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix resource leak on error path
Mathieu Desnoyers [Wed, 15 May 2013 14:44:35 +0000 (16:44 +0200)] 
Fix resource leak on error path

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: handle error checking should compare against NULL
Mathieu Desnoyers [Wed, 15 May 2013 14:41:42 +0000 (16:41 +0200)] 
Fix: handle error checking should compare against NULL

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRemove unused array in bt_context_add_traces_recursive
Jérémie Galarneau [Wed, 15 May 2013 06:11:43 +0000 (08:11 +0200)] 
Remove unused array in bt_context_add_traces_recursive

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Suppress a compiler warning (always-false condition)
Jérémie Galarneau [Wed, 15 May 2013 06:10:04 +0000 (08:10 +0200)] 
Fix: Suppress a compiler warning (always-false condition)

Clang reports an always-false condition (checking if an unsigned value <
0) caused by a type mismatch in ctf-visitor-generate-io-struct.c.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoCleanup: remove trailing whitespaces
Mathieu Desnoyers [Wed, 15 May 2013 06:08:56 +0000 (08:08 +0200)] 
Cleanup: remove trailing whitespaces

Reported-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMove memstream.h and uuid.h to include/babeltrace/compat directory
JP Ikaheimonen [Tue, 7 May 2013 19:53:33 +0000 (15:53 -0400)] 
Move memstream.h and uuid.h to include/babeltrace/compat directory

As preparation for a new compatibility layer, the files memstream.h
and uuid.h are moved to include/babeltrace/compat.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.041195 seconds and 4 git commands to generate.