Philippe Proulx [Thu, 18 May 2017 18:51:12 +0000 (14:51 -0400)]
fields.c: get non-existing field: log level WARN -> VERBOSE
It is possible that a user needs to check if a structure field's field,
for example, is set (exists). If it does not, the given function returns
NULL, but this is not an error: the function is used to check here, not
to create the field.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 18 May 2017 18:50:11 +0000 (14:50 -0400)]
bt_ctf_event_serialize(): do not log whole function (done in stream.c)
We already log the current event being serialized in
bt_ctf_stream_flush(): do not log twice.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Wed, 17 May 2017 20:53:31 +0000 (16:53 -0400)]
Fix: lttng-live enum mismatch
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 17 May 2017 20:31:27 +0000 (16:31 -0400)]
lib/ctf-ir/field-types.c: use `int`, not `int64_t` for return value
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 17 May 2017 18:55:35 +0000 (14:55 -0400)]
Fix: lib/ctf-ir/event-class.c: fix warnings on `ret` condition
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 16 May 2017 21:35:42 +0000 (17:35 -0400)]
Fix: g_quark_try_string() is usually not a WARN trigger
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 16 May 2017 21:18:55 +0000 (17:18 -0400)]
Fix: set no field in event/packet without warnings or failing
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Tue, 16 May 2017 18:42:18 +0000 (14:42 -0400)]
lttng-live: handle EINTR and graph cancelation
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Tue, 16 May 2017 15:53:22 +0000 (11:53 -0400)]
Fix: invoke bt_ctf_trace_set_is_static only when trace is destroyed
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 16 May 2017 04:09:06 +0000 (00:09 -0400)]
lib/ctf-ir/utils.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 16 May 2017 04:06:04 +0000 (00:06 -0400)]
lib/ctf-ir/fields.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 16 May 2017 02:37:00 +0000 (22:37 -0400)]
lib/values.c: add more verbose/debug logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 16 May 2017 02:36:47 +0000 (22:36 -0400)]
lib/ctf-ir/packet.c: add more debug logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 16 May 2017 02:35:32 +0000 (22:35 -0400)]
lib/ctf-ir/event-class.c: add more verbose/debug logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This page took 0.04158 seconds and 4 git commands to generate.