Mathieu Desnoyers [Mon, 24 Jul 2017 21:15:53 +0000 (17:15 -0400)]
Fix: negative loop bound check
Found by Coverity:
CID
1376197 (#1 of 1): Negative loop bound (NEGATIVE_RETURNS)
3. negative_returns: Using unsigned variable
bt_value_array_size(run_args) in a loop exit condition.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Mon, 24 Jul 2017 21:12:35 +0000 (17:12 -0400)]
Fix: resolve.c: enum type mismatch
Found by Coverity:
CID
1376200 (#2 of 2): Inferred misuse of enum (MIXED_ENUMS)
mixed_enums: Mixing enum types enum bt_ctf_field_type_id and enum
ctf_type_id for ctx_cur_field_type_id.
(audited whole file for similar pattern)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Mon, 24 Jul 2017 21:00:08 +0000 (17:00 -0400)]
Fix: Explicit null dereferenced
Found by Coverity:
CID
1376244 (#3 of 3): Explicit null dereferenced (FORWARD_NULL)
10. var_deref_op: Dereferencing null pointer node.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 28 Jul 2017 19:55:11 +0000 (15:55 -0400)]
Standard logging for ctf.fs sink
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 28 Jul 2017 14:01:43 +0000 (10:01 -0400)]
Standard logging for libctfcopytrace
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 27 Jul 2017 19:20:21 +0000 (15:20 -0400)]
Standard logging for debug_info plugin
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 27 Jul 2017 16:07:17 +0000 (12:07 -0400)]
Standard logging for trimmer/copy.c
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 20 Jul 2017 18:53:38 +0000 (14:53 -0400)]
Fix tests: run plugins test wrapper script
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 20 Jul 2017 16:48:47 +0000 (12:48 -0400)]
Fix test: intersection has too large offset_s
The offset_s values multiplied by
1000000000 overflows 64-bit.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Wed, 19 Jul 2017 20:14:59 +0000 (16:14 -0400)]
Tests: only run debug info tests when the feature is enabled
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 13 Jul 2017 15:26:53 +0000 (11:26 -0400)]
Port: Add dummy symbol for macOS linker
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 11 Jul 2017 15:26:13 +0000 (11:26 -0400)]
Update gitignore
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Mon, 17 Jul 2017 22:21:56 +0000 (18:21 -0400)]
Port: use a separate variable for elfutils libs
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Mon, 17 Jul 2017 21:31:22 +0000 (17:31 -0400)]
Port: built-in plugins support for the macOS linker
The macOS linker requires different options to force link all the
objects in a static archive, detect this at configure.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 13 Jul 2017 19:11:10 +0000 (15:11 -0400)]
Port: 'struct tm' member count vary across platforms
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Thu, 13 Jul 2017 19:08:29 +0000 (15:08 -0400)]
Port: Solaris and Cygwin have no sys/syslimits.h
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 11 Jul 2017 18:48:40 +0000 (14:48 -0400)]
Port: cast result of be64toh() to uint64_t for print format
The type of the return value of be64toh() can vary from unsigned long to
unsigned long long across platforms, cast it to the longer type before
printing.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 11 Jul 2017 17:38:52 +0000 (13:38 -0400)]
Port: __STRINGIFY exists on Cygwin
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 11 Jul 2017 16:40:56 +0000 (12:40 -0400)]
Port: Add Solaris tid support to logging
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 11 Jul 2017 19:58:32 +0000 (15:58 -0400)]
Port: Add Cygwin tid support to logging
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:41:19 +0000 (12:41 -0400)]
Port: unlink() requires unistd.h on Solaris and macOS
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:39:38 +0000 (12:39 -0400)]
Port: handle 'size_t' / 'off_t' on Solaris
The size of 'size_t' / 'off_t' vary on some platforms, use C99 portable
macros and print formats to handle them.
Print 'size_t' with '%zu' and use SIZE_MAX as max value.
Print 'off_t' casted to 'intmax_t' with '%jd'.
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:58:48 +0000 (20:58 +0000)]
Port: replace strerror_r() by g_strerror()
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:08:23 +0000 (20:08 +0000)]
Port: replace opendir() by g_dir_open()
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 13 Jun 2017 20:10:17 +0000 (20:10 +0000)]
Port: replace setenv() by g_setenv()
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Michael Jeanson [Tue, 18 Jul 2017 15:08:44 +0000 (11:08 -0400)]
Fix: append to LIBS, don't override it
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:15:14 +0000 (15:15 -0400)]
Port: do not include malloc.h
malloc.h does not exists on all platforms and is included by stdlib.h
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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>
This page took 0.044169 seconds and 5 git commands to generate.