babeltrace.git
6 years agodebug-info fix: packet_context is optional
Julien Desfossez [Mon, 12 Jun 2017 19:06:27 +0000 (15:06 -0400)] 
debug-info fix: packet_context is optional

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: uninitialized return value in copy.c
Jérémie Galarneau [Wed, 14 Jun 2017 22:13:31 +0000 (18:13 -0400)] 
Fix: uninitialized return value in copy.c

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove legacy printf_verbose()/printf_debug() and others
Philippe Proulx [Wed, 14 Jun 2017 20:30:31 +0000 (16:30 -0400)] 
Remove legacy printf_verbose()/printf_debug() and others

This patch removes all the legacy logging macros found in
babeltrace-internal.h. It also removes the babeltrace_verbose and
babeltrace_debug symbols.

To remain as backward compatible as possible, the CLI checks the
BABELTRACE_VERBOSE and BABELTRACE_DEBUG environment variables and
overrides the default log level (WARN, or the one set with --log-level)
with VERBOSE if BABELTRACE_DEBUG is 1 and INFO if only
BABELTRACE_VERBOSE is 1. This default log level applies to all the known
loggers, except the ones that have their log level explicitly set with a
dedicated environment variable.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agovisitor-generate-ir.c: automatically map specific fields to trace's clock class
Philippe Proulx [Wed, 14 Jun 2017 16:34:00 +0000 (12:34 -0400)] 
visitor-generate-ir.c: automatically map specific fields to trace's clock class

In non-strict mode (default), automatically map packet context field
type's `timestamp_begin` and `timestamp_end` fields, as well as
event header field type's `timestamp` and `ts` fields, when the
following conditions are all true:

* The decoder is in non-strict mode.
* The field type is an integer field type.
* The integer field type is not mapped to a clock class.
* The trace contains only one clock class at this point.

This attempts to fix semantics errors committed by some known tracers
(very old versions of LTTng and old versions of CTF writer).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoctf: add metadata decoder config. and `strict-metadata` param in src.ctf.fs
Philippe Proulx [Wed, 14 Jun 2017 15:15:00 +0000 (11:15 -0400)] 
ctf: add metadata decoder config. and `strict-metadata` param in src.ctf.fs

The common metadata decoder now accepts an optional configuration
structure. The offset (seconds and nanoseconds) to apply to all the
clock classes is found in there, as well as a new option which makes the
decoder strict. In strict mode, the decoder does not allow the decoded
metadata stream to be off semantically. For example, in strict mode,
clock classes named `monotonic` are not forced to be absolute when it is
detected that the stream was produced by an LTTng tracer.

It's not expected that the strict mode be something that any user would
want under normal conditions because the non-strict mode fixes errors
made by known tracers to make things work for the other components of
the graph. As such, there's no quick --strict option in the CLI's
`convert` command: the user can instantiate its own source.ctf.fs
component with --component for this and pass the options with --params:

    babeltrace -c src.ctf.fs --path ~/my-traces/trace -p strict-metadata=yes

I'm also fixing the parameter names and types for the clock class
offsets, both in the CLI and in source.ctf.fs, so that all the project's
modules are in sync regarding this. The parameters are now
`clock-class-offset-s` and `clock-class-offset-ns`, and with the
`convert` command, they are set with resp. --clock-offset and
--clock-offset-ns. They used to be passed to the `run` command as string
values (using --key and --value), but now they are part of the
component's --params option so that they are recognized as constant
integer values (even if negative).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agosource.ctf.fs: remove ctf_fs_debug symbol
Philippe Proulx [Wed, 14 Jun 2017 06:50:29 +0000 (02:50 -0400)] 
source.ctf.fs: remove ctf_fs_debug symbol

Not needed anymore because of the standardized logging.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: cli: help command: accept leftover when --component is not specified
Philippe Proulx [Wed, 14 Jun 2017 06:31:12 +0000 (02:31 -0400)] 
Fix: cli: help command: accept leftover when --component is not specified

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: add global --log-level option
Philippe Proulx [Wed, 14 Jun 2017 05:17:23 +0000 (01:17 -0400)] 
cli: add global --log-level option

This new global option (applies before the command name) sets the
default log level of all the known (project's) loggers. This default
log level can still be overridden by a specific environment variable,
for example:

    BABELTRACE_PLUGIN_CTF_METADATA_LOG_LEVEL=D babeltrace --log-level=I ...

In this example, all the log levels are set to INFO, but
BABELTRACE_PLUGIN_CTF_METADATA_LOG_LEVEL overrides the `ctf` plugin's
metadata module's log level to DEBUG.

When you don't specify --log-level, it defaults to W (WARN), the current
behaviour.

--verbose is now the equivalent of --log-level=I, and --debug is the
equivalent of --log-level=V. --verbose and --debug do the same thing,
for the `convert` command, whether they are global or specific to the
command. --verbose and --debug can still be specified together, and
whatever the order, the lowest log level always wins: VERBOSE.
The --log-level option can override previous --verbose, --debug, or
--log-level options because it didn't exist in Babeltrace 1 anyway so
there's no way to break backward compatibility:

    babeltrace --log-level=W --verbose --log-level=E ...

In this case, the final log level is ERROR.

Other example with implicit `convert` command:

    babeltrace --log-level=E /path/to/trace -v

In this case, the command's --verbose option sets the log level to
INFO because it's lower than ERROR (set by --log-level=E).

One of the main use cases of the new --log-level option is to completely
disable logging:

    babeltrace --log-level=N ...

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoUse BABELTRACE_FORCE_COLORS environment variable to force color support
Philippe Proulx [Wed, 14 Jun 2017 02:42:58 +0000 (22:42 -0400)] 
Use BABELTRACE_FORCE_COLORS environment variable to force color support

This allows this use case:

    BABELTRACE_FORCE_COLORS=1 babeltrace ... |& less -R

to see the logging's color in `less`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoLogging: add colors depending on log level
Philippe Proulx [Wed, 14 Jun 2017 02:42:00 +0000 (22:42 -0400)] 
Logging: add colors depending on log level

The whole line is colored and this indicates the log level.

VERBOSE: no color
DEBUG:   no color
INFO:    blue
WARN:    yellow
ERROR:   red
FATAL:   red

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agovisitor-generate-ir.c: logging: add stream's line number and other info
Philippe Proulx [Wed, 14 Jun 2017 02:07:10 +0000 (22:07 -0400)] 
visitor-generate-ir.c: logging: add stream's line number and other info

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agovisitor-semantic-validator.c: standardize logging
Philippe Proulx [Wed, 14 Jun 2017 00:31:08 +0000 (20:31 -0400)] 
visitor-semantic-validator.c: standardize logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/metadata/visitor-parent-links.c: standardize logging
Philippe Proulx [Wed, 14 Jun 2017 00:30:55 +0000 (20:30 -0400)] 
plugins/ctf/common/metadata/visitor-parent-links.c: standardize logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/metadata/objstack.c: add logging
Philippe Proulx [Wed, 14 Jun 2017 00:09:47 +0000 (20:09 -0400)] 
plugins/ctf/common/metadata/objstack.c: add logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/metadata/decoder.c: standardize logging
Philippe Proulx [Wed, 14 Jun 2017 00:07:36 +0000 (20:07 -0400)] 
plugins/ctf/common/metadata/decoder.c: standardize logging

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/metadata: logging: standardize in parser and lexer
Philippe Proulx [Tue, 13 Jun 2017 22:35:16 +0000 (18:35 -0400)] 
plugins/ctf/common/metadata: logging: standardize in parser and lexer

YYDEBUG is set if the VERBOSE mode is enabled for the common metadata
module. YYFPRINTF is defined to BT_LOGV so that everything uses the
standard logging macros.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agovisitor-generate-ir.c: logging: standardize messages and levels
Philippe Proulx [Tue, 13 Jun 2017 20:20:09 +0000 (16:20 -0400)] 
visitor-generate-ir.c: logging: standardize messages and levels

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: fields.c: fix public function names to get/set struct. field
Philippe Proulx [Mon, 12 Jun 2017 22:03:40 +0000 (18:03 -0400)] 
ir: fields.c: fix public function names to get/set struct. field

To remain symmetric, use bt_ctf_field_structure_get_field_by_name() and
bt_ctf_field_structure_set_field_by_name(), as it is possible that
bt_ctf_field_structure_set_field_by_index() exists in the future.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Enable libtool to produce DLLs
Michael Jeanson [Tue, 25 Oct 2016 21:13:57 +0000 (17:13 -0400)] 
Port: Enable libtool to produce DLLs

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Remove unused header pwd.h
Michael Jeanson [Mon, 5 Jun 2017 18:00:40 +0000 (14:00 -0400)] 
Port: Remove unused header pwd.h

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd logging to compat
Michael Jeanson [Fri, 2 Jun 2017 17:43:18 +0000 (13:43 -0400)] 
Add logging to compat

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd missing files to gitignore
Michael Jeanson [Mon, 29 May 2017 20:49:17 +0000 (16:49 -0400)] 
Add missing files to gitignore

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: Remove unused header in test_plugin
Michael Jeanson [Fri, 17 Feb 2017 20:11:57 +0000 (15:11 -0500)] 
Port: Remove unused header in test_plugin

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoDon't add module symbols to global namespace
Michael Jeanson [Wed, 15 Feb 2017 20:39:34 +0000 (15:39 -0500)] 
Don't add module symbols to global namespace

The G_MODULE_BIND_LOCAL flag specifies that symbols in the module should not
be added to the global name space. The default action on most platforms is
to place symbols in the module in the global name space, which may cause
conflicts with existing symbols.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoSet version extra to pre1
Jérémie Galarneau [Fri, 9 Jun 2017 23:23:58 +0000 (19:23 -0400)] 
Set version extra to pre1

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: debug info plugin incorrect assumption about header and clock
Mathieu Desnoyers [Fri, 9 Jun 2017 23:00:22 +0000 (19:00 -0400)] 
Fix: debug info plugin incorrect assumption about header and clock

Fix a few assumptions in the copy helper:
- A stream may not have event headers,
- A trace may not have clocks.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: various fixes for ctf-traces/succeed test cases
Mathieu Desnoyers [Fri, 9 Jun 2017 22:38:36 +0000 (18:38 -0400)] 
Fix: various fixes for ctf-traces/succeed test cases

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoconfigure.ac: make the minimal, build-time log level be VERBOSE
Philippe Proulx [Fri, 9 Jun 2017 21:52:01 +0000 (17:52 -0400)] 
configure.ac: make the minimal, build-time log level be VERBOSE

Distributions can override this at build time to increase performance,
e.g.:

    BABELTRACE_MINIMAL_LOG_LEVEL=WARN ./configure ...

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: use WARN as the default log level when not explicitly set by user
Philippe Proulx [Fri, 9 Jun 2017 21:48:27 +0000 (17:48 -0400)] 
cli: use WARN as the default log level when not explicitly set by user

For all known log levels (library, CLI, plugins, etc.), when the
dedicated log level environment variable is unset, make the CLI set it
to WARN. This means that you can always override the default, -v, or -d
log level with a specific environment variable. For example, if you need
VERBOSE logging for all the loggers but the library's:

    BABELTRACE_LOGGING_GLOBAL_LEVEL=N babeltrace -d ...

Using WARN as the default log level will help spot bugs quickly without
a specific option to use this log level.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: set all the log level of all known loggers with -v and -d
Philippe Proulx [Fri, 9 Jun 2017 21:30:07 +0000 (17:30 -0400)] 
cli: set all the log level of all known loggers with -v and -d

Set log levels according to --debug or --verbose. For
backward compatibility, --debug is more verbose than
--verbose. So:

    --verbose: INFO log level
    --debug:   VERBOSE log level (includes DEBUG, which is
               is less verbose than VERBOSE in the internal
               logging framework)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: convert: allow multiple paths to be passed as leftover arguments
Philippe Proulx [Fri, 9 Jun 2017 21:15:55 +0000 (17:15 -0400)] 
cli: convert: allow multiple paths to be passed as leftover arguments

Allow this:

    babeltrace /path/to/trace1 /path/to/trace2 /path/to/trace3

This worked with Babeltrace 1 and needs to work with Babeltrace 2.

What's done here is that a _base_ implicit set of arguments for an
eventual source.ctf.fs component is created implicitly or by default
like it used to be. For each leftover argument, we copy this base set of
arguments and append the `path` parameter with the specific leftover
argument. Then we name and connect those source components as usual.
What's left is one source.ctf.fs component for each individual path.
Each individual component can still recurse.

tests/cli/test_convert_args is updated because it used to check that a
command line with multiple leftovers was expected to fail, but it
doesn't with this patch.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: remove listener check
Julien Desfossez [Fri, 9 Jun 2017 20:24:36 +0000 (16:24 -0400)] 
Fix: remove listener check

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix copytrace: check field exists before copy
Julien Desfossez [Fri, 9 Jun 2017 19:22:22 +0000 (15:22 -0400)] 
Fix copytrace: check field exists before copy

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: uninitialized variable
Mathieu Desnoyers [Fri, 9 Jun 2017 22:05:07 +0000 (18:05 -0400)] 
Fix: uninitialized variable

query.c: In function 'trace_info_query':
query.c:246:2: warning: 'stream_class' may be used uninitialized in this function [-Wmaybe-uninitialized]
  bt_put(stream_class);
  ^
query.c:216:30: note: 'stream_class' was declared here
  struct bt_ctf_stream_class *stream_class;
                              ^

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: event, stream names can be strings
Mathieu Desnoyers [Fri, 9 Jun 2017 21:41:53 +0000 (17:41 -0400)] 
Fix: event, stream names can be strings

The code is too strict and enforces that they need to be CTF
identifiers, but it's valid to have those as simple strings.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: make check in out-of-tree
Mathieu Desnoyers [Fri, 9 Jun 2017 21:28:42 +0000 (17:28 -0400)] 
Fix: make check in out-of-tree

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: out-of-tree build
Mathieu Desnoyers [Fri, 9 Jun 2017 21:24:27 +0000 (17:24 -0400)] 
Fix: out-of-tree build

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: add missing files to make dist, disable python bindings
Mathieu Desnoyers [Fri, 9 Jun 2017 21:01:23 +0000 (17:01 -0400)] 
Fix: add missing files to make dist, disable python bindings

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove former logging header print.h from source.ctf.fs Makefile
Jérémie Galarneau [Fri, 9 Jun 2017 18:01:00 +0000 (14:01 -0400)] 
Remove former logging header print.h from source.ctf.fs Makefile

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agosource.ctf.fs: implement the trace-info query
Jérémie Galarneau [Wed, 7 Jun 2017 20:21:18 +0000 (16:21 -0400)] 
source.ctf.fs: implement the trace-info query

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/lttng-utils/copy.c: fix uninitialized use warning
Philippe Proulx [Fri, 9 Jun 2017 19:03:46 +0000 (15:03 -0400)] 
plugins/lttng-utils/copy.c: fix uninitialized use warning

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodebug-info: sync the copied trace on static change
Julien Desfossez [Fri, 9 Jun 2017 16:05:01 +0000 (12:05 -0400)] 
debug-info: sync the copied trace on static change

When the trace becomes static, we need to ensure that we have all the
streams, stream classes and event classes in our own copy before setting
it static as well.

This is also true when we open the trace and it is already static.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodebug-info: handle the static notifications
Julien Desfossez [Thu, 8 Jun 2017 18:10:29 +0000 (14:10 -0400)] 
debug-info: handle the static notifications

And some cleanup, fix the remaining leaks.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodebug-info refactoring
Julien Desfossez [Tue, 6 Jun 2017 21:02:10 +0000 (17:02 -0400)] 
debug-info refactoring

Scope the objects belonging to a trace (stream, stream_class, packet,
debug info maps) into a debug_info_trace and use that everywhere instead
of having these objects global to the component.

This will allow to make the static notification handling work.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: useless active_stream member
Julien Desfossez [Tue, 6 Jun 2017 16:01:48 +0000 (12:01 -0400)] 
fs-sink: useless active_stream member

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoinclude/babeltrace/graph/private-connection.h: add missing `extern`
Philippe Proulx [Fri, 9 Jun 2017 00:56:50 +0000 (20:56 -0400)] 
include/babeltrace/graph/private-connection.h: add missing `extern`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodoc/api: add missing babeltrace-cli.png image
Philippe Proulx [Thu, 23 Feb 2017 22:05:15 +0000 (17:05 -0500)] 
doc/api: add missing babeltrace-cli.png image

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: use -o ctf --output /output/path to quickly instantiate sink.ctf.fs
Philippe Proulx [Fri, 9 Jun 2017 17:38:08 +0000 (13:38 -0400)] 
cli: use -o ctf --output /output/path to quickly instantiate sink.ctf.fs

This should be easier for existing users of Babeltrace 1 which are used
to the --output-format (-o) and --output (-w) options. We had people
previously on the mailing list asking why

    babeltrace my-trace -o ctf --output /output/path

was not working. The answer is that there was no CTF sink at the time,
but this usage is still correct and straightforward.

The code makes sure that, if something implies `-o text`, for example
--names, --fields, or --no-delta, then you cannot use this form because
--output could also apply to the implicit sink.pretty.text component. We
also make sure that --output exists if `-o ctf` exists (--output without
`-o ctf` applies to the implicit `-o text` as mentioned previously).

The run command equivalent of this command:

    babeltrace my-trace -o ctf --output /output/path

as returned by --run-args, is:

    babeltrace run --component source.ctf.fs --name source-ctf-fs
                   --key path --value my-trace --component sink.ctf.fs
                   --name sink-ctf-fs --key path --value /output/path
                   --component filter.utils.muxer --name muxer
                   --component filter.lttng-utils.debug-info
                   --name debug-info --connect source-ctf-fs:muxer
                   --connect muxer:debug-info
                   --connect debug-info:sink-ctf-fs

tests/cli/test_convert_args is updated because the preferred name of the
implicit source.ctf.fs component is changed: it used to be `ctf-fs`,
it's now `source-ctf-fs`, as the preferred implicit sink.ctf.fs
component's name is `sink-ctf-fs`. Also there are a few more tests to
verify the constraint and generated options mentioned in this message.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agobt_ctf_field_type_integer_set_size(): take unsigned int parameter
Philippe Proulx [Fri, 9 Jun 2017 00:48:01 +0000 (20:48 -0400)] 
bt_ctf_field_type_integer_set_size(): take unsigned int parameter

Take unsigned int parameter like bt_ctf_field_type_integer_create().

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agobt_ctf_stream_get_discarded_events_count(): return int
Philippe Proulx [Fri, 9 Jun 2017 00:47:25 +0000 (20:47 -0400)] 
bt_ctf_stream_get_discarded_events_count(): return int

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoutils.muxer: expect specific clock class properties to mux
Philippe Proulx [Thu, 8 Jun 2017 23:00:07 +0000 (19:00 -0400)] 
utils.muxer: expect specific clock class properties to mux

This patch makes a filter.utils.muxer component's notification iterator
set what properties it expects from future clock classes from the first
clock classes it checks. The possible expectations are:

* Expect absolute clock classes, any UUID.
* Expect non-absolute clock classes, without a UUID.
* Expect non-absolute clock classes, with a specific UUID.

With this patch you can make the component mux the streams of a single
trace of which the clock is not absolute, or has no UUID.

The `assume-absolute-clock-classes` parameter overrides all those
checks.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: do not automatically generate a UUID in bt_ctf_clock_class_create()
Philippe Proulx [Thu, 8 Jun 2017 22:58:33 +0000 (18:58 -0400)] 
ir: do not automatically generate a UUID in bt_ctf_clock_class_create()

A clock class should be created empty, without a generated UUID which is
different each time. To maintain backward compatibility, a CTF writer
clock automatically generates a UUID on creation to set its private
clock class's UUID.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugin-so: use list of components instead of glib hash table
Mathieu Desnoyers [Thu, 8 Jun 2017 19:38:46 +0000 (15:38 -0400)] 
plugin-so: use list of components instead of glib hash table

Use a list of components to track those that have references to their so
handles. This allows removing a dependency on the glib hash table, which
is not very cooperative when initialized from a library constructor in a
static build (mainly on Windows).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocli: use --component=NAME:{source,filter,sink}.PLUGIN.COMPCLS
Philippe Proulx [Thu, 8 Jun 2017 19:57:08 +0000 (15:57 -0400)] 
cli: use --component=NAME:{source,filter,sink}.PLUGIN.COMPCLS

Use a universal -c/--component option for all component class types,
specifying the component class type in the option's argument instead,
for example:

    Before: --source=ctf.fs
    After:  --component=source.ctf.fs

    Before: --sink=my-text:text.pretty
    After:  --component=my-text:sink.text.pretty

This provides a universal way to identify a component instance in:

* Log messages
* Information/error messages
* List of plugins and contained component classes
* Help messages
* Documentation

Then we can always refer to the ctf.fs source component class, for
example, as `source.ctf.fs` instead of all the variations:

* The ctf.fs source
* --source ctf.fs
* ctf.fs (source)

and so on.

Short option -c used to be for --connect: it's -C now.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolttng-live: check graph cancel state, check ctf trace pointer
Mathieu Desnoyers [Thu, 8 Jun 2017 17:35:54 +0000 (13:35 -0400)] 
lttng-live: check graph cancel state, check ctf trace pointer

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix build with BUILT_IN_PLUGINS=1
Philippe Proulx [Thu, 8 Jun 2017 17:13:07 +0000 (13:13 -0400)] 
Fix build with BUILT_IN_PLUGINS=1

Changes:

* Make library always depend on its convenience libraries. Since the
  library is not linked with --whole-archive in the CLI when
  BUILT_IN_PLUGINS=1 (like plugins are), it's okay for it to include
  convenience symbols.

* Do not build tests/lib/test_plugin when BUILT_IN_PLUGINS=1

* Do not build tests/plugins when BUILT_IN_PLUGINS=1

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd bt_graph_add_component(), make bt_component_create() internal
Philippe Proulx [Thu, 8 Jun 2017 02:25:48 +0000 (22:25 -0400)] 
Add bt_graph_add_component(), make bt_component_create() internal

With this patch, you can only instantiate a component class through an
existing graph. This can guarantee to the user (component class
developer) that, when the component class's initialization method is
called, the component always belongs to a graph. This simplifies things,
now and in the future. For example, it is possible to cancel the graph
during the execution of bt_graph_add_component() so that the user method
knows if it should retry now or return an error when the graph is
canceled.

bt_graph_add_component() returns BT_GRAPH_STATUS_CANCELED if the graph
is canceled. If the user's initialization method fails, its return
component status is converted to the appropriate graph status.

Another advantage of adding a component to a graph is that, if you add a
"port added" graph listener, it is guaranteed that the listener is
called even for the initial ports of a component. This was not possible
before.

This patch also makes a component's name mandatory, and
bt_graph_add_component() ensures that there are components sharing the
same name part of a given graph. This is a constraint similar to the
fact that all the ports of a component must have a unique name. It
should help to the implementation of a function to retrieve a component
by name from a graph in the future.

We do not check that a graph has or not "loose", disconnected components
in bt_graph_consume(). This is not a change because any component can
remove all its ports once connected once and become loose. A graph with
floating/loose components is said to be disconnected in classical graph
theory. This is not a problem for the moment, as the connected
components can still interact. The disconnected components should
probably be marked and then destroyed in bt_graph_consume() and/or in a
dedicated garbage collecting function if needed
(bt_graph_remove_disconnected_components() for example).

This patch also makes successfully user-initialized components marked as
such so that the user's finalization method is not called if its
initialization method failed. In other words, the initialization method
is responsible for any cleanup if it's about to fail.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolttng-live: correctly handle ctrl-c and fix leaks
Mathieu Desnoyers [Wed, 7 Jun 2017 23:23:58 +0000 (19:23 -0400)] 
lttng-live: correctly handle ctrl-c and fix leaks

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoEnd connection on destruction
Philippe Proulx [Wed, 7 Jun 2017 22:31:41 +0000 (18:31 -0400)] 
End connection on destruction

End connection on destruction so that each port is disconnected once the
connection is destroyed. Otherwise each port keeps its connection
pointer as is which point to freed memory.

bt_connection_end() already makes sure to finalize each created
notification iterator, so all is left in the destructor is to free the
array of iterators and the connection itself.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoCancel the graph on destruction
Philippe Proulx [Wed, 7 Jun 2017 22:12:03 +0000 (18:12 -0400)] 
Cancel the graph on destruction

Consider the graph as canceled at the beginning of its destruction. This
prohibits the use of some operations that are restricted to be used when
the graph is active and running.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoconnection.c: refuse to create a notif. iter. when the graph is canceled
Philippe Proulx [Wed, 7 Jun 2017 22:03:54 +0000 (18:03 -0400)] 
connection.c: refuse to create a notif. iter. when the graph is canceled

It is useless to create a notification iterator from a connection which
belongs to a canceled graph.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolib/graph/{filter.c,sink.c,source.c}: fix log messages
Philippe Proulx [Wed, 7 Jun 2017 22:01:16 +0000 (18:01 -0400)] 
lib/graph/{filter.c,sink.c,source.c}: fix log messages

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove dependancies on ctf.fs source component caused by former logging API
Jérémie Galarneau [Wed, 7 Jun 2017 20:17:35 +0000 (16:17 -0400)] 
Remove dependancies on ctf.fs source component caused by former logging API

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMove ctf-fs source query implementations to their own file
Jérémie Galarneau [Mon, 5 Jun 2017 18:30:16 +0000 (14:30 -0400)] 
Move ctf-fs source query implementations to their own file

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: do not use BT_MOVE() when the destination memory could be uninitialized
Philippe Proulx [Wed, 7 Jun 2017 21:51:46 +0000 (17:51 -0400)] 
Fix: do not use BT_MOVE() when the destination memory could be uninitialized

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMake bt_private_connection_create_notification_iterator() return a status code
Philippe Proulx [Wed, 7 Jun 2017 21:45:59 +0000 (17:45 -0400)] 
Make bt_private_connection_create_notification_iterator() return a status code

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRefuse to add port to component when parent graph is canceled
Philippe Proulx [Wed, 7 Jun 2017 20:24:13 +0000 (16:24 -0400)] 
Refuse to add port to component when parent graph is canceled

The objects owned by a graph should not be able to perform any useless
action. Having those constraints promise that certain contained objects
remain within certain states when the graph is canceled.

In this case, it is useless for a component to add a port, since this
port cannot be connected to another one within the same graph because
bt_graph_connect_ports() is not permitted when the graph is canceled.

We still allow ports to be removed when the graph is canceled for
symetric teardowns, for example.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agograph.c: do not warn when the graph is canceled during bt_graph_run()
Philippe Proulx [Wed, 7 Jun 2017 20:12:56 +0000 (16:12 -0400)] 
graph.c: do not warn when the graph is canceled during bt_graph_run()

If the graph is canceled during bt_graph_run()'s loop, do not warn: this
was intentionally done during the execution by another thread or by a
signal handler. Log a debug message and quit with the usual
BT_GRAPH_STATUS_CANCELED status.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd internal bt_component_borrow_graph()
Philippe Proulx [Wed, 7 Jun 2017 19:27:09 +0000 (15:27 -0400)] 
Add internal bt_component_borrow_graph()

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMake bt_private_component_*_add_*_port() return a status code
Philippe Proulx [Wed, 7 Jun 2017 19:26:34 +0000 (15:26 -0400)] 
Make bt_private_component_*_add_*_port() return a status code

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMake bt_graph_connect_ports() return a status code
Philippe Proulx [Wed, 7 Jun 2017 16:38:17 +0000 (12:38 -0400)] 
Make bt_graph_connect_ports() return a status code

bt_graph_connect_ports() can fail for multiple reasons, some of which
are not errors per se, but conditions which make the connection
impossible, for example a component refuses the connection, or the graph
is canceled.

With this version, the connection is returned as an output parameter,
which can be NULL if the user is not interested in the connection object
(most common case), and the function returns a graph status code.

Two new status codes are added in order to satisfy this patch:

* BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION
* BT_GRAPH_STATUS_NOMEM

The first one is not considered an error, that is, the graph's user
could only _try_ to connect two components until the function returns
BT_GRAPH_STATUS_OK (and retry in case of
BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd bt_connection_is_ended()
Philippe Proulx [Wed, 7 Jun 2017 15:52:37 +0000 (11:52 -0400)] 
Add bt_connection_is_ended()

Quickly indicates if a connection is ended without having to get and
puts its individual endpoint ports.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoplugins/ctf/common/notif-iter/notif-iter.c: add logging
Philippe Proulx [Tue, 6 Jun 2017 18:58:36 +0000 (14:58 -0400)] 
plugins/ctf/common/notif-iter/notif-iter.c: add logging

Remove the logging of the payload returned by the request_bytes() medium
operation of the ctf.lttng.live CC because it is now logged after
calling this user function in the common notif-iter.c.

Make bt_ctf_field_path_string() static in its internal header instead of
BT_HIDDEN because otherwise the plugin cannot access it.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: flush open packets on destroy
Julien Desfossez [Mon, 5 Jun 2017 21:11:38 +0000 (17:11 -0400)] 
fs-sink: flush open packets on destroy

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix sink.ctf.fs: mark the trace as static on destroy
Julien Desfossez [Mon, 5 Jun 2017 20:08:34 +0000 (16:08 -0400)] 
Fix sink.ctf.fs: mark the trace as static on destroy

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: fix check trace completed when static is set
Julien Desfossez [Mon, 5 Jun 2017 19:56:24 +0000 (15:56 -0400)] 
fs-sink: fix check trace completed when static is set

The input trace could be set static when all its streams are closed, so
we need to check if the trace is completed in the trace_static callback
as well.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolttng-live: populate trace name
Mathieu Desnoyers [Mon, 5 Jun 2017 21:25:11 +0000 (17:25 -0400)] 
lttng-live: populate trace name

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: cancel a notif. iter. finalized during its "next" method
Philippe Proulx [Mon, 5 Jun 2017 19:18:11 +0000 (15:18 -0400)] 
Fix: cancel a notif. iter. finalized during its "next" method

It is possible that the user's "next" method, somehow, cancels its own
notification iterator. This can happen, for example, when the user's
method removes the port on which there's the connection from which the
notification iterator was created. In this case, said connection is
ended, and all its notification iterators are finalized.

In ensure_queue_has_notifications(), after calling the user's "next"
method, if there's no error, we check if the notification iterator is
finalized. If so, we return the BT_NOTIFICATION_ITERATOR_STATUS_CANCELED
status directly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: do not allow a notif. iter. to call the user's "next" method once finalized
Philippe Proulx [Mon, 5 Jun 2017 16:52:29 +0000 (12:52 -0400)] 
Fix: do not allow a notif. iter. to call the user's "next" method once finalized

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: do not try to create initial packet/event fields when opt. FT is NULL
Philippe Proulx [Fri, 2 Jun 2017 18:11:49 +0000 (14:11 -0400)] 
ir: do not try to create initial packet/event fields when opt. FT is NULL

If a trace has not packet header field type, then when creating a
packet, do not attempt to create the initial packet header field without
checking that the field type is NULL because this is a violation of
preconditions. The main side effect here is a WARN-level log message
even if the situation is normal.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agocopy_trace: copy the trace name
Julien Desfossez [Fri, 2 Jun 2017 15:12:52 +0000 (11:12 -0400)] 
copy_trace: copy the trace name

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: handle trace name
Julien Desfossez [Fri, 2 Jun 2017 14:33:19 +0000 (10:33 -0400)] 
fs-sink: handle trace name

Now the fs-sink uses the trace name to create the output path.
The trace name is appended after the path argument passed on the command
line.
If the resulting path exists, the plugin increments a numerical suffix
until it finds one or reaches INT_MAX.

The trace name is refused if it is ".." or contains "../".

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoalways copy packet/content_size, they are overwritten by the lib when necessary
Julien Desfossez [Fri, 2 Jun 2017 13:42:20 +0000 (09:42 -0400)] 
always copy packet/content_size, they are overwritten by the lib when necessary

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix copytrace: copy the entire payload_type
Julien Desfossez [Fri, 2 Jun 2017 13:37:01 +0000 (09:37 -0400)] 
Fix copytrace: copy the entire payload_type

Copy payload_type directly rather than iterating on its members.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoclock description is optional
Julien Desfossez [Fri, 2 Jun 2017 13:18:31 +0000 (09:18 -0400)] 
clock description is optional

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agomove the copy of event_context in ctf_copy_event_class
Julien Desfossez [Fri, 2 Jun 2017 13:12:03 +0000 (09:12 -0400)] 
move the copy of event_context in ctf_copy_event_class

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix copytrace: packet header is optional
Julien Desfossez [Fri, 2 Jun 2017 12:44:22 +0000 (08:44 -0400)] 
Fix copytrace: packet header is optional

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agosupport adding streams on non-static traces
Julien Desfossez [Thu, 1 Jun 2017 20:09:15 +0000 (16:09 -0400)] 
support adding streams on non-static traces

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove dead code from the debug-info component class
Julien Desfossez [Thu, 1 Jun 2017 19:49:52 +0000 (15:49 -0400)] 
Remove dead code from the debug-info component class

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix debug-info: handle event layouts of lttng-ust traces prior to 2.9
Julien Desfossez [Thu, 1 Jun 2017 19:16:18 +0000 (15:16 -0400)] 
Fix debug-info: handle event layouts of lttng-ust traces prior to 2.9

Traces produced by lttng-ust < 2.9 emitted errors on dl_open events, but
those are not errors, just missing information that we already handle.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: fix handling static notifications
Julien Desfossez [Thu, 1 Jun 2017 18:16:59 +0000 (14:16 -0400)] 
fs-sink: fix handling static notifications

Instead of relying on a stream count, keep a state for each stream.
This allows to check that we only see each stream once and works even if
each stream is started/completed sequentially.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: move stream and stream_class maps in fs_writer struct
Julien Desfossez [Wed, 31 May 2017 19:19:22 +0000 (15:19 -0400)] 
fs-sink: move stream and stream_class maps in fs_writer struct

The fs_writer struct is now responsible for those HT since they are only
relevant within the scope of a writer, not the whole component.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: explicitely handle stream_begin notif
Julien Desfossez [Wed, 31 May 2017 18:35:54 +0000 (14:35 -0400)] 
fs-sink: explicitely handle stream_begin notif

Instead of creating the new streams lazily when packets begin, this
allows to handle empty streams.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofs-sink: trace static handling + cleanup teardown
Julien Desfossez [Mon, 29 May 2017 22:30:27 +0000 (18:30 -0400)] 
fs-sink: trace static handling + cleanup teardown

When a trace is static and we have seen the stream_end notification for
all the active streams, we can free the resources for handling the
trace.

This also highlighted that a few bits were missing for a clean teardown
of the plugin.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoUse abort() instead of a false assertion
Philippe Proulx [Fri, 2 Jun 2017 17:48:13 +0000 (13:48 -0400)] 
Use abort() instead of a false assertion

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodoc/Makefile.am: do not install internal documentation
Philippe Proulx [Fri, 2 Jun 2017 17:26:02 +0000 (13:26 -0400)] 
doc/Makefile.am: do not install internal documentation

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agolib/ctf-writer/writer.c: logging: change tag to `CTF-WRITER`
Philippe Proulx [Fri, 2 Jun 2017 17:25:44 +0000 (13:25 -0400)] 
lib/ctf-writer/writer.c: logging: change tag to `CTF-WRITER`

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd missing include of unistd.h
Michael Jeanson [Thu, 1 Jun 2017 22:31:48 +0000 (18:31 -0400)] 
Add missing include of unistd.h

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: use portable print format for size_t
Michael Jeanson [Tue, 30 May 2017 19:55:15 +0000 (15:55 -0400)] 
Port: use portable print format for size_t

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoPort: internal logging print format for mingw
Michael Jeanson [Tue, 30 May 2017 19:38:24 +0000 (15:38 -0400)] 
Port: internal logging print format for mingw

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.044081 seconds and 4 git commands to generate.