babeltrace.git
6 years agoplugin-so: use list of components instead of glib hash table
Mathieu Desnoyers [Thu, 8 Jun 2017 19:38:46 +0000 (15:38 -0400)] 
plugin-so: use list of components instead of glib hash table

Use a list of components to track those that have references to their so
handles. This allows removing a dependency on the glib hash table, which
is not very cooperative when initialized from a library constructor in a
static build (mainly on Windows).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: use --component=NAME:{source,filter,sink}.PLUGIN.COMPCLS
Philippe Proulx [Thu, 8 Jun 2017 19:57:08 +0000 (15:57 -0400)] 
cli: use --component=NAME:{source,filter,sink}.PLUGIN.COMPCLS

Use a universal -c/--component option for all component class types,
specifying the component class type in the option's argument instead,
for example:

    Before: --source=ctf.fs
    After:  --component=source.ctf.fs

    Before: --sink=my-text:text.pretty
    After:  --component=my-text:sink.text.pretty

This provides a universal way to identify a component instance in:

* Log messages
* Information/error messages
* List of plugins and contained component classes
* Help messages
* Documentation

Then we can always refer to the ctf.fs source component class, for
example, as `source.ctf.fs` instead of all the variations:

* The ctf.fs source
* --source ctf.fs
* ctf.fs (source)

and so on.

Short option -c used to be for --connect: it's -C now.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolttng-live: check graph cancel state, check ctf trace pointer
Mathieu Desnoyers [Thu, 8 Jun 2017 17:35:54 +0000 (13:35 -0400)] 
lttng-live: check graph cancel state, check ctf trace pointer

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix build with BUILT_IN_PLUGINS=1
Philippe Proulx [Thu, 8 Jun 2017 17:13:07 +0000 (13:13 -0400)] 
Fix build with BUILT_IN_PLUGINS=1

Changes:

* Make library always depend on its convenience libraries. Since the
  library is not linked with --whole-archive in the CLI when
  BUILT_IN_PLUGINS=1 (like plugins are), it's okay for it to include
  convenience symbols.

* Do not build tests/lib/test_plugin when BUILT_IN_PLUGINS=1

* Do not build tests/plugins when BUILT_IN_PLUGINS=1

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd bt_graph_add_component(), make bt_component_create() internal
Philippe Proulx [Thu, 8 Jun 2017 02:25:48 +0000 (22:25 -0400)] 
Add bt_graph_add_component(), make bt_component_create() internal

With this patch, you can only instantiate a component class through an
existing graph. This can guarantee to the user (component class
developer) that, when the component class's initialization method is
called, the component always belongs to a graph. This simplifies things,
now and in the future. For example, it is possible to cancel the graph
during the execution of bt_graph_add_component() so that the user method
knows if it should retry now or return an error when the graph is
canceled.

bt_graph_add_component() returns BT_GRAPH_STATUS_CANCELED if the graph
is canceled. If the user's initialization method fails, its return
component status is converted to the appropriate graph status.

Another advantage of adding a component to a graph is that, if you add a
"port added" graph listener, it is guaranteed that the listener is
called even for the initial ports of a component. This was not possible
before.

This patch also makes a component's name mandatory, and
bt_graph_add_component() ensures that there are components sharing the
same name part of a given graph. This is a constraint similar to the
fact that all the ports of a component must have a unique name. It
should help to the implementation of a function to retrieve a component
by name from a graph in the future.

We do not check that a graph has or not "loose", disconnected components
in bt_graph_consume(). This is not a change because any component can
remove all its ports once connected once and become loose. A graph with
floating/loose components is said to be disconnected in classical graph
theory. This is not a problem for the moment, as the connected
components can still interact. The disconnected components should
probably be marked and then destroyed in bt_graph_consume() and/or in a
dedicated garbage collecting function if needed
(bt_graph_remove_disconnected_components() for example).

This patch also makes successfully user-initialized components marked as
such so that the user's finalization method is not called if its
initialization method failed. In other words, the initialization method
is responsible for any cleanup if it's about to fail.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolttng-live: correctly handle ctrl-c and fix leaks
Mathieu Desnoyers [Wed, 7 Jun 2017 23:23:58 +0000 (19:23 -0400)] 
lttng-live: correctly handle ctrl-c and fix leaks

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoEnd connection on destruction
Philippe Proulx [Wed, 7 Jun 2017 22:31:41 +0000 (18:31 -0400)] 
End connection on destruction

End connection on destruction so that each port is disconnected once the
connection is destroyed. Otherwise each port keeps its connection
pointer as is which point to freed memory.

bt_connection_end() already makes sure to finalize each created
notification iterator, so all is left in the destructor is to free the
array of iterators and the connection itself.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoCancel the graph on destruction
Philippe Proulx [Wed, 7 Jun 2017 22:12:03 +0000 (18:12 -0400)] 
Cancel the graph on destruction

Consider the graph as canceled at the beginning of its destruction. This
prohibits the use of some operations that are restricted to be used when
the graph is active and running.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoconnection.c: refuse to create a notif. iter. when the graph is canceled
Philippe Proulx [Wed, 7 Jun 2017 22:03:54 +0000 (18:03 -0400)] 
connection.c: refuse to create a notif. iter. when the graph is canceled

It is useless to create a notification iterator from a connection which
belongs to a canceled graph.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolib/graph/{filter.c,sink.c,source.c}: fix log messages
Philippe Proulx [Wed, 7 Jun 2017 22:01:16 +0000 (18:01 -0400)] 
lib/graph/{filter.c,sink.c,source.c}: fix log messages

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove dependancies on ctf.fs source component caused by former logging API
Jérémie Galarneau [Wed, 7 Jun 2017 20:17:35 +0000 (16:17 -0400)] 
Remove dependancies on ctf.fs source component caused by former logging API

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMove ctf-fs source query implementations to their own file
Jérémie Galarneau [Mon, 5 Jun 2017 18:30:16 +0000 (14:30 -0400)] 
Move ctf-fs source query implementations to their own file

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: do not use BT_MOVE() when the destination memory could be uninitialized
Philippe Proulx [Wed, 7 Jun 2017 21:51:46 +0000 (17:51 -0400)] 
Fix: do not use BT_MOVE() when the destination memory could be uninitialized

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMake bt_private_connection_create_notification_iterator() return a status code
Philippe Proulx [Wed, 7 Jun 2017 21:45:59 +0000 (17:45 -0400)] 
Make bt_private_connection_create_notification_iterator() return a status code

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRefuse to add port to component when parent graph is canceled
Philippe Proulx [Wed, 7 Jun 2017 20:24:13 +0000 (16:24 -0400)] 
Refuse to add port to component when parent graph is canceled

The objects owned by a graph should not be able to perform any useless
action. Having those constraints promise that certain contained objects
remain within certain states when the graph is canceled.

In this case, it is useless for a component to add a port, since this
port cannot be connected to another one within the same graph because
bt_graph_connect_ports() is not permitted when the graph is canceled.

We still allow ports to be removed when the graph is canceled for
symetric teardowns, for example.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agograph.c: do not warn when the graph is canceled during bt_graph_run()
Philippe Proulx [Wed, 7 Jun 2017 20:12:56 +0000 (16:12 -0400)] 
graph.c: do not warn when the graph is canceled during bt_graph_run()

If the graph is canceled during bt_graph_run()'s loop, do not warn: this
was intentionally done during the execution by another thread or by a
signal handler. Log a debug message and quit with the usual
BT_GRAPH_STATUS_CANCELED status.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd internal bt_component_borrow_graph()
Philippe Proulx [Wed, 7 Jun 2017 19:27:09 +0000 (15:27 -0400)] 
Add internal bt_component_borrow_graph()

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMake bt_private_component_*_add_*_port() return a status code
Philippe Proulx [Wed, 7 Jun 2017 19:26:34 +0000 (15:26 -0400)] 
Make bt_private_component_*_add_*_port() return a status code

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMake bt_graph_connect_ports() return a status code
Philippe Proulx [Wed, 7 Jun 2017 16:38:17 +0000 (12:38 -0400)] 
Make bt_graph_connect_ports() return a status code

bt_graph_connect_ports() can fail for multiple reasons, some of which
are not errors per se, but conditions which make the connection
impossible, for example a component refuses the connection, or the graph
is canceled.

With this version, the connection is returned as an output parameter,
which can be NULL if the user is not interested in the connection object
(most common case), and the function returns a graph status code.

Two new status codes are added in order to satisfy this patch:

* BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION
* BT_GRAPH_STATUS_NOMEM

The first one is not considered an error, that is, the graph's user
could only _try_ to connect two components until the function returns
BT_GRAPH_STATUS_OK (and retry in case of
BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd bt_connection_is_ended()
Philippe Proulx [Wed, 7 Jun 2017 15:52:37 +0000 (11:52 -0400)] 
Add bt_connection_is_ended()

Quickly indicates if a connection is ended without having to get and
puts its individual endpoint ports.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/notif-iter/notif-iter.c: add logging
Philippe Proulx [Tue, 6 Jun 2017 18:58:36 +0000 (14:58 -0400)] 
plugins/ctf/common/notif-iter/notif-iter.c: add logging

Remove the logging of the payload returned by the request_bytes() medium
operation of the ctf.lttng.live CC because it is now logged after
calling this user function in the common notif-iter.c.

Make bt_ctf_field_path_string() static in its internal header instead of
BT_HIDDEN because otherwise the plugin cannot access it.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: flush open packets on destroy
Julien Desfossez [Mon, 5 Jun 2017 21:11:38 +0000 (17:11 -0400)] 
fs-sink: flush open packets on destroy

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix sink.ctf.fs: mark the trace as static on destroy
Julien Desfossez [Mon, 5 Jun 2017 20:08:34 +0000 (16:08 -0400)] 
Fix sink.ctf.fs: mark the trace as static on destroy

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: fix check trace completed when static is set
Julien Desfossez [Mon, 5 Jun 2017 19:56:24 +0000 (15:56 -0400)] 
fs-sink: fix check trace completed when static is set

The input trace could be set static when all its streams are closed, so
we need to check if the trace is completed in the trace_static callback
as well.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolttng-live: populate trace name
Mathieu Desnoyers [Mon, 5 Jun 2017 21:25:11 +0000 (17:25 -0400)] 
lttng-live: populate trace name

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: cancel a notif. iter. finalized during its "next" method
Philippe Proulx [Mon, 5 Jun 2017 19:18:11 +0000 (15:18 -0400)] 
Fix: cancel a notif. iter. finalized during its "next" method

It is possible that the user's "next" method, somehow, cancels its own
notification iterator. This can happen, for example, when the user's
method removes the port on which there's the connection from which the
notification iterator was created. In this case, said connection is
ended, and all its notification iterators are finalized.

In ensure_queue_has_notifications(), after calling the user's "next"
method, if there's no error, we check if the notification iterator is
finalized. If so, we return the BT_NOTIFICATION_ITERATOR_STATUS_CANCELED
status directly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: do not allow a notif. iter. to call the user's "next" method once finalized
Philippe Proulx [Mon, 5 Jun 2017 16:52:29 +0000 (12:52 -0400)] 
Fix: do not allow a notif. iter. to call the user's "next" method once finalized

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: do not try to create initial packet/event fields when opt. FT is NULL
Philippe Proulx [Fri, 2 Jun 2017 18:11:49 +0000 (14:11 -0400)] 
ir: do not try to create initial packet/event fields when opt. FT is NULL

If a trace has not packet header field type, then when creating a
packet, do not attempt to create the initial packet header field without
checking that the field type is NULL because this is a violation of
preconditions. The main side effect here is a WARN-level log message
even if the situation is normal.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocopy_trace: copy the trace name
Julien Desfossez [Fri, 2 Jun 2017 15:12:52 +0000 (11:12 -0400)] 
copy_trace: copy the trace name

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: handle trace name
Julien Desfossez [Fri, 2 Jun 2017 14:33:19 +0000 (10:33 -0400)] 
fs-sink: handle trace name

Now the fs-sink uses the trace name to create the output path.
The trace name is appended after the path argument passed on the command
line.
If the resulting path exists, the plugin increments a numerical suffix
until it finds one or reaches INT_MAX.

The trace name is refused if it is ".." or contains "../".

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoalways copy packet/content_size, they are overwritten by the lib when necessary
Julien Desfossez [Fri, 2 Jun 2017 13:42:20 +0000 (09:42 -0400)] 
always copy packet/content_size, they are overwritten by the lib when necessary

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix copytrace: copy the entire payload_type
Julien Desfossez [Fri, 2 Jun 2017 13:37:01 +0000 (09:37 -0400)] 
Fix copytrace: copy the entire payload_type

Copy payload_type directly rather than iterating on its members.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoclock description is optional
Julien Desfossez [Fri, 2 Jun 2017 13:18:31 +0000 (09:18 -0400)] 
clock description is optional

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agomove the copy of event_context in ctf_copy_event_class
Julien Desfossez [Fri, 2 Jun 2017 13:12:03 +0000 (09:12 -0400)] 
move the copy of event_context in ctf_copy_event_class

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix copytrace: packet header is optional
Julien Desfossez [Fri, 2 Jun 2017 12:44:22 +0000 (08:44 -0400)] 
Fix copytrace: packet header is optional

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agosupport adding streams on non-static traces
Julien Desfossez [Thu, 1 Jun 2017 20:09:15 +0000 (16:09 -0400)] 
support adding streams on non-static traces

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove dead code from the debug-info component class
Julien Desfossez [Thu, 1 Jun 2017 19:49:52 +0000 (15:49 -0400)] 
Remove dead code from the debug-info component class

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix debug-info: handle event layouts of lttng-ust traces prior to 2.9
Julien Desfossez [Thu, 1 Jun 2017 19:16:18 +0000 (15:16 -0400)] 
Fix debug-info: handle event layouts of lttng-ust traces prior to 2.9

Traces produced by lttng-ust < 2.9 emitted errors on dl_open events, but
those are not errors, just missing information that we already handle.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: fix handling static notifications
Julien Desfossez [Thu, 1 Jun 2017 18:16:59 +0000 (14:16 -0400)] 
fs-sink: fix handling static notifications

Instead of relying on a stream count, keep a state for each stream.
This allows to check that we only see each stream once and works even if
each stream is started/completed sequentially.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: move stream and stream_class maps in fs_writer struct
Julien Desfossez [Wed, 31 May 2017 19:19:22 +0000 (15:19 -0400)] 
fs-sink: move stream and stream_class maps in fs_writer struct

The fs_writer struct is now responsible for those HT since they are only
relevant within the scope of a writer, not the whole component.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: explicitely handle stream_begin notif
Julien Desfossez [Wed, 31 May 2017 18:35:54 +0000 (14:35 -0400)] 
fs-sink: explicitely handle stream_begin notif

Instead of creating the new streams lazily when packets begin, this
allows to handle empty streams.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: trace static handling + cleanup teardown
Julien Desfossez [Mon, 29 May 2017 22:30:27 +0000 (18:30 -0400)] 
fs-sink: trace static handling + cleanup teardown

When a trace is static and we have seen the stream_end notification for
all the active streams, we can free the resources for handling the
trace.

This also highlighted that a few bits were missing for a clean teardown
of the plugin.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoUse abort() instead of a false assertion
Philippe Proulx [Fri, 2 Jun 2017 17:48:13 +0000 (13:48 -0400)] 
Use abort() instead of a false assertion

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodoc/Makefile.am: do not install internal documentation
Philippe Proulx [Fri, 2 Jun 2017 17:26:02 +0000 (13:26 -0400)] 
doc/Makefile.am: do not install internal documentation

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolib/ctf-writer/writer.c: logging: change tag to `CTF-WRITER`
Philippe Proulx [Fri, 2 Jun 2017 17:25:44 +0000 (13:25 -0400)] 
lib/ctf-writer/writer.c: logging: change tag to `CTF-WRITER`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd missing include of unistd.h
Michael Jeanson [Thu, 1 Jun 2017 22:31:48 +0000 (18:31 -0400)] 
Add missing include of unistd.h

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: use portable print format for size_t
Michael Jeanson [Tue, 30 May 2017 19:55:15 +0000 (15:55 -0400)] 
Port: use portable print format for size_t

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: internal logging print format for mingw
Michael Jeanson [Tue, 30 May 2017 19:38:24 +0000 (15:38 -0400)] 
Port: internal logging print format for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: replace strerror_r() with glib g_strerror()
Michael Jeanson [Fri, 9 Sep 2016 21:08:13 +0000 (21:08 +0000)] 
Port: replace strerror_r() with glib g_strerror()

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Use g_setenv instead of setenv
Michael Jeanson [Fri, 17 Feb 2017 20:11:16 +0000 (15:11 -0500)] 
Port: Use g_setenv instead of setenv

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Plugin extension is platform specific
Michael Jeanson [Wed, 15 Feb 2017 20:36:57 +0000 (15:36 -0500)] 
Port: Plugin extension is platform specific

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: No setuid on windows
Michael Jeanson [Fri, 13 Jan 2017 16:43:02 +0000 (11:43 -0500)] 
Port: No setuid on windows

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Use glib g_get_home_dir to get home dir on mingw
Michael Jeanson [Fri, 13 Jan 2017 16:42:31 +0000 (11:42 -0500)] 
Port: Use glib g_get_home_dir to get home dir on mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Dummy locking of stdout on mingw in libtap
Michael Jeanson [Thu, 15 Sep 2016 21:19:51 +0000 (21:19 +0000)] 
Port: Dummy locking of stdout on mingw in libtap

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add missing includes for mingw
Michael Jeanson [Fri, 21 Oct 2016 16:19:05 +0000 (12:19 -0400)] 
Port: Add missing includes for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: memstream compat for mingw
Michael Jeanson [Thu, 15 Sep 2016 15:18:11 +0000 (15:18 +0000)] 
Port: memstream compat for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Use portable format string for ISO 8601 dates
Michael Jeanson [Thu, 12 Jan 2017 17:08:26 +0000 (12:08 -0500)] 
Port: Use portable format string for ISO 8601 dates

The %F format string to reprensent ISO 8601 dates is specific to C99 and
not available on all platforms, use basic %Y-%m-%d to get the same
result.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: add missing include for stdio.h compat
Michael Jeanson [Thu, 15 Sep 2016 21:19:29 +0000 (21:19 +0000)] 
Port: add missing include for stdio.h compat

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add utsname.h compat for mingw
Michael Jeanson [Thu, 15 Sep 2016 20:52:05 +0000 (20:52 +0000)] 
Port: Add utsname.h compat for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add mman.h compat for mingw
Michael Jeanson [Thu, 15 Sep 2016 18:51:45 +0000 (14:51 -0400)] 
Port: Add mman.h compat for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Namespace tokens in ctf metadata parser/lexer
Michael Jeanson [Tue, 13 Sep 2016 16:21:33 +0000 (16:21 +0000)] 
Port: Namespace tokens in ctf metadata parser/lexer

Namespace generic types as they conflict on different platforms.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add posix_fallocate compat for mingw
Michael Jeanson [Tue, 13 Sep 2016 21:34:57 +0000 (21:34 +0000)] 
Port: Add posix_fallocate compat for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add timegm compat for mingw
Michael Jeanson [Thu, 15 Sep 2016 19:47:01 +0000 (19:47 +0000)] 
Port: Add timegm compat for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add time.h compat for mingw
Michael Jeanson [Tue, 13 Sep 2016 21:39:44 +0000 (21:39 +0000)] 
Port: Add time.h compat for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Disable debug info by default on mingw
Michael Jeanson [Mon, 12 Sep 2016 20:38:25 +0000 (20:38 +0000)] 
Port: Disable debug info by default on mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: win32 DLLs don't support hidden symbols
Michael Jeanson [Tue, 13 Sep 2016 20:38:17 +0000 (20:38 +0000)] 
Port: win32 DLLs don't support hidden symbols

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add missing byteswap compat for mingw
Michael Jeanson [Tue, 13 Sep 2016 20:37:26 +0000 (20:37 +0000)] 
Port: Add missing byteswap compat for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Fix libuuid compat on mingw
Michael Jeanson [Wed, 14 Sep 2016 17:45:37 +0000 (13:45 -0400)] 
Port: Fix libuuid compat on mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add AC_USE_SYSTEM_EXTENSIONS with mingw support
Michael Jeanson [Mon, 12 Sep 2016 20:37:31 +0000 (20:37 +0000)] 
Port: Add AC_USE_SYSTEM_EXTENSIONS with mingw support

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Add bt_common_get_page_size
Michael Jeanson [Mon, 12 Sep 2016 18:36:58 +0000 (18:36 +0000)] 
Port: Add bt_common_get_page_size

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Use glib portable macros to convert gpointer to int
Michael Jeanson [Mon, 12 Sep 2016 20:01:27 +0000 (20:01 +0000)] 
Port: Use glib portable macros to convert gpointer to int

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: use portable pointer type in bt_list_entry
Michael Jeanson [Tue, 13 Sep 2016 15:32:00 +0000 (15:32 +0000)] 
Port: use portable pointer type in bt_list_entry

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: test-utils-muxer.c: initialize "next" return with OK status
Philippe Proulx [Thu, 1 Jun 2017 21:25:51 +0000 (17:25 -0400)] 
Fix: test-utils-muxer.c: initialize "next" return with OK status

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: do not create empty structure for optional scope field types
Philippe Proulx [Thu, 1 Jun 2017 21:05:11 +0000 (17:05 -0400)] 
ir: do not create empty structure for optional scope field types

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agotest_ctf_writer.c: set PACKET_RESIZE_TEST_LENGTH to 100000 again
Philippe Proulx [Thu, 1 Jun 2017 21:04:03 +0000 (17:04 -0400)] 
test_ctf_writer.c: set PACKET_RESIZE_TEST_LENGTH to 100000 again

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoutils.muxer: remove upstream notif. iter. once ended/canceled
Philippe Proulx [Thu, 1 Jun 2017 20:27:36 +0000 (16:27 -0400)] 
utils.muxer: remove upstream notif. iter. once ended/canceled

This was not a bug, but it was a source of leak during the graph's
lifetime (upstream notification iterator does not exist anymore but
utils.muxer notification iterator keeps a structure associated to it.)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoconfigure.ac: use $enableval in AC_ARG_ENABLE()
Philippe Proulx [Thu, 1 Jun 2017 20:20:09 +0000 (16:20 -0400)] 
configure.ac: use $enableval in AC_ARG_ENABLE()

This allows all the following to work:

* --enable-x
* --enable-x=yes
* --enable-x=no
* --disable-x

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodoc/logging-guide.adoc: minor fixes + add "Instrument a module" section
Philippe Proulx [Wed, 31 May 2017 19:18:33 +0000 (15:18 -0400)] 
doc/logging-guide.adoc: minor fixes + add "Instrument a module" section

The new "Instrument a module" function documents the steps to instrument
a new module in a standard way.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: use standard logging files and macros
Philippe Proulx [Wed, 31 May 2017 18:32:36 +0000 (14:32 -0400)] 
cli: use standard logging files and macros

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agopython-plugin-provider: use standard logging files and macros
Philippe Proulx [Wed, 31 May 2017 17:01:36 +0000 (13:01 -0400)] 
python-plugin-provider: use standard logging files and macros

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/lttng-live: use standard logging files and macros
Philippe Proulx [Wed, 31 May 2017 16:57:58 +0000 (12:57 -0400)] 
plugins/ctf/lttng-live: use standard logging files and macros

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/btr: use standard logging files and macros
Philippe Proulx [Wed, 31 May 2017 16:52:27 +0000 (12:52 -0400)] 
plugins/ctf/common/btr: use standard logging files and macros

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agologging-internal.h: add BT_LOG_LEVEL_EXTERN_SYMBOL(), BT_LOG_INIT_LOG_LEVEL()
Philippe Proulx [Wed, 31 May 2017 16:48:52 +0000 (12:48 -0400)] 
logging-internal.h: add BT_LOG_LEVEL_EXTERN_SYMBOL(), BT_LOG_INIT_LOG_LEVEL()

BT_LOG_INIT_LOG_LEVEL() defines a hidden log level symbol and a static
constructor which initializes this symbol according to the value of
a given environment variable. This macro should be used in a module-wise
dedicated logging source file, `logging.c`, as such:

    #define BT_LOG_OUTPUT_LEVEL some_log_level_symbol
    #include <babeltrace/logging-internal.h>

    BT_LOG_INIT_LOG_LEVEL(some_log_level_symbol, "BABELTRACE_SOME_LOG_LEVEL");

BT_LOG_LEVEL_EXTERN_SYMBOL() declares this symbol as `extern`. It
should be used in a module-wise dedicated logging header, `logging.h`,
as such:

    #define BT_LOG_OUTPUT_LEVEL some_log_level_symbol
    #include <babeltrace/logging-internal.h>

    BT_LOG_LEVEL_EXTERN_SYMBOL(some_log_level_symbol);

Any module source file which contains log statements should use the
following lines **before any #include line**:

    #define BT_LOG_TAG "THE-MODULE-TAG"
    #include "logging.h"

If there are subdirectories within a module, it is possible that you
need to include "../logging.h" or "../../logging.h", for example. The
rule of thumb is that no module file, except `logging.c`, should include
<babeltrace/logging-internal.h> directly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/btr/btr.c: add logging
Philippe Proulx [Wed, 31 May 2017 16:34:26 +0000 (12:34 -0400)] 
plugins/ctf/common/btr/btr.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoLogging: require modules to define BT_LOG_OUTPUT_LEVEL
Philippe Proulx [Wed, 31 May 2017 14:42:33 +0000 (10:42 -0400)] 
Logging: require modules to define BT_LOG_OUTPUT_LEVEL

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agobt_value_get_type(): not a warning if value is NULL
Philippe Proulx [Wed, 31 May 2017 13:32:53 +0000 (09:32 -0400)] 
bt_value_get_type(): not a warning if value is NULL

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agobitfield-internal.h: fix negative value shifting warnings
Philippe Proulx [Wed, 31 May 2017 00:13:37 +0000 (20:13 -0400)] 
bitfield-internal.h: fix negative value shifting warnings

This patch makes _bt_unsigned_cast() shift the complement of 0 casted to
uint64_t instead of the complement of 0 casted to a possibly signed
type, which results in shifting a negative value, an undefined operation
in C.

Because we're imposing uint64_t now, the size of the type and value's
type cannot be greater than the size of uint64_t... not a considerable
worry with the current state of commercial computing. Having said that,
the new _bt_check_max_64bit() macro, a static assertion, checks that
those type sizes are not greater than the size of uint64_t at build
time.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agotests/lib: do not call bt_ctf_trace_set_native_byte_order() if not needed
Philippe Proulx [Tue, 30 May 2017 22:47:31 +0000 (18:47 -0400)] 
tests/lib: do not call bt_ctf_trace_set_native_byte_order() if not needed

It's not mandatory anymore to call bt_ctf_trace_set_native_byte_order()
on a trace object before it's frozen.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: add BT_CTF_BYTE_ORDER_NONE and make it the default trace's native BO
Philippe Proulx [Tue, 30 May 2017 22:27:28 +0000 (18:27 -0400)] 
ir: add BT_CTF_BYTE_ORDER_NONE and make it the default trace's native BO

There's a problem now where you need to explicitly set the native byte
order of a trace you create with bt_ctf_trace_create() with
bt_ctf_trace_set_native_byte_order() before the trace object is frozen,
otherwise the function which would cause the freezing fails.

Some trace formats have no byte order concept. Other properties like
alignment and binary field sizes may have no meaning either. Source
component classes which implement the decoding of those formats should
do a best effort to represent their trace's metadata using CTF IR. That
said, choosing an arbitrary trace's native byte order imposes this byte
order when a ctf.fs sink writes the trace. Here, BT_CTF_BYTE_ORDER_NONE
means that we don't care about the byte order, that it was not
meaningful when decoding the original trace, therefore you can choose
any output byte order you want.

With this patch, the initial trace's native byte order is
BT_CTF_BYTE_ORDER_NONE, and this is a valid byte order when the trace
needs to be frozen. A non-CTF writer trace cannot be used by a CTF
writer object anyway; a CTF writer always creates its own trace object.
The initial native byte order of a CTF writer trace is the machine's
byte order. You cannot set a CTF writer trace's native byte order to
BT_CTF_BYTE_ORDER_NONE. Also, you cannot set any field type's byte order
to BT_CTF_BYTE_ORDER_NONE: it's only valid for a non-CTF writer trace.

libctfcopytrace is modified to only explicitly set the CTF writer
trace's native byte order if the original trace's native byte order is
not BT_CTF_BYTE_ORDER_NONE.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoctf plugins: prepend trace's hostname, if exists, to trace name
Philippe Proulx [Tue, 30 May 2017 00:21:46 +0000 (20:21 -0400)] 
ctf plugins: prepend trace's hostname, if exists, to trace name

This makes the trace names a little more precise.

Note that as of this patch the visitor sets the trace's name just before
adding the first stream class, because after this, the trace is frozen
and we cannot set its name anymore. This is done as lately as possible
to increase our chance of having decoded the metadata's `env` block
(where the hostname is), if any. This can lead to an unnamed trace if
there's no stream classes. But if there's no stream classes, there can't
be any packet or event anyway, so there can't be any notification which
refers to this trace, so no other component should see the fact that
there's no name.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoctf.fs source: use last path parameter's element as base for trace names
Philippe Proulx [Mon, 29 May 2017 23:55:16 +0000 (19:55 -0400)] 
ctf.fs source: use last path parameter's element as base for trace names

Without this patch:

    Trace directory:  /home/user/my-traces/trace/yes/kernel
    `path` parameter: /home/user/my-traces/trace
    Trace name:                                      kernel

With this patch:

    Trace directory:  /home/user/my-traces/trace/yes/kernel
    `path` parameter: /home/user/my-traces/trace
    Trace name:                            trace/yes/kernel

This takes into account absolute vs. relative paths, resolves `..` and
`.`, and more. Most of the job is done by bt_common_normalize_path().
The process used to craft the trace names using the base directory as
passed by the user is really easy once all the paths are known to be
normalized.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoDocs: add informal comments to common-internal.h
Philippe Proulx [Mon, 29 May 2017 23:13:30 +0000 (19:13 -0400)] 
Docs: add informal comments to common-internal.h

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd bt_common_normalize_path()
Philippe Proulx [Mon, 29 May 2017 22:48:48 +0000 (18:48 -0400)] 
Add bt_common_normalize_path()

This new function does a part of realpath()'s job: it resolves `..` and
`.` in the path, resolves a relative path with a custom working
directory or the current working directory, and removes consecutive
separators (`/` or `\` depending on the platform) and the last
separator. The function always returns an absolute path. The function
does NOT resolve symbolic links.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agostream.c: allow stream PC's `events_discarded` field to be set by user
Philippe Proulx [Mon, 29 May 2017 20:15:00 +0000 (16:15 -0400)] 
stream.c: allow stream PC's `events_discarded` field to be set by user

If a stream packet context `events_discarded` field is set a flush time,
check if its value keeps the count monotonic, and use this value to set
the stream's current discarded events count if so. If it's not set, do
like before and set it automatically from the stream's current count.

This will make it possible for a ctf.fs sink component to write the
original `events_discarded` field without having to read it, compute
the difference with the previous value, and use
bt_ctf_stream_append_discarded_events() to change the stream's discarded
events count.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove remaining old test files
Philippe Proulx [Mon, 29 May 2017 19:49:09 +0000 (15:49 -0400)] 
Remove remaining old test files

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agotests/cli/Makefile.am: remove duplicate test in TESTS list
Philippe Proulx [Mon, 29 May 2017 19:47:01 +0000 (15:47 -0400)] 
tests/cli/Makefile.am: remove duplicate test in TESTS list

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: test_convert_args: use util.muxer's `assume-absolute-clock-classes` param
Philippe Proulx [Mon, 29 May 2017 19:45:08 +0000 (15:45 -0400)] 
Fix: test_convert_args: use util.muxer's `assume-absolute-clock-classes` param

util.muxer's `force-absolute` parameter is now named
`assume-absolute-clock-classes`. Modify test to satisfy this.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: test_ir_visit.c: create valid SC PC/EH and trace packet header
Philippe Proulx [Mon, 29 May 2017 19:33:55 +0000 (15:33 -0400)] 
Fix: test_ir_visit.c: create valid SC PC/EH and trace packet header

Since CTF IR is more strict regarding the semantics of trace packet
header, stream class packet context and event header field types, this
test fails because the default packet context field type of a stream
class which is not created for a CTF writer object contains
`timestamp_begin` and `timestamp_end` fields which are not mapped to a
clock class.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: test_ctf_ir_ref.c: create valid SC PC/EH and trace packet header
Philippe Proulx [Mon, 29 May 2017 19:27:23 +0000 (15:27 -0400)] 
Fix: test_ctf_ir_ref.c: create valid SC PC/EH and trace packet header

Since CTF IR is more strict regarding the semantics of trace packet
header, stream class packet context and event header field types, this
test fails because the default packet context field type of a stream
class which is not created for a CTF writer object contains
`timestamp_begin` and `timestamp_end` fields which are not mapped to a
clock class.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove warnings when using bt_plugin_create_all_from_dir()
Philippe Proulx [Mon, 29 May 2017 18:47:52 +0000 (14:47 -0400)] 
Remove warnings when using bt_plugin_create_all_from_dir()

bt_plugin_create_all_from_dir() expects an existing directory, otherwise
it fails with a WARN-level log message because it's the user's
responsibility to ensure this.

A few functions of the library and the CLI call this with nonexisting
paths, resulting in warnings under normal usage (for example, default
plugin search paths which do not exist; this is not an error nor a
warning).

This patch fixes this by testing the existence of the paths passed to
bt_plugin_create_all_from_dir() with g_file_test(), skipping (usually
with a VERBOSE-level message) when it's not the case.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.042312 seconds and 4 git commands to generate.