Philippe Proulx [Tue, 18 Jul 2017 23:44:43 +0000 (19:44 -0400)]
Fix: visit_event_decl(): always set stream_id variable
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Wed, 12 Jul 2017 20:23:11 +0000 (16:23 -0400)]
Fix: don't store an int64_t value in a ptr
The key of the stream_classes GHashTable was a int64_t stored directly
in a pointer which works only on 64bits platform. Instead, allocate a
int64_t value and use a pointer to it as the key.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Wed, 12 Jul 2017 19:14:54 +0000 (15:14 -0400)]
Fix: use extern for variables instead of BT_HIDDEN
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Fri, 7 Jul 2017 20:59:13 +0000 (20:59 +0000)]
Fix: logging in socket-internal.h
Log statements in static inline functions must be ifdefed.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Fri, 14 Jul 2017 18:50:31 +0000 (14:50 -0400)]
Fix: remove g_ptr_array_insert to keep glib 2.22 compat
closes #1120
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Mon, 10 Jul 2017 16:36:50 +0000 (12:36 -0400)]
Fix: g_hash_table_insert returns 'void' in glib <= 2.39.2
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Mon, 10 Jul 2017 15:55:20 +0000 (11:55 -0400)]
Fix: G_SPAWN_DEFAULT was introduced in glib 2.37.6
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Mon, 17 Jul 2017 19:30:29 +0000 (15:30 -0400)]
Pretty plugin: only print negative timestamp warning once per component
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Mon, 17 Jul 2017 19:26:07 +0000 (15:26 -0400)]
Fix test: packet seq num has too large offset_s
The offset_s values multiplied by
1000000000 overflows 64-bit.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 13 Jul 2017 21:16:09 +0000 (17:16 -0400)]
ctf: visitor-generate-ir: accept negative clock offsets
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 13 Jul 2017 20:35:33 +0000 (16:35 -0400)]
Fix: clock-class.c: cache ns from Epoch and check for overflows
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 13 Jul 2017 16:18:29 +0000 (12:18 -0400)]
Fix: ctf: notif-iter: error on empty events (0 bits of data)
Do not create an event which consumed 0 bits of data stream: log an
error and return without creating it. We keep the buffer position at the
beginning of the last decoded event header, and we compare to the
current buffer position: if they are the same, then we consumed 0 bits
of data. It is possible, when we compare, that notit->buf.last_eh_at is
-1ULL (reset when requesting bytes from medium): in this case, we know
we requested bytes anyway, which means we consumed something to get to
this starvation point, thus the event is not empty.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Wed, 12 Jul 2017 20:55:21 +0000 (16:55 -0400)]
Fix: test: expect the new warning format for seqnum
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Wed, 12 Jul 2017 20:47:34 +0000 (16:47 -0400)]
Fix: packet sequence number handling and discarded packet reporting
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 12 Jul 2017 00:12:37 +0000 (20:12 -0400)]
ctf: notif-iter.c: check state on BT_CTF_NOTIF_ITER_MEDIUM_STATUS_EOF
When the notif iter's request_bytes() medium operation returns
BT_CTF_NOTIF_ITER_MEDIUM_STATUS_EOF, make sure that the notif iter
instance is in an expected state. Which states are valid depend on the
metadata (is there a packet size or not, etc.). Return an error from
request_medium_bytes() when the state is incorrect.
This solves streams which should fail but pass, for example when the
data ends within the middle of a packet header field, a packet context
field, or an event.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 12 Jul 2017 19:29:49 +0000 (15:29 -0400)]
cli: do not allow --stream-intersection with --run-args/--run-args-0
Also test this in test_convert_args.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 12 Jul 2017 19:24:20 +0000 (15:24 -0400)]
Fix test_convert_args
* Clock class offset parameters are given with --params so that the
CLI interprets their values as integers.
* --stream-intersection does not work with --run-args or --run-args-0.
* Duplicate --verbose is not checked anymore
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 12 Jul 2017 19:23:59 +0000 (15:23 -0400)]
cli: fix implicit clock class offset parameters
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 6 Jul 2017 22:53:09 +0000 (18:53 -0400)]
Completely rework configure.ac
Full re-organisation of the configure.ac to regroup instructions by
task, automake initialixation, autoconf initialization, OS specific
default values, compiler checks, header checks, linker checks, user
variables, configure switches and so on.
Also BUILT_IN_PLUGINS was moved to --enable-built-in-plugins and
BUILT_IN_PYTHON_PLUGIN_SUPPORT to --enable-built-in-python-plugin-support
as those make more sense as toggles and most users are familiar with
this syntax.
Plus a lot of minor fixes and cleanups.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Wed, 5 Jul 2017 21:03:49 +0000 (17:03 -0400)]
Update autoconf archive macros
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Wed, 5 Jul 2017 20:42:13 +0000 (16:42 -0400)]
Clean LICENSE file
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 29 Jun 2017 19:59:07 +0000 (15:59 -0400)]
Cleanup: bison and flex detection
The previous detection code was quite convoluted and required to have
two variables set to the same value to work. For example, the lexer in
autotools is configured through the LEX variable, even if we require a
specific implementation we have to use it and base our detection code on
it.
The situation is now :
- the FLEX and BISON variables are ignored.
- the LEX and YACC variables need to be set if required like before.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 29 Jun 2017 19:41:58 +0000 (15:41 -0400)]
Cleanup: uuid library detection
Simplify libuuid detection code and use a variable to store the detected
lib instead of adding conditionnal code to each Makefile.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 29 Jun 2017 19:26:12 +0000 (15:26 -0400)]
Cleanup: popt library detection
Simplify popt detection code and use a variable to store the detected
lib instead of using the global LIBS variable.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 29 Jun 2017 18:26:16 +0000 (14:26 -0400)]
Fix: Don't override user variables within the build system
Instead use the appropriatly prefixed AM_* variables as to not interfere
when a user variable is passed to a make command. The proper use of flag
variables is documented at :
https://www.gnu.org/software/automake/manual/automake.html#Flag-Variables-Ordering
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Mon, 10 Jul 2017 19:22:39 +0000 (15:22 -0400)]
Fix: built-in plugins with new plugin filenames
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 7 Jul 2017 21:13:14 +0000 (17:13 -0400)]
test_plugin: use env. var. instead of global symbol because G_MODULE_BIND_LOCAL
Share data between test plugins and the plugin test with environment
variables instead of using global symbols because shared objects are
opened with G_MODULE_BIND_LOCAL now.
Also add BT_PLUGIN_MODULE() to test plugins so that their special
sections exist and contain entries.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Fri, 7 Jul 2017 20:13:32 +0000 (16:13 -0400)]
Test fix: fixed allocation size used for variable length input
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 7 Jul 2017 19:17:05 +0000 (15:17 -0400)]
babeltrace-log: pass single-trace=yes to sink.ctf.fs
Babeltrace 1's babeltrace-log(1) used to output the trace directly into
the specified directory, not in a subdirectory which is the trace name
(always `STDIN` in this case). Pass single-trace=yes to the sink.ctf.fs
instance to replicate this elaborate strategy.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Fri, 7 Jul 2017 19:46:30 +0000 (15:46 -0400)]
Fix: dead code in lttng_live_iterator_next_no_stream()
CID
1376159 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement:
case BT_CTF_LTTNG_LIVE_ITER...
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Fri, 7 Jul 2017 19:45:54 +0000 (15:45 -0400)]
Fix: uninitialized return value member
CID
1376198 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value next_return.
Field next_return.notification is uninitialized.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Fri, 7 Jul 2017 18:58:31 +0000 (14:58 -0400)]
Fix: ds_file_group is checked instead of ds_file_group->stream
** CID
1377287: Null pointer dereferences (REVERSE_INULL)
/plugins/ctf/fs-src/fs.c: 902 in create_ds_file_groups()
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 7 Jul 2017 01:55:48 +0000 (21:55 -0400)]
Fix babeltrace-log(1) for Babeltrace 2
This fixes babeltrace-log(1) so that it works with the Babeltrace 2
tree.
What the program does now is to parse its arguments, create the
arguments to be passed to the babeltrace(1) CLI tool, and spawn a
babeltrace(1) process to build and run a processing graph.
babeltrace-log(1) executes babeltrace(1) as such:
babeltrace run --component dmesg:src.text.dmesg --params read-from-stdin=yes
--params no-extract-timestamp=yes --component ctf:sink.ctf.fs
--key path --value /output/path --connect dmesg:ctf
`no-extract-timestamp=yes` becomes `no-extract-timestamp=no` with
babeltrace-log(1)'s -t/--with-timestamps option. The standard input is
forwarded to the child process.
Like babeltrace(1), the build system creates both babeltrace-log and
babeltrace-log.bin executables. The former spawns the in-tree
babeltrace(1) tool while the latter spawns the installed version.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 6 Jul 2017 06:17:22 +0000 (02:17 -0400)]
src.text.dmesg: add `no-extract-timestamp` option
Babeltrace 1's babeltrace-log(1) has a -t option to extract timestamps
and write them to the event headers. It makes more sense to extract them
by default in the component itself, but babeltrace-log(1) can pass
no-extract-timestamp=yes when -t is not provided.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 23:13:39 +0000 (19:13 -0400)]
lib/ctf-ir/clock-class.c: serialize `true`/`false` instead of `TRUE`/`FALSE`
The `signed` attribute of an integer field type is serialized in
lowercase.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 23:12:57 +0000 (19:12 -0400)]
lib/ctf-ir/clock-class.c: only serialize UUID if it is set
Otherwise we get:
uuid = "
00000000-0000-0000-0000-
000000000000";
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 23:00:58 +0000 (19:00 -0400)]
Add src.text.dmesg component class
The new src.text.dmesg component class reads the standard input or a
specific file and converts each line to a CTF IR event, building the
appropriate metadata objects when needed.
This component does what babeltrace-log(1) used to do. The
babeltrace-log(1) application can be replicated as such:
dmesg | babeltrace -c src.text.dmesg -p read-from-stdin=yes \
--no-debug-info -o ctf -w /path/to/output
The component class's initialization parameters are:
`read-from-stdin`:
True to read the lines from the standard input stream (excludes
`path`).
`path`:
Path to the regular file from which to read lines (excludes
`read-from-stdin`).
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 18:38:05 +0000 (14:38 -0400)]
plugins/ctf/plugin.c: fix comment
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 16:14:47 +0000 (12:14 -0400)]
ctf: notif-iter: pass current stream ID to get_stream() medop
Make the notif iter's get_stream() medop receive the current stream
(instance) ID as a parameter, if any, so that the callee can create a
stream with bt_ctf_stream_create_with_id(), if this is needed, with the
appropriate stream ID which is only known dynamically after decoding the
first packet header.
In the case of src.ctf.fs, the streams are already created with the
appropriate stream IDs because the component deals with data stream file
groups and must mark the trace as static at creation time, so the new
parameter is ignored. In the case of src.ctf.lttng-live, we cannot read
the first packet header and then rewind (or it is rather complicated to
do so), so the stream object is created the first time get_stream() is
called with the received ID.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 16:14:24 +0000 (12:14 -0400)]
src.ctf.fs: fs.c: add missing `static`
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 16:03:40 +0000 (12:03 -0400)]
ctf: notif-iter: ensure that all packets refer to the same stream class
Disallow, within the same packet sequence (decoded by a single CTF notif
iter instance), two packets to be described by two different stream
classes, which would also mean two different streams. Log a specific
warning message when this happens, e.g.:
07-05 12:05:04.235 17923 17923 W PLUGIN-CTF-NOTIF-ITER
set_current_stream_class@notif-iter.c:961 Two packets refer to two
different stream classes within the same packet sequence:
notit-addr=0xd97b20, prev-stream-class-addr=0xdc0b20,
prev-stream-class-name="(null)", prev-stream-class-id=33,
next-stream-class-addr=0xdc13d0, next-stream-class-name="(null)",
next-stream-class-id=34, trace-addr=0xda3650, trace-name="ctf2"
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 5 Jul 2017 16:03:33 +0000 (12:03 -0400)]
Fix: remove clock value leak in sink.text.pretty
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 20:25:53 +0000 (16:25 -0400)]
sink.text.pretty: append `s` only if plural in discarded elems. msg.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 20:15:04 +0000 (16:15 -0400)]
lib: use dedicated BT_LOG*_ERRNO() instead of using strerror()
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 20:02:57 +0000 (16:02 -0400)]
test_ctf_writer.c: use environment variable to override packet resize length
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 20:02:27 +0000 (16:02 -0400)]
sink.ctf.fs: use original stream's name as CTF writer stream's name
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 20:00:12 +0000 (16:00 -0400)]
ir: stream: prefer to use stream's name for (CTF writer) stream's path
When creating a stream file for a given CTF writer stream object, use
this format:
PREFIX-SCID-SID
PREFIX:
1. Base name of stream's name, if it exists.
2. Base name of stream class's name, if it exists.
3. `stream`
SCID:
Stream class's ID.
SID:
Stream's ID.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 17:59:54 +0000 (13:59 -0400)]
sink.text.pretty: print discarded events and packets messages
When getting a discarded events or discarded packets notification in
sink.text.pretty, print a warning on the standard error stream (to
remain compatible with Babeltrace 1 which does that) which looks like
this:
WARNING: Tracer discarded 83565 events between [20:01:32.
062781965]
and [20:01:32.
126649071] in trace "hostname/the-trace" (UUID:
a560bbc4-7f93-b346-a980-
3959745a0f5d) within stream
"/home/user/my-traces/the-trace/stream-1048576_3_0"
(stream class ID: 1, stream ID: 3).
The message also indicates when the trace has no UUID, or when the
stream has no (instance) ID. The stream class ID is always available.
When the trace's or stream's name is unavailable, `(unknown)` is
printed.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 17:53:16 +0000 (13:53 -0400)]
src.ctf.fs: name the stream objects with their file's path
This patch makes a src.ctf.fs component name its stream objects. The
name of a stream object is the full path of the first file of its
backing data stream file group.
The purpose of those names is for sink.text.pretty to indicate in which
file (or which file group) events or packets were discarded by the
tracer.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 17:51:29 +0000 (13:51 -0400)]
flt.lttng-utils.debug-info: copy original stream's numeric ID
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 4 Jul 2017 17:51:01 +0000 (13:51 -0400)]
libctfcopytrace: copy trace's UUID
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 20 Jun 2017 19:40:17 +0000 (15:40 -0400)]
Add sink.utils.counter
A sink.utils.counter component counts the number of received
notifications (one count per notification type) and prints the counts
every 1000 notifications (total) by default and at the end. You can
use the `step` parameter to modify how frequent the component prints
the counts:
babeltrace /path/to/trace -c sink.utils.counter -p step=5000
You can set `step` to 0 to print the counts only at the end:
babeltrace /path/to/trace -c sink.utils.counter -p step=0
Notifications of which the type is not known (if this component is used
in future releases of Babeltrace 2) are classified under "Other
(unknown)", which is only printed if there's at least one unknown
notification.
You can use the `hide-zero` parameter (boolean) to hide the counts which
are 0.
The goal of this component class is to have a dummy sink component with
regular updates, for debugging and benchmarking purposes.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 22 Jun 2017 15:20:29 +0000 (11:20 -0400)]
Automatically generate discarded packets/events notifications
This patch adds discarded packets and events notifications. Those
notifications are automatically generated by each notification iterator
by looking at packet header (PH) field's `packet_seq_num` and packet
context (PC) field's `events_discarded` fields to keep track of the
current state. Automatically generating those notifications, and
forbidding the user to create them, allows them to always be
synchronized with the values of the PH and PC special fields, and
guarantees to the user that they are generated whenever there is a
change in those values.
Each notification contains a count, an optional beginning clock value,
and an optional ending clock value, as well as a stream in which the
elements are discarded by the tracer.
As of this patch, flt.utils.trimmer does not reset the value of its
copied `packet_seq_num` and `events_discarded` fields to 0, and this is
probably a bug because a notification iterator on an flt.utils.trimmer
component can see discarded packets or events notifications before the
first packet beginning notification (which should not be the case if we
consider that a trimmed stream should act like a stream which originally
had those time bounds).
The sink.text.pretty component does not do anything specific with those
new notifications yet, but they are expected to be used to replicate
Babeltrace 1's behaviour (printing warnings).
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 22 Jun 2017 15:17:42 +0000 (11:17 -0400)]
lib/ctf-ir/trace.c: validate PH `packet_seq_num` field
Must be an unsigned integer field if it exists.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 20 Jun 2017 21:21:25 +0000 (17:21 -0400)]
ctf: notif-iter.c: ensure that medops's get_stream() always returns the same
Knowing this, we can keep per-stream state in a CTF notif iter.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 20 Jun 2017 21:07:55 +0000 (17:07 -0400)]
flt.lttng-utils.debug-info: forward unhandled notifications
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 20 Jun 2017 19:50:45 +0000 (15:50 -0400)]
Fix: flt.utils.muxer: not always an ERROR to fail to validate
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 20 Jun 2017 19:39:53 +0000 (15:39 -0400)]
Simplify sink.utils.dummy: only one upstream notification iterator
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 20 Jun 2017 18:36:52 +0000 (14:36 -0400)]
src.ctf.fs: use one CTF notif iter per notification iterator
Use only one bt_ctf_notif_iter per src.ctf.fs notification iterator,
instead of one per data stream file, so that this object can keep a
state for the whole packet sequence.
ctf_fs_ds_file_create() now receives the notif iter to use and sets
itself as its current medops user data.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 20 Jun 2017 17:36:03 +0000 (13:36 -0400)]
lib/graph/notification/inactivity.c: add missing `ret = -1`
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 23:46:31 +0000 (19:46 -0400)]
ctf: notif-iter.c: lazily initialize clock value states
Because clock classes can be added to a trace at any time, it is
possible that an integer field type is mapped to a clock class which did
not exist when init_clock_states() is initially called. To fix this,
create the clock state and map it to a clock class when a new clock
class is found.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 23:35:43 +0000 (19:35 -0400)]
visitor-generate-ir.c: validate clock class frequency in visitor
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 23:30:27 +0000 (19:30 -0400)]
bt_ctf_clock_class_create(): add a frequency parameter
The frequency of a clock class is a mandatory property: CTF 1.8
indicates that it's 1 GHz by default, but it is expected that there's no
default frequency in CTF 2. To allow this immediately, add a mandatory
frequency parameter to bt_ctf_clock_class_create() so that the user's
frequency is set at creation time.
To maintain backward compatibility with pre-2.0.0 CTF writer,
bt_ctf_clock_create() sets its clock class's frequency to 1 GHz, and so
do other parts of the code base.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 23:05:33 +0000 (19:05 -0400)]
stream.c: standardize "Cannot truncate stream file [...]" log message
Standardized:
* Do not put a function name in a non-DEBUG/non-VERBOSE statement.
* Do not put spaces around the `=` of fields.
* Prepend `: ` before fields.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 23:01:17 +0000 (19:01 -0400)]
BT_LOG_WRITE_ERRNO(): use `_msg ": %s" _fmt` format
Do not put a period at the end of the errno string: this gives the
opportunity to the user to follow the errno string with a colon, a
space, and fields, e.g.:
BT_LOGE_ERRNO("Cannot write to file", ": filename=\"%s\"", filename);
which would print this message, for example:
Cannot write to file: No space left on device: filename="/tmp/my-file"
You can also terminate a field-less message with a period manually:
BT_LOGE_ERRNO("Cannot close file", ".");
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 22:52:09 +0000 (18:52 -0400)]
lib/graph/notification/stream.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 22:42:11 +0000 (18:42 -0400)]
lib/graph/notification/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 [Mon, 19 Jun 2017 22:41:50 +0000 (18:41 -0400)]
Fix: add_clock_classes(): do not add existing clock classes
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 22:39:13 +0000 (18:39 -0400)]
Remove unused bt_notification_get_stream()
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 22:25:30 +0000 (18:25 -0400)]
Fix: allow NULL (unnamed) in bt_ctf_stream_class_{get,set}_name()
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 22:21:57 +0000 (18:21 -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>
Philippe Proulx [Mon, 19 Jun 2017 22:00:31 +0000 (18:00 -0400)]
lib/graph/notification/inactivity.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 21:42:02 +0000 (17:42 -0400)]
lib/graph/notification/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 [Mon, 19 Jun 2017 21:41:12 +0000 (17:41 -0400)]
doc/logging-guide.adoc: document standard way of choosing tag names
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 19 Jun 2017 19:58:27 +0000 (15:58 -0400)]
plugins/utils/muxer/muxer.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 16 Jun 2017 17:51:19 +0000 (13:51 -0400)]
plugins/utils/trimmer/iterator.c: use unique logging tag
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Thu, 6 Jul 2017 17:09:22 +0000 (13:09 -0400)]
Fix: set intersections hashtable to NULL after destruction
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 22 Jun 2017 20:58:59 +0000 (16:58 -0400)]
Build plugins as unversioned modules
This will build the plugins as straight .so file without libtools
'lib' prefix and version symlinks.
See this link for more details :
https://autotools.io/libtool/plugins.html
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 16 Feb 2017 16:03:09 +0000 (11:03 -0500)]
Port: plugin system compat for mingw / macOS
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 6 Apr 2017 19:00:44 +0000 (15:00 -0400)]
Fix: ctf writer test on Cygwin
In the ctf writer test we execl() some libtool wrappers that get confused
when arg[0] is not the full path to the binary.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Fri, 7 Apr 2017 19:44:34 +0000 (15:44 -0400)]
Fix: disable debug by default info on Cygwin
elfutils is not available on Cygwin.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 8 Jun 2017 14:54:43 +0000 (10:54 -0400)]
Fix: remove AC_FUNC_MALLOC for cross-compile
AC_FUNC_MALLOC/REALLOC are based on a run-time test which fails when
cross-compiling and we don't use the results from these tests anyway.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 30 May 2017 22:01:17 +0000 (18:01 -0400)]
Add libbabeltrace-ctf for backwards compat
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Wed, 31 May 2017 19:01:40 +0000 (15:01 -0400)]
Port: Add winsock support to live for mingw
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 8 Nov 2016 23:48:10 +0000 (18:48 -0500)]
Port: Replace readdir_r by nftw
readdir_r is deprecated and not available on all platforms, replace it
by nftw.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Wed, 9 Nov 2016 19:35:33 +0000 (14:35 -0500)]
Port: dirfd is not portable, replace it
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Fri, 2 Jun 2017 20:38:05 +0000 (16:38 -0400)]
Port: use ghashtable in mman compat
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Nathan Lynch [Fri, 30 Jun 2017 20:52:27 +0000 (15:52 -0500)]
babeltrace-2.0: do not link with -export-dynamic
It seems that changes in the plugin system make passing
-export-dynamic to the linker unnecessary -- a welcome
improvement.
No regressions observed in the test suite.
Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Wed, 5 Jul 2017 15:42:03 +0000 (11:42 -0400)]
Fix: bt_component_create is not hidden
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Thu, 29 Jun 2017 21:47:55 +0000 (17:47 -0400)]
stream-intersection: use the trace-info query results to insert trimmers
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Wed, 21 Jun 2017 21:54:24 +0000 (17:54 -0400)]
Fix: ctf_fs_metadata is assumed to be non-null
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Wed, 21 Jun 2017 18:26:20 +0000 (14:26 -0400)]
Improve logging in the LTTng index parsing code
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 16 Jun 2017 20:12:35 +0000 (16:12 -0400)]
copytrace: check clock_class_count before getting the clock by index
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 16 Jun 2017 20:21:53 +0000 (16:21 -0400)]
Fix: wrong output name in --help for implicit CTF source
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 16 Jun 2017 19:21:47 +0000 (15:21 -0400)]
Test the trimmer component
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 16 Jun 2017 19:10:27 +0000 (15:10 -0400)]
pass --clock-gmt option to the trimmer if enabled
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 19 Jun 2017 15:53:36 +0000 (11:53 -0400)]
Tests: don't rely on the test script's location
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 16 Jun 2017 18:51:41 +0000 (14:51 -0400)]
test_trace_copy: compare the two traces with diff rather than wc -l
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 16 Jun 2017 18:30:30 +0000 (14:30 -0400)]
Test debug-info
Add a test program source code, instructions to compile it with the
already compiled libhello library, and provide a lttng-ust trace of this
program running.
The test runs babeltrace on this trace with the
--debug-info-target-prefix option set to the tree of babeltrace which
allows it to find the debug symbols, and we verify that the text output
contains the complete debug_info context structure.
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 19 Jun 2017 15:29:37 +0000 (11:29 -0400)]
Clean-up: coding style adjustments
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.042017 seconds and 4 git commands to generate.