Philippe Proulx [Tue, 30 May 2017 22:47:31 +0000 (18:47 -0400)]
tests/lib: do not call bt_ctf_trace_set_native_byte_order() if not needed
It's not mandatory anymore to call bt_ctf_trace_set_native_byte_order()
on a trace object before it's frozen.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 30 May 2017 22:27:28 +0000 (18:27 -0400)]
ir: add BT_CTF_BYTE_ORDER_NONE and make it the default trace's native BO
There's a problem now where you need to explicitly set the native byte
order of a trace you create with bt_ctf_trace_create() with
bt_ctf_trace_set_native_byte_order() before the trace object is frozen,
otherwise the function which would cause the freezing fails.
Some trace formats have no byte order concept. Other properties like
alignment and binary field sizes may have no meaning either. Source
component classes which implement the decoding of those formats should
do a best effort to represent their trace's metadata using CTF IR. That
said, choosing an arbitrary trace's native byte order imposes this byte
order when a ctf.fs sink writes the trace. Here, BT_CTF_BYTE_ORDER_NONE
means that we don't care about the byte order, that it was not
meaningful when decoding the original trace, therefore you can choose
any output byte order you want.
With this patch, the initial trace's native byte order is
BT_CTF_BYTE_ORDER_NONE, and this is a valid byte order when the trace
needs to be frozen. A non-CTF writer trace cannot be used by a CTF
writer object anyway; a CTF writer always creates its own trace object.
The initial native byte order of a CTF writer trace is the machine's
byte order. You cannot set a CTF writer trace's native byte order to
BT_CTF_BYTE_ORDER_NONE. Also, you cannot set any field type's byte order
to BT_CTF_BYTE_ORDER_NONE: it's only valid for a non-CTF writer trace.
libctfcopytrace is modified to only explicitly set the CTF writer
trace's native byte order if the original trace's native byte order is
not BT_CTF_BYTE_ORDER_NONE.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 30 May 2017 00:21:46 +0000 (20:21 -0400)]
ctf plugins: prepend trace's hostname, if exists, to trace name
This makes the trace names a little more precise.
Note that as of this patch the visitor sets the trace's name just before
adding the first stream class, because after this, the trace is frozen
and we cannot set its name anymore. This is done as lately as possible
to increase our chance of having decoded the metadata's `env` block
(where the hostname is), if any. This can lead to an unnamed trace if
there's no stream classes. But if there's no stream classes, there can't
be any packet or event anyway, so there can't be any notification which
refers to this trace, so no other component should see the fact that
there's no name.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 23:55:16 +0000 (19:55 -0400)]
ctf.fs source: use last path parameter's element as base for trace names
Without this patch:
Trace directory: /home/user/my-traces/trace/yes/kernel
`path` parameter: /home/user/my-traces/trace
Trace name: kernel
With this patch:
Trace directory: /home/user/my-traces/trace/yes/kernel
`path` parameter: /home/user/my-traces/trace
Trace name: trace/yes/kernel
This takes into account absolute vs. relative paths, resolves `..` and
`.`, and more. Most of the job is done by bt_common_normalize_path().
The process used to craft the trace names using the base directory as
passed by the user is really easy once all the paths are known to be
normalized.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 23:13:30 +0000 (19:13 -0400)]
Docs: add informal comments to common-internal.h
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 22:48:48 +0000 (18:48 -0400)]
Add bt_common_normalize_path()
This new function does a part of realpath()'s job: it resolves `..` and
`.` in the path, resolves a relative path with a custom working
directory or the current working directory, and removes consecutive
separators (`/` or `\` depending on the platform) and the last
separator. The function always returns an absolute path. The function
does NOT resolve symbolic links.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 20:15:00 +0000 (16:15 -0400)]
stream.c: allow stream PC's `events_discarded` field to be set by user
If a stream packet context `events_discarded` field is set a flush time,
check if its value keeps the count monotonic, and use this value to set
the stream's current discarded events count if so. If it's not set, do
like before and set it automatically from the stream's current count.
This will make it possible for a ctf.fs sink component to write the
original `events_discarded` field without having to read it, compute
the difference with the previous value, and use
bt_ctf_stream_append_discarded_events() to change the stream's discarded
events count.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 19:49:09 +0000 (15:49 -0400)]
Remove remaining old test files
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 19:47:01 +0000 (15:47 -0400)]
tests/cli/Makefile.am: remove duplicate test in TESTS list
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 19:45:08 +0000 (15:45 -0400)]
Fix: test_convert_args: use util.muxer's `assume-absolute-clock-classes` param
util.muxer's `force-absolute` parameter is now named
`assume-absolute-clock-classes`. Modify test to satisfy this.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 19:33:55 +0000 (15:33 -0400)]
Fix: test_ir_visit.c: create valid SC PC/EH and trace packet header
Since CTF IR is more strict regarding the semantics of trace packet
header, stream class packet context and event header field types, this
test fails because the default packet context field type of a stream
class which is not created for a CTF writer object contains
`timestamp_begin` and `timestamp_end` fields which are not mapped to a
clock class.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 19:27:23 +0000 (15:27 -0400)]
Fix: test_ctf_ir_ref.c: create valid SC PC/EH and trace packet header
Since CTF IR is more strict regarding the semantics of trace packet
header, stream class packet context and event header field types, this
test fails because the default packet context field type of a stream
class which is not created for a CTF writer object contains
`timestamp_begin` and `timestamp_end` fields which are not mapped to a
clock class.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 18:47:52 +0000 (14:47 -0400)]
Remove warnings when using bt_plugin_create_all_from_dir()
bt_plugin_create_all_from_dir() expects an existing directory, otherwise
it fails with a WARN-level log message because it's the user's
responsibility to ensure this.
A few functions of the library and the CLI call this with nonexisting
paths, resulting in warnings under normal usage (for example, default
plugin search paths which do not exist; this is not an error nor a
warning).
This patch fixes this by testing the existence of the paths passed to
bt_plugin_create_all_from_dir() with g_file_test(), skipping (usually
with a VERBOSE-level message) when it's not the case.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 29 May 2017 18:28:30 +0000 (14:28 -0400)]
Fix: make Python plugin provider have its own log level
It cannot share libbabeltrace's log level because it's in a different
shared object itself. Because it's not using the library's global log
level, we don't initialize it with the BABELTRACE_LOGGING_GLOBAL_LEVEL,
but with its own BABELTRACE_PYTHON_PROVIDER_LOG_LEVEL.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 27 May 2017 06:55:04 +0000 (02:55 -0400)]
Add bt_log_get_level_from_env() and use it
This is a common function for all the project's modules to use the same
names (`VERBOSE`, `WARN`, `ERROR`, etc.) to set the various log levels
based on the value of a specific environment variable.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 27 May 2017 06:09:23 +0000 (02:09 -0400)]
configure.ac: add details to final report
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 27 May 2017 03:25:43 +0000 (23:25 -0400)]
python-plugin-provider/python-plugin-provider.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, 27 May 2017 02:23:41 +0000 (22:23 -0400)]
cli: check for cancellation before running the graph, add relevant logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 27 May 2017 02:23:29 +0000 (22:23 -0400)]
lib/plugin/plugin-so.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, 27 May 2017 00:51:33 +0000 (20:51 -0400)]
test_ctf_writer.c: add "trace is static" listener tests
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 27 May 2017 00:50:07 +0000 (20:50 -0400)]
Add bt_ctf_trace_add_is_static_listener() and ..._remove_is_static_listener()
See the functions's documentation for more details.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 26 May 2017 23:24:13 +0000 (19:24 -0400)]
Fix builds with built-in plugins
The recent convenience libraries are an issue for built-in plugins
because they lead to multiple definitions of the same symbols. This is
because we have to use --whole-archive when embedding the plugin
archives (.a), so the linker wants to embed all the symbols found. If
the same symbol is found twice, the linker is not happy.
For example: the `ctf` plugin's archive includes the symbols of
libbabeltrace-common.a. The CLI also includes the symbols of
libbabeltrace-common.a. When adding the `ctf` archive to the CLI with
--whole-archive, the symbols of libbabeltrace-common.a already exist in
the CLI, so we get the multiple definition error.
My solution here is to avoid adding the convenience libraries to the
individual plugins and to the library itself when BUILT_IN_PLUGINS is
true. The convenience libraries are added only one time to the CLI (in
cli/Makefile.am directly). When BUILT_IN_PLUGINS is false, it is
important to include the convenience library functions in each plugin
because they could be loaded outside the CLI, where those functions do
not exist.
There's also a fix to properly embed the Python plugin provider into the
library, and to print an error at configure time when
BUILT_IN_PYTHON_PLUGIN_SUPPORT=1 is used without
--enable-python-plugins.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 26 May 2017 20:17:06 +0000 (16:17 -0400)]
lib/plugin/plugin.c: improve log levels
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 26 May 2017 20:14:49 +0000 (16:14 -0400)]
text.pretty: create an event string instead of using fprintf()/fputs()
Because the component calls library functions which can log between its
calls to fprintf() or fputs(), the output when logging is enabled is the
output of the component interlaced with library logging statements.
Instead of printing directly to the file stream, append to a component
GString and fwrite() this content at the end.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 26 May 2017 19:41:48 +0000 (15:41 -0400)]
Fix debug-info: prevent invalid access in the original event_context
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 26 May 2017 19:02:51 +0000 (15:02 -0400)]
Make bt_graph_add_*_listener() function return a listener ID
This is the expected API to identify all the user listeners of the
library. You can keep the returned ID, a simple int, to remove the
listener from the object later if needed. With the current API, you
cannot remove graph listeners, but we could add the functions to do so
in the future.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sun, 28 May 2017 17:12:37 +0000 (13:12 -0400)]
Rename "ignore-absolute" parameter to "assume-absolute-clock-classes"
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:46:04 +0000 (15:46 -0400)]
Tests: possible dereference of NULL argument to strcmp
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:40:58 +0000 (15:40 -0400)]
Fix: return error on empty list in get_unary_unsigned
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:36:45 +0000 (15:36 -0400)]
Fix: missing error code on signed clock value in trimmer
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:26:54 +0000 (15:26 -0400)]
Fix: uninitialized destination component on unknown args
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:10:37 +0000 (15:10 -0400)]
Fix: use of uninitialized value in visit_*_decl_entry
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:06:32 +0000 (15:06 -0400)]
Fix: return of garbage value in copy_find_clock_array_field on error
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:04:19 +0000 (15:04 -0400)]
Fix: return of garbage value on empty specifier list
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:02:32 +0000 (15:02 -0400)]
Fix: return of garbage value when trace has no stream classes
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 19:00:39 +0000 (15:00 -0400)]
Fix: NULL dereference in logging on btr allocation failure
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:59:30 +0000 (14:59 -0400)]
Fix: NULL dereference in logging on notit allocation failure
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:54:16 +0000 (14:54 -0400)]
Fix: dereference of NULL mdec when opening packetized metadata file
ctf_metadata_decoder_packetized_file_stream_to_buf() uses
ctf_metadata_decoder_packetized_file_stream_to_buf_with_mdec() with
a NULL mdec. This results in a NULL dereference whenever the mdec
error sream is accessed.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:48:20 +0000 (14:48 -0400)]
Fix: potential NULL dereference of ctf_fs_file path
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:44:06 +0000 (14:44 -0400)]
Fix: ds_file_munmap must check ds_file for NULL
ds_file_munmap may be called with a NULL file in
ctf_fs_ds_file_create()'s error path.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:37:18 +0000 (14:37 -0400)]
Fix: unchecked bt_ctf_event_set_clock_value return value
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:35:58 +0000 (14:35 -0400)]
Clean-up: unused next_return assignation in muxer test
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:31:40 +0000 (14:31 -0400)]
Fix: uninitialized ret value used in set_debug_info_field
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Sat, 27 May 2017 18:26:06 +0000 (14:26 -0400)]
Fix: possible NULL dereference of uuid in test
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 26 May 2017 06:33:23 +0000 (02:33 -0400)]
lib/plugin/plugin.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, 26 May 2017 05:02:18 +0000 (01:02 -0400)]
Replace all assert(false) and assert(0) with abort()
Because assert() statements are not executed with a release/production
build, assert(false) and assert(0) statements are ignored and the
program's execution continues in an unexpected state. This could lead to
very weird and hard-to-debug situations, and potentially to corrupted
output traces.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 26 May 2017 00:56:40 +0000 (20:56 -0400)]
lib/graph/iterator.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, 25 May 2017 23:12:13 +0000 (19:12 -0400)]
lib/graph/clock-class-priority-map.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, 25 May 2017 22:55:41 +0000 (18:55 -0400)]
lib/graph/component-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, 25 May 2017 22:25:36 +0000 (18:25 -0400)]
lib/graph/sink.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, 25 May 2017 22:25:25 +0000 (18:25 -0400)]
lib/graph/filter.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, 25 May 2017 22:25:15 +0000 (18:25 -0400)]
lib/graph/source.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, 25 May 2017 22:01:09 +0000 (18:01 -0400)]
Remove useless component/iterator validation functions
They only "validate" what we can assert anyway.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 25 May 2017 21:57:09 +0000 (17:57 -0400)]
bt_notification_iterator_create(): assert the type of comp. class
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 25 May 2017 21:56:21 +0000 (17:56 -0400)]
lib/graph/connection.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 25 May 2017 20:47:10 +0000 (16:47 -0400)]
fix: bt_put on potentially unintialized variable
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 25 May 2017 20:32:53 +0000 (16:32 -0400)]
fs-sink: only subscribe to relevant notifications
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 25 May 2017 19:55:37 +0000 (15:55 -0400)]
fix: useless warning
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 25 May 2017 18:51:03 +0000 (14:51 -0400)]
Fix debug-info leak: unbalanced get/put
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 25 May 2017 16:09:44 +0000 (12:09 -0400)]
trimmer: cleanup the packet_map if iterator destroyed early
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Thu, 25 May 2017 16:05:37 +0000 (12:05 -0400)]
debug_info fix: useless reference
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Tue, 23 May 2017 19:04:27 +0000 (15:04 -0400)]
debug-info fix: remove useless get function
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Tue, 23 May 2017 18:04:02 +0000 (14:04 -0400)]
trimmer: close when end is reached
When an event has a timestamp past the specified end timestamp, the
iterator now returns it is end which closes the graph. We also check if
the timestamp begin of a packet is after the end timestamp.
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Tue, 23 May 2017 16:26:47 +0000 (12:26 -0400)]
trimmer fix: notification handling
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Wed, 17 May 2017 21:00:41 +0000 (17:00 -0400)]
debug_info: fix graph connection
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Wed, 17 May 2017 21:00:04 +0000 (17:00 -0400)]
fix copytrace: set the byte order
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Wed, 17 May 2017 20:58:55 +0000 (16:58 -0400)]
copytrace: option to skip the copy of packet/content size
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Wed, 17 May 2017 20:54:00 +0000 (16:54 -0400)]
fix: optional fields
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 25 May 2017 17:45:54 +0000 (13:45 -0400)]
lib/graph/notification/event.c: fix clock class leak
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 25 May 2017 17:27:01 +0000 (13:27 -0400)]
lib/graph/port.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, 25 May 2017 07:12:30 +0000 (03:12 -0400)]
Remove component's initialization state flag
This "initializing" flag is now useless. It was used to make sure that
only the implementation side of a component could set the component's
private user data. This is now enforced by typing (component vs. private
component), and it is always okay to set a private component's user
data.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 25 May 2017 07:06:13 +0000 (03:06 -0400)]
lib/graph/component.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, 25 May 2017 07:05:33 +0000 (03:05 -0400)]
bt_ctf_stream_map_component_to_port(): log before and after
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 25 May 2017 06:36:25 +0000 (02:36 -0400)]
Remove bt_component_set_name()
This is not used anywhere, and there's not even a public declaration for
it. Plus a component object has no frozen property, and for obvious
reasons we can't change the name of a component once it's part of a
graph. All the properties of a component must be set at creation time.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 25 May 2017 00:28:17 +0000 (20:28 -0400)]
lib/graph/graph.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, 25 May 2017 00:12:56 +0000 (20:12 -0400)]
Remove bt_graph_add_component_as_sibling()
This is not used anywhere, and it's one more thing to test. It remains
in the archives in case we need it in the future. This was created in
the days when it was expected that components would duplicate themselves
to share resources instead of dynamically adding ports like today.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 23:09:58 +0000 (19:09 -0400)]
bt_ctf_trace_destroy(): logging: difference between destroying and putting
In some cases we know for sure that we're destroying the objects, not
just putting them.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 23:09:23 +0000 (19:09 -0400)]
bt_ctf_stream_class_destroy(): log what is being destroyed/put
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 23:08:40 +0000 (19:08 -0400)]
lib/ctf-ir/event-class.c: minor logging message edit
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 22:37:15 +0000 (18:37 -0400)]
lib/ctf-ir/validation.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 22:21:48 +0000 (18:21 -0400)]
ref.c: warn when the ref count goes from 0 to
18446744073709551615
This unlikely conditin indicates a double bt_put(), or something that
went really wrong, and should be reported to the user as a warning.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 22:17:25 +0000 (18:17 -0400)]
ref.c: do not change ref count when release function is not set
This is the case of the null value singleton, bt_value_null, on which
you can call bt_get() and bt_put() and they should have no effect.
Before this patch, we can see log messages of the ref count going from 0
to
18446744073709551615 and other weird, huge values.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 21:59:40 +0000 (17:59 -0400)]
lib/ctf-ir/resolve.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 21:59:03 +0000 (17:59 -0400)]
field-path.c: add internal function to stringify a field path
This is to be used by logging statements.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 19:03:15 +0000 (15:03 -0400)]
lib/ctf-ir/trace.c: add logging
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 07:23:26 +0000 (03:23 -0400)]
ctf.fs source: make traces static when all streams are created
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 07:05:55 +0000 (03:05 -0400)]
plugin-so.c: use BABELTRACE_NO_DLCLOSE env. var. to avoid dlclose()
See new comment in plugin-so.c.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 00:47:58 +0000 (20:47 -0400)]
ctf.fs source: add trace file rotation (stream instance ID) support
ctf.fs source is changed as such:
* A CTF FS trace owns zero or more stream file groups.
* A stream file group owns a unique CTF IR stream object and one or more
stream file infos.
* A stream file info contains a path and a beginning timestamp (the
beginning timestamp of the stream file's first packet).
* Stream file infos are ordered by time in a stream file group.
* One output port is created for each stream file group. It is also
associated to this stream file group through private port's user data.
The name of the port is always the stream file group's first stream
file info's path, which is always the path of stream file containing
the oldest packet. This can be useful to isolate a group of stream
files by name and possibly CPU ID, e.g. (CPU 1 of LTTng channel
`my-channel`):
--connect='ctf.*my-channel_1_*:mux'
or all CPUs of LTTng channel `hello-chan`:
--connect='ctf.*hello-chan_*:mux'
* The user data of a notification iterator contains its upstream port's
stream file group and a stream file info index.
* For a given notification iterator, one data stream file object (owner
of a binary notification iterator and the one which does the stream
file memory mapping) is always active. When it returns a
BT_NOTIFICATION_ITERATOR_STATUS_END status, the data stream file is
destroyed and the next stream file info is used to create a new data
stream file, from which the real next notification is obtained. If
there's no more stream file info in the stream file group, then
BT_NOTIFICATION_ITERATOR_STATUS_END is returned.
This patch effectively makes a ctf.fs source component create one unique
stream, and thus one port, for each stream instance of each trace,
therefore supporting trace file rotation. Only one stream file is
opened and memory mapped at any time for a given stream instance.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 00:45:08 +0000 (20:45 -0400)]
ctf plugin: add bt_ctf_notif_iter_get_packet_header_context_fields()
The new bt_ctf_notif_iter_get_packet_header_context_fields() function
returns the packet header and context fields using the usual medium
operation mechanism without ever creating packet of event objects,
therefore not requiring a stream object to exist.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Wed, 24 May 2017 00:43:00 +0000 (20:43 -0400)]
ir: add stream ID API
The new bt_ctf_stream_create_with_id() function creates a stream object,
just like bt_ctf_stream_create(), but with a numeric ID. You cannot
call this function to create a CTF writer stream because CTF writer
streams initialize their own unique ID.
Use bt_ctf_stream_get_id() to get a 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, 23 May 2017 15:25:26 +0000 (11:25 -0400)]
cli: --force-correlate -> utils.muxer's `ignore-absolute` parameter
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 23 May 2017 15:25:05 +0000 (11:25 -0400)]
Fix: do not require lttng-utils.debug-info with --disable-debug-info
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 23 May 2017 02:07:15 +0000 (22:07 -0400)]
Fix: ctf.fs source: append all ctf_fs_trace objects to component's list
This avoids obvious potential leaks.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Mon, 22 May 2017 19:33:03 +0000 (15:33 -0400)]
ctf.fs source: recurse to find multiples CTF traces
One port per CTF data stream amongst all the traces that are found
from the user's starting path is created.
The traces are named so as to be able to replicate the original tree
by stripping their common prefix within slash boundaries.
For example: user passes `hello` as the starting path, the component
finds the following traces:
hello/world/kilo
hello/yes
hello/ispep/zero/mini
These traces would be named:
world/kilo
yes
ispep/zero/mini
Another example: user passes `hello` as the starting path, the
component finds the following trace:
hello/world/kilo
In this case, the trace is named `kilo`.
I used realpath() to normalize the paths and make sure that there aren't
`.` or `..` in the trace's name. Opening a trace located directly in `/`
is not supported.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 20 May 2017 01:46:25 +0000 (21:46 -0400)]
Fix warnings emitted by `gcc -Wall`
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 20 May 2017 00:49:41 +0000 (20:49 -0400)]
Library: log version (INFO) on construction
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 20 May 2017 00:37:30 +0000 (20:37 -0400)]
babeltrace(1): reset console after graph stops running
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 20 May 2017 00:32:45 +0000 (20:32 -0400)]
logging-internal.h: use __attribute__((format)) to check parameters
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 20 May 2017 00:32:16 +0000 (20:32 -0400)]
Logging: fix wrong parameters, superfluous commas, etc.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 20 May 2017 00:21:33 +0000 (20:21 -0400)]
lib/ctf-ir/event.c: replace some BT_LOGE() with BT_LOGW()
Field serialization can fail because of a user error, for example trying
to serialize a field which is not set.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.045756 seconds and 4 git commands to generate.