babeltrace.git
7 years agolib/ctf-ir/attributes.c: add assert()
Philippe Proulx [Tue, 16 May 2017 02:34:27 +0000 (22:34 -0400)] 
lib/ctf-ir/attributes.c: add assert()

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUpdate logging guide: more about the WARN level
Philippe Proulx [Tue, 16 May 2017 02:13:25 +0000 (22:13 -0400)] 
Update logging guide: more about the WARN level

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/field-types.c: logging: log more details
Philippe Proulx [Tue, 16 May 2017 02:03:53 +0000 (22:03 -0400)] 
lib/ctf-ir/field-types.c: logging: log more details

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/event.c: logging: fix log levels and more verbose/debug logging
Philippe Proulx [Tue, 16 May 2017 01:08:06 +0000 (21:08 -0400)] 
lib/ctf-ir/event.c: logging: fix log levels and more verbose/debug logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/field-types.c: logging: log struct/var FT field destruction
Philippe Proulx [Tue, 16 May 2017 01:01:02 +0000 (21:01 -0400)] 
lib/ctf-ir/field-types.c: logging: log struct/var FT field destruction

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/field-types.c: logging: log only specific functions
Philippe Proulx [Tue, 16 May 2017 00:57:45 +0000 (20:57 -0400)] 
lib/ctf-ir/field-types.c: logging: log only specific functions

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/field-types.c: logging: log more details when freezing
Philippe Proulx [Tue, 16 May 2017 00:42:24 +0000 (20:42 -0400)] 
lib/ctf-ir/field-types.c: logging: log more details when freezing

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolttng-live: change loglevel env var to BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_LOG_LEVEL
Mathieu Desnoyers [Mon, 15 May 2017 21:37:30 +0000 (17:37 -0400)] 
lttng-live: change loglevel env var to BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_LOG_LEVEL

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolttng-live: ensure that port connections go to the same component
Mathieu Desnoyers [Mon, 15 May 2017 21:33:38 +0000 (17:33 -0400)] 
lttng-live: ensure that port connections go to the same component

Also has tiny cleanups.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: don't call iterator finalize more than once
Mathieu Desnoyers [Mon, 15 May 2017 20:44:09 +0000 (16:44 -0400)] 
Fix: don't call iterator finalize more than once

A finalize may have side-effects that trigger port removal, thus calling
finalize again. Ensure it is not called more than once.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: muxer: handle CANCELED status
Mathieu Desnoyers [Mon, 15 May 2017 15:48:32 +0000 (11:48 -0400)] 
Fix: muxer: handle CANCELED status

Since commit bbd6694a2 "Collect useless graph's connections", the
lttng-live component may return a CANCELED state to the muxer. The muxer
should deal with this state as an "END" state.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUpdate logging guide
Philippe Proulx [Mon, 15 May 2017 19:51:32 +0000 (15:51 -0400)] 
Update logging guide

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/field-types.c: add verbose logging (modifying functions)
Philippe Proulx [Mon, 15 May 2017 19:50:28 +0000 (15:50 -0400)] 
lib/ctf-ir/field-types.c: add verbose logging (modifying functions)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoLTTng live: use common url parser
Mathieu Desnoyers [Mon, 15 May 2017 14:48:10 +0000 (10:48 -0400)] 
LTTng live: use common url parser

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoImplement cmd_print_lttng_live_sessions
Mathieu Desnoyers [Fri, 12 May 2017 21:10:27 +0000 (17:10 -0400)] 
Implement cmd_print_lttng_live_sessions

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/values.c: use assert() instead of checking error
Philippe Proulx [Sun, 14 May 2017 21:34:18 +0000 (17:34 -0400)] 
lib/values.c: use assert() instead of checking error

In this case we know that it should not fail.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/stream-class.c: logging: fix typo
Philippe Proulx [Sun, 14 May 2017 21:33:59 +0000 (17:33 -0400)] 
lib/ctf-ir/stream-class.c: logging: fix typo

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoLogging: use WARN level where appropriate
Philippe Proulx [Sun, 14 May 2017 21:33:09 +0000 (17:33 -0400)] 
Logging: use WARN level where appropriate

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/field-types.c: add logging
Philippe Proulx [Sun, 14 May 2017 21:32:00 +0000 (17:32 -0400)] 
lib/ctf-ir/field-types.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agocli/babeltrace.c: logging: add details in graph listeners
Philippe Proulx [Sun, 14 May 2017 21:31:26 +0000 (17:31 -0400)] 
cli/babeltrace.c: logging: add details in graph listeners

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/field-path.c: add logging
Philippe Proulx [Sun, 14 May 2017 07:14:41 +0000 (03:14 -0400)] 
lib/ctf-ir/field-path.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/values.c: logging: log original and copy addresses
Philippe Proulx [Sun, 14 May 2017 07:14:20 +0000 (03:14 -0400)] 
lib/values.c: logging: log original and copy addresses

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ref.c: logging: show current count and new count in messages
Philippe Proulx [Sun, 14 May 2017 06:55:24 +0000 (02:55 -0400)] 
lib/ref.c: logging: show current count and new count in messages

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/stream-class.c: add logging
Philippe Proulx [Sun, 14 May 2017 06:05:28 +0000 (02:05 -0400)] 
lib/ctf-ir/stream-class.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/event.c: logging: remove some context given by other statement
Philippe Proulx [Sun, 14 May 2017 04:49:15 +0000 (00:49 -0400)] 
lib/ctf-ir/event.c: logging: remove some context given by other statement

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/values.c: logging: log array size when out of bound
Philippe Proulx [Sun, 14 May 2017 04:22:54 +0000 (00:22 -0400)] 
lib/values.c: logging: log array size when out of bound

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/event-class.c: add logging
Philippe Proulx [Sun, 14 May 2017 03:01:09 +0000 (23:01 -0400)] 
lib/ctf-ir/event-class.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/event.c: add logging
Philippe Proulx [Sun, 14 May 2017 01:27:36 +0000 (21:27 -0400)] 
lib/ctf-ir/event.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAdd internal bt_ctf_field_type_id_string()/byte_order_string()
Philippe Proulx [Sun, 14 May 2017 01:26:44 +0000 (21:26 -0400)] 
Add internal bt_ctf_field_type_id_string()/byte_order_string()

This is to be used by logging.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/values.c: logging: log value's type name
Philippe Proulx [Sun, 14 May 2017 01:25:39 +0000 (21:25 -0400)] 
lib/values.c: logging: log value's type name

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/clock-class.c: improve logging with clock class's name
Philippe Proulx [Sat, 13 May 2017 23:15:22 +0000 (19:15 -0400)] 
lib/ctf-ir/clock-class.c: improve logging with clock class's name

Clock class log statements should be easier to follow with a clock
class's name field.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoInclude <babeltrace/lib-logging-internal.h> before anything else
Philippe Proulx [Sat, 13 May 2017 22:54:01 +0000 (18:54 -0400)] 
Include <babeltrace/lib-logging-internal.h> before anything else

This makes sure that headers which would need this to be included see
what it defines.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agocli/babeltrace.c: improve main loop's logging
Philippe Proulx [Sat, 13 May 2017 22:51:10 +0000 (18:51 -0400)] 
cli/babeltrace.c: improve main loop's logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agocli/babeltrace.c: handle usleep()'s error
Philippe Proulx [Sat, 13 May 2017 22:44:45 +0000 (18:44 -0400)] 
cli/babeltrace.c: handle usleep()'s error

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/packet.c: add logging
Philippe Proulx [Sat, 13 May 2017 19:57:47 +0000 (15:57 -0400)] 
lib/ctf-ir/packet.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agocli/babeltrace.c: do not call load_all_plugins() in commands
Philippe Proulx [Sat, 13 May 2017 19:57:10 +0000 (15:57 -0400)] 
cli/babeltrace.c: do not call load_all_plugins() in commands

main() already calls load_all_plugins() when the configuration asks to.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agologging-internal.h: fix include name in comments
Philippe Proulx [Sat, 13 May 2017 19:12:52 +0000 (15:12 -0400)] 
logging-internal.h: fix include name in comments

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoinclude/babeltrace/object-internal.h: add logging
Philippe Proulx [Sat, 13 May 2017 19:08:24 +0000 (15:08 -0400)] 
include/babeltrace/object-internal.h: add logging

Because the static inline functions are instrumented in the header
itself, it cannot have its own tag. So this header MUST be included
AFTER including <babeltrace/logging-internal.h>, or anything that
includes this (like <babeltrace/lib-logging-internal.h>).

ctf.lttng-live is modified to respect this, as well as various
instrumented library source files.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoCollect useless graph's connections
Philippe Proulx [Sat, 13 May 2017 17:17:45 +0000 (13:17 -0400)] 
Collect useless graph's connections

Before this patch, the connections accumulate in the graph's array of
connections and are never destroyed until the graph is destroyed.
However, because it is possible to disconnect the ports of a connection,
it is possible that a graph contains connections that are useless. This
can cause a "leak" of connections, which would be especially experienced
with a graph that contains a source which dynamically adds and removes
many ports that are connected during its lifetime.

The conditions for a connection to be considered useless are:

1. Its reference count is 0. This means only its parent, the graph,
   controls its existence.
2. Its ports are disconnected.
3. All its created notification iterators are finalized.

When all the conditions above are satisfied, it is safe to remove the
connection from its parent graph.

Conditions 2 and 3 can be checked in:

* bt_connection_disconnect_ports(): The connection is dead, detached
  from its ports, and vice versa, thus satisfying condition 2.
* bt_connection_remove_iterator(): The number of notification iterators
  changes; could drop to 0, thus satisfying condition 3.

To accomodate condition 1, a new concept is added to the base object: it
is possible to set a "parent is owner" listener which is called when the
parent becomes the owner of the object (that is, when the object's
reference count drops to 0 and it has a parent). Connection objects use
this callback to possibly remove itself from its parent when all three
conditions above are satisfied.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoImplement logging in lttng-live component
Mathieu Desnoyers [Fri, 12 May 2017 22:07:51 +0000 (18:07 -0400)] 
Implement logging in lttng-live component

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agocli/babeltrace.c: add logging when the command completes
Philippe Proulx [Sat, 13 May 2017 01:16:15 +0000 (21:16 -0400)] 
cli/babeltrace.c: add logging when the command completes

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agobabeltrace(1): handle SIGINT to cancel the graph gracefully
Philippe Proulx [Sat, 13 May 2017 01:14:11 +0000 (21:14 -0400)] 
babeltrace(1): handle SIGINT to cancel the graph gracefully

It goes like this:

1. Ctrl+C
2. SIGINT
3. sigint_handler()
4. Cancel the application's graph.
5. bt_graph_run() eventually returns BT_GRAPH_STATUS_CANCELED or
   BT_GRAPH_STATUS_AGAIN.
6. When we get those statuses, we check if the graph is canceled and
   quit the loop if so.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix possible leaks in graph's current design
Philippe Proulx [Sat, 13 May 2017 00:34:50 +0000 (20:34 -0400)] 
Fix possible leaks in graph's current design

There was a possible leak when, for example:

* The user has a reference to the graph.
* The graph holds its child sink component.
* The sink component has a reference to a notification iterator.
* The notification iterator has a reference to the source component.
* The source component has a reference to its parent, the graph, because
  its reference count is 1 (owned by the notification iterator).

This forms a cycle: sink component owns the notification iterator, which
owns the source component, which owns the graph, which holds the sink
component.

To break this cycle and still guarantee that the lifetime of a
notification iterator's upstream component is equal to or longer than
this iterator's lifetime, we split the notification iterator's
destruction and finalization (user's finalization method) phases. In
other words, a notification iterator can be finalized without being
destroyed. However it is guaranteed that it is always finalized once
destroyed.

A connection keeps a set of created notification iterators (weak
references). There are two possible paths to finalize a notification
iterator:

1. The graph still exists and is not being destroyed, and the final
   reference to the notification iterator is put: the notification
   is destroyed, and since it has not been finalized yet, it's
   finalized during that phase.

2. The graph is being destroyed, and an owner (or more) still owns a
   reference to the notification iterator. The graph's destructor first
   destroys the graph's connections. Each connection finalizes each
   notification iterator in its list, but does not destroy them.
   The notification iterators are marked as finalized. Eventually the
   graph destroys its components, some of which could put the last
   reference to a notification iterator: the notification iterator is
   destroyed, but not finalized twice.

When a notification iterator is marked as finalized, calling its "next"
method returns the new BT_NOTIFICATION_ITERATOR_STATUS_CANCELED status
when its queue is empty (instead of BT_NOTIFICATION_ITERATOR_STATUS_END).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoBT_GRAPH_STATUS_CANCELED is not an error, thus use a positive value
Philippe Proulx [Sat, 13 May 2017 00:33:32 +0000 (20:33 -0400)] 
BT_GRAPH_STATUS_CANCELED is not an error, thus use a positive value

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoImplement ctf.lttng-live component
Mathieu Desnoyers [Fri, 25 Nov 2016 21:25:14 +0000 (16:25 -0500)] 
Implement ctf.lttng-live component

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: IR visitor: error msg printing
Mathieu Desnoyers [Thu, 13 Apr 2017 16:02:55 +0000 (12:02 -0400)] 
Fix: IR visitor: error msg printing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoMove print.h header to upper level dir
Mathieu Desnoyers [Wed, 30 Nov 2016 22:32:23 +0000 (17:32 -0500)] 
Move print.h header to upper level dir

Can be used by both fs and lttng-live.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoutils.muxer: fix ownership of objects
Philippe Proulx [Fri, 12 May 2017 19:38:47 +0000 (15:38 -0400)] 
utils.muxer: fix ownership of objects

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAdd graph cancellation API
Philippe Proulx [Thu, 11 May 2017 21:54:10 +0000 (17:54 -0400)] 
Add graph cancellation API

With this API you can cancel a graph with bt_graph_cancel() and
check if a graph is canceled with bt_graph_is_canceled().

A canceled graph is used to indicate to a contained component or
notification iterator if it should retry or not when a system call is
interrupted. This exists mostly to support a clean termination when we
get SIGINT, but with debugger support (a system call is interrupted when
the debugger sends SIGCONT; in this case we need to retry the system
call).

Cancelling a graph also makes bt_graph_run() quit before the next
sink consuming iteration.

It is not allowed to run a canceled graph again. Once it is canceled,
it's dead for good.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoport.{h,c}: use `bt_bool` instead of `int` where appropriate
Philippe Proulx [Thu, 11 May 2017 21:44:25 +0000 (17:44 -0400)] 
port.{h,c}: use `bt_bool` instead of `int` where appropriate

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoir: utils: use `bt_bool` instead of `int` where appropriate
Philippe Proulx [Thu, 11 May 2017 21:41:30 +0000 (17:41 -0400)] 
ir: utils: use `bt_bool` instead of `int` where appropriate

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoir: fields/field-types: use `bt_bool` instead of `int` where appropriate
Philippe Proulx [Thu, 11 May 2017 21:40:55 +0000 (17:40 -0400)] 
ir: fields/field-types: use `bt_bool` instead of `int` where appropriate

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoir: clock class: use bt_bool instead of int for boolean properties
Philippe Proulx [Thu, 11 May 2017 21:21:26 +0000 (17:21 -0400)] 
ir: clock class: use bt_bool instead of int for boolean properties

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDo not use `bool` type; use new `bt_bool` instead
Philippe Proulx [Thu, 11 May 2017 21:12:46 +0000 (17:12 -0400)] 
Do not use `bool` type; use new `bt_bool` instead

There are possible ABI incompatibilities between C99's `bool` (`_Bool`)
type and C++'s `bool` type, and also between different compilers. For
this reason we choose to use our own boolean type, `bt_bool`, which is
defined as `int`. `BT_FALSE` and `BT_TRUE` are our own definitions for
false and true.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUpdate include/babeltrace/babeltrace.h
Philippe Proulx [Thu, 11 May 2017 17:26:34 +0000 (13:26 -0400)] 
Update include/babeltrace/babeltrace.h

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAdd extras/gen-babeltrace-h.py: include/babeltrace/babeltrace.h generator
Philippe Proulx [Thu, 11 May 2017 17:24:53 +0000 (13:24 -0400)] 
Add extras/gen-babeltrace-h.py: include/babeltrace/babeltrace.h generator

This Python 3 script reads include/Makefile.am and prints the
equivalent content of include/babeltrace/babeltrace.h. From the
source tree's root, you can use it as such:

    $ python3 extras/gen-babeltrace-h.py > include/babeltrace/babeltrace.h

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoMove library's version API to include/babeltrace/version.h
Philippe Proulx [Thu, 11 May 2017 17:23:19 +0000 (13:23 -0400)] 
Move library's version API to include/babeltrace/version.h

Let's keep include/babeltrace/babeltrace.h a master header only.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoinclude/Makefile.am: add titles (comments) to groups of files
Philippe Proulx [Thu, 11 May 2017 17:03:17 +0000 (13:03 -0400)] 
include/Makefile.am: add titles (comments) to groups of files

This is because I intend to use this file to automatically generate
include/babeltrace/babeltrace.h.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove "end of trace" notification headers
Philippe Proulx [Thu, 11 May 2017 16:49:12 +0000 (12:49 -0400)] 
Remove "end of trace" notification headers

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoNormalize public header include guards
Philippe Proulx [Thu, 11 May 2017 16:46:12 +0000 (12:46 -0400)] 
Normalize public header include guards

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ref.c: add logging
Philippe Proulx [Thu, 11 May 2017 06:17:38 +0000 (02:17 -0400)] 
lib/ref.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/clock-class.c: add logging
Philippe Proulx [Thu, 11 May 2017 06:07:43 +0000 (02:07 -0400)] 
lib/ctf-ir/clock-class.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agotest_ctf_writer.c: remove negative index tests
Philippe Proulx [Thu, 11 May 2017 05:12:20 +0000 (01:12 -0400)] 
test_ctf_writer.c: remove negative index tests

The API's type for indexes is always an unsigned integer now, so we
don't need those tests anymore.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/ctf-ir/attributes.c: add logging
Philippe Proulx [Thu, 11 May 2017 05:12:04 +0000 (01:12 -0400)] 
lib/ctf-ir/attributes.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoir: attributes: fix index and count integer types
Philippe Proulx [Thu, 11 May 2017 05:11:41 +0000 (01:11 -0400)] 
ir: attributes: fix index and count integer types

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolib/values.c: add logging
Philippe Proulx [Thu, 11 May 2017 03:50:18 +0000 (23:50 -0400)] 
lib/values.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agotests/lib/Makefile.am: fix check_ vs. noinst_ prefix
Philippe Proulx [Thu, 11 May 2017 03:49:29 +0000 (23:49 -0400)] 
tests/lib/Makefile.am: fix check_ vs. noinst_ prefix

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agocli: add logging
Philippe Proulx [Wed, 10 May 2017 17:35:50 +0000 (13:35 -0400)] 
cli: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agocommon: optimize color code functions
Philippe Proulx [Wed, 10 May 2017 06:07:36 +0000 (02:07 -0400)] 
common: optimize color code functions

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix CLI to work with multiple ports and dynamically added ports
Philippe Proulx [Mon, 8 May 2017 17:04:40 +0000 (13:04 -0400)] 
Fix CLI to work with multiple ports and dynamically added ports

This patch makes the CLI actually connect component ports within the
application's graph before running it.

On the command line, you specify the connections like you used to,
except that the ports are not specific ports anymore: they are globbing
patterns (only the `*` special character is supported as of this
version) which specify: when a new upstream port matches the left part
of the connection argument (specific component and port name globbing
pattern), connect it to the first port that matches the right part
(specific component and port name globbing pattern). For example:

    src.*meow*:sink.master-*

would make babeltrace(1) connect all the ports of the component instance
`src` of which the names match `*meow*` to the next available port
of the instance `sink` of which the name matches `master-*`.

This mechanism allows to connect specific ports together, or to connect
group of ports or any ports using wildcards.

The code for the globbing pattern matching was grabbed from the
LTTng-UST project and I'm one of the copyright holders anyway.

This patch also adds a --retry-duration option to the `connect` and
`run` commands to specify how many microseconds the program should
wait when the graph returns BT_GRAPH_STATUS_AGAIN (do not wait when 0).
The default duration is 100 ms.

Some files are renamed to match what they really are. The concept of a
Babeltrace configuration (`bt_config`) is beyond the command-line
arguments: it could eventually be read from a configuration file, etc.
babeltrace-cfg-cli-args.c is a module which can create a Babeltrace
configuration out of command-line arguments.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAdd logging API (internal to log, public to set the current log level)
Philippe Proulx [Mon, 8 May 2017 17:04:03 +0000 (13:04 -0400)] 
Add logging API (internal to log, public to set the current log level)

See doc/logging-guide.adoc which explains the whole logging API, how to
set and initialize the log levels, how to write logging statements, etc.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agobt_common_shell_quote(): accept new parameter `with_single_quotes`
Philippe Proulx [Mon, 8 May 2017 23:40:27 +0000 (19:40 -0400)] 
bt_common_shell_quote(): accept new parameter `with_single_quotes`

This parameter indicates if the function must put the initial and final
`'` character itself or if it's the caller's job.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRename tests/bin -> tests/cli
Philippe Proulx [Fri, 5 May 2017 20:49:32 +0000 (16:49 -0400)] 
Rename tests/bin -> tests/cli

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoconfigure.ac: define BT_ENABLE_DEBUG_INFO depending on the support
Philippe Proulx [Fri, 5 May 2017 20:47:17 +0000 (16:47 -0400)] 
configure.ac: define BT_ENABLE_DEBUG_INFO depending on the support

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoctf.fs source: metadata: fix error paths
Philippe Proulx [Fri, 5 May 2017 20:46:41 +0000 (16:46 -0400)] 
ctf.fs source: metadata: fix error paths

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agotests/bin/test_convert_args: fix after updating CLI
Philippe Proulx [Fri, 5 May 2017 20:45:53 +0000 (16:45 -0400)] 
tests/bin/test_convert_args: fix after updating CLI

Mostly component instance names that are changed.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agotests: put TESTS list in each Makefile.am
Philippe Proulx [Fri, 5 May 2017 20:45:11 +0000 (16:45 -0400)] 
tests: put TESTS list in each Makefile.am

So that you can do `make check` in any subdirectory to run only those
tests.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoplugins/ctf/fs-src/data-stream.c: fix text width
Philippe Proulx [Fri, 5 May 2017 19:29:52 +0000 (15:29 -0400)] 
plugins/ctf/fs-src/data-stream.c: fix text width

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agobabeltrace-internal.h: remove unused declarations
Philippe Proulx [Fri, 5 May 2017 17:56:03 +0000 (13:56 -0400)] 
babeltrace-internal.h: remove unused declarations

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDo not use printf_warning() in the library
Philippe Proulx [Fri, 5 May 2017 17:55:51 +0000 (13:55 -0400)] 
Do not use printf_warning() in the library

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRename writer.writer -> ctf.fs (sink) and standardize plugin descriptions
Philippe Proulx [Fri, 5 May 2017 17:54:23 +0000 (13:54 -0400)] 
Rename writer.writer -> ctf.fs (sink) and standardize plugin descriptions

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRename debug_info.debug_info -> lttng-utils.debug-info
Philippe Proulx [Fri, 5 May 2017 17:12:29 +0000 (13:12 -0400)] 
Rename debug_info.debug_info -> lttng-utils.debug-info

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agodebug-info.debug-info: do not use global opt_* symbols anymore
Philippe Proulx [Fri, 5 May 2017 16:53:54 +0000 (12:53 -0400)] 
debug-info.debug-info: do not use global opt_* symbols anymore

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: ir: bt_ctf_field_type_variant_validate(): do not compare to tag length
Philippe Proulx [Tue, 2 May 2017 21:19:53 +0000 (17:19 -0400)] 
Fix: ir: bt_ctf_field_type_variant_validate(): do not compare to tag length

Because the same label can map to multiple values in an enumeration FT,
the number of fields in a variant FT does not need to be the same as the
number of mappings in its tag FT for the variant FT to be considered
valid.

Relax this by only making sure that each tag FT mapping has an entry in
the variant FT which shares the same name. Unused variant FT
fields/choices are not a problem per se, just a waste of space.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoSubscribe to notifications when creating a notif. iterator
Philippe Proulx [Tue, 2 May 2017 20:42:16 +0000 (16:42 -0400)] 
Subscribe to notifications when creating a notif. iterator

bt_private_connection_create_notification_iterator() now accepts a new
parameter which is a BT_NOTIFICATION_TYPE_SENTINEL-terminated array of
notification types to subscribe to. It is guaranteed that, after any
bt_notification_iterator_next() called on the created iterator (if the
status is BT_NOTIFICATION_ITERATOR_STATUS_OK), the following call to
bt_notification_iterator_get_notification() returns a notification to
which the iterator is subscribed.

You can pass NULL to the notification types parameter of
bt_private_connection_create_notification_iterator() to subscribe to all
existing notifications (including the ones that will be added to the
following versions of the library).

The use case behind the subscription mechanism is for a notification
iterator to avoid the generation of automatic notifications when the
iterator's user does not expect them anyway. This should be the case of
some filters and sinks, text.pretty being a current example (only needs
event notifications).

Tests and existing plugins are updated accordingly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agonotif-iter.c: fix warnings
Philippe Proulx [Tue, 2 May 2017 19:27:45 +0000 (15:27 -0400)] 
notif-iter.c: fix warnings

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoMake bt_ctf_event_class_create() create an empty context FT
Philippe Proulx [Tue, 2 May 2017 19:19:34 +0000 (15:19 -0400)] 
Make bt_ctf_event_class_create() create an empty context FT

This is in line with bt_ctf_trace_create() and
bt_ctf_stream_class_create_empty(). You can get the empty context FT
with bt_ctf_event_class_get_context_type() after creation and add fields
to it.

Update tests accordingly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAdd bt_ctf_stream_class_create_empty()
Philippe Proulx [Tue, 2 May 2017 19:19:20 +0000 (15:19 -0400)] 
Add bt_ctf_stream_class_create_empty()

The new bt_ctf_stream_class_create_empty() function creates a new
stream class object with its packet context, event header, and event
context field types set to empty structure field types.

This is more appropriate for source components which do not need the
default fields that bt_ctf_stream_class_create() creates.
bt_ctf_stream_class_create() is kept as is for backward compatibility
with pre-2.0 CTF writer.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove BT_CTF_FIELD_TYPE_UNTAGGED_VARIANT
Philippe Proulx [Tue, 2 May 2017 18:46:37 +0000 (14:46 -0400)] 
Remove BT_CTF_FIELD_TYPE_UNTAGGED_VARIANT

Also make CTF_TYPE_UNTAGGED_VARIANT have the same value as
CTF_TYPE_VARIANT: there's no distinction now.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoInternalize trace listener API and bt_ctf_trace_get_metadata_string()
Philippe Proulx [Tue, 2 May 2017 18:27:24 +0000 (14:27 -0400)] 
Internalize trace listener API and bt_ctf_trace_get_metadata_string()

Since the trace listener API is internal now, remove
test_trace_listener.c because it cannot find the function symbols.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoir: make bt_ctf_trace_create() create an empty packet header FT
Philippe Proulx [Tue, 2 May 2017 18:17:48 +0000 (14:17 -0400)] 
ir: make bt_ctf_trace_create() create an empty packet header FT

Currently bt_ctf_trace_create() creates an initial default packet header
field type with the `magic`, `uuid`, and `stream_id` fields. This is, in
fact, specific to CTF writer. Since the trace API is not public yet,
move this default packet header FT creation from bt_ctf_trace_create()
to bt_ctf_writer_create() to ensure backward compatibility.

This patch also fixes a few things in the API doc. of trace.h.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoutils.muxer: add and handle `ignore-absolute` parameter
Philippe Proulx [Tue, 2 May 2017 17:56:30 +0000 (13:56 -0400)] 
utils.muxer: add and handle `ignore-absolute` parameter

The utils.muxer's `ignore-absolute` parameter controls whether sorting
with non-absolute clock classes is an error or not. It is false by
default (non-absolute clock classes are not permitted).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove default port API
Philippe Proulx [Tue, 2 May 2017 17:14:20 +0000 (13:14 -0400)] 
Remove default port API

With the possibility of creating new ports for the whole lifetime of
a component, default ports aren't so useful and their name is
arbitrary. We don't need this for the 2.0 target.

The existing component classes are changed like so:

* debug-info.debug-info [filter]: one `in` input port and one `out`
  output port

* text.pretty [sink]: one `in` input port

* utils.dummy [sink]: one `in` input port

* utils.trimmer [filter]: one `in` input port and one `out` output port

* writer.writer [sink]: one `in` input port

Tests are updated accordingly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agotrace.h: API doc: do not mention listener (now internal)
Philippe Proulx [Tue, 2 May 2017 16:44:49 +0000 (12:44 -0400)] 
trace.h: API doc: do not mention listener (now internal)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agovisitor-generate-ir.c: fix some error reporting terms
Philippe Proulx [Tue, 2 May 2017 16:43:01 +0000 (12:43 -0400)] 
visitor-generate-ir.c: fix some error reporting terms

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agovisitor-generate-ir.c: set trace object's UUID
Philippe Proulx [Tue, 2 May 2017 16:34:16 +0000 (12:34 -0400)] 
visitor-generate-ir.c: set trace object's UUID

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRename bt_ctf_trace_get_byte_order() -> bt_ctf_trace_get_native_byte_order()
Philippe Proulx [Tue, 2 May 2017 16:33:19 +0000 (12:33 -0400)] 
Rename bt_ctf_trace_get_byte_order() -> bt_ctf_trace_get_native_byte_order()

Also fix associated API doc.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoir: add trace UUID getter and setter
Philippe Proulx [Tue, 2 May 2017 16:18:38 +0000 (12:18 -0400)] 
ir: add trace UUID getter and setter

The trace object's creation does not generate a UUID anymore: a new
trace starts with an unset UUID. When you create a CTF writer object, it
creates a trace object, generates a UUID, and set its trace's UUID. This
ensures backward compatibility with pre-2.0 CTF writer while allowing a
new trace object to have no UUID.

Tests are updated accordingly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoutils.muxer: fix bad behaviour caused by notification buffering
Philippe Proulx [Tue, 2 May 2017 05:27:58 +0000 (01:27 -0400)] 
utils.muxer: fix bad behaviour caused by notification buffering

In some cases, buffering a single notification (that is, selecting in
advance what will be the next notification returned by the next call to
the "next" method) can introduce a bad behaviour in a utils.muxer
component.

For example, it is possible that an upstream notification iterator's
"next" method be called twice without any explicit sleep between both
calls even if the first call returned the
BT_NOTIFICATION_ITERATOR_STATUS_AGAIN status.

This patch fixes this so that there's no more buffering: the youngest
notification is chosen in the scope of the "next" method, with any
required newly connected port handling and upstream iterators to advance
done before, and any BT_NOTIFICATION_ITERATOR_STATUS_AGAIN status is
returned directly.

For this we introduce the concept of validity for an upstream
notification iterator. A valid upstream notification iterator is one of
which the current notification must be considered for the next muxing
operation. An invalid upstream notification iterator must be validated
(its "next" method must be called and return
BT_NOTIFICATION_ITERATOR_STATUS_OK) before we can consider its current
notification. In the muxer notification iterator's "next" method, the
youngest notification is chosen only when all the non-terminated
upstream notification iterators are valid, and only when there's no
unhandled newly connected ports left. When the notification is taken
from the youngest upstream notification iterator, it is invalidated: it
must be validated again during the following "next" method call.

Tests are updated accordingly. Two generated
BT_NOTIFICATION_ITERATOR_STATUS_AGAIN statuses in the source were
necessary for one expected BT_NOTIFICATION_ITERATOR_STATUS_AGAIN status
returned by the muxer: now the generated sequence of notifications and
what the sink sees are perfectly synchronized.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoSet private port's user data on creation
Philippe Proulx [Thu, 27 Apr 2017 23:17:04 +0000 (19:17 -0400)] 
Set private port's user data on creation

With separate port creation and user data setting calls, the following
scenario is problematic:

    Source adds a port (private data is not set yet)
      Graph user's "port added" callback is called
        This callback connects the new port to a sink port
          This sink's "port connected" method is called
            This sink creates a notification iterator on the connected
            port's connection
              The source's notification iterator initialization method
              is called with the added port with NO private data yet

With this change, it is guaranteed that as soon as the port can be
accessed by any user, its private data is set.

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