babeltrace:master

Last commit made on 2019-08-20
Get this branch:
git clone -b master https://git.launchpad.net/babeltrace

Branch merges

Branch information

Name:
master
Repository:
lp:babeltrace

Recent commits

8a08b7c... by Simon Marchi <email address hidden> on 2019-08-18

lib: make g++ happy with plugin-dev.h macros

g++ doesn't like the syntax used for assigning structures in the plugin
macros:

  /tmp/babeltrace/include/babeltrace2/plugin/plugin-dev.h:599:3: error: expected primary-expression before ‘.’ token
     .value._attr_name = _x, \
     ^
  /tmp/babeltrace/include/babeltrace2/plugin/plugin-dev.h:871:2: note: in expansion of macro ‘__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE’
    __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD, _id, _comp_class_id, source, _x)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /tmp/babeltrace/include/babeltrace2/plugin/plugin-dev.h:1356:2: note: in expansion of macro ‘BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID’
    BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  can.cpp:829:1: note: in expansion of macro ‘BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD’
   BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(CANSource, can_iter_init);
   ^

Changing

    .value._attr_name = _x

to

    .value = { ._attr_name = _x }

makes it work. There are a few instances of this, I changed all I found.

Built-tested with gcc 7.4.0 and clang-9, and verified that a plugin compiled
with g++ 7.4.0 works.

Change-Id: I17cb4edf1082003dc0bb9d0fae906c391daf3da4
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1964
Reviewed-by: Jérémie Galarneau <email address hidden>
Tested-by: jenkins <email address hidden>

561e704... by Simon Marchi <email address hidden> on 2019-08-16

bt2: don't show warning when query method raises a non-error exception

I noticed that when a Python query raised bt2.UnknownObject, we show
this warning:

 W BT2-PY component_class_query@native_bt_component_class.i.h:802 Failed to call Python class's _bt_query_from_native() method: py-cls-addr=0x6190001090a0

In my opinion, a query returning "unknown object" is part of the normal
course of operation, and we should not show a warning. So, only show it
when the exception gets translated to a status < 0. Also, append an
error cause while at it in case of error.

Change-Id: I079f67b74df881ab000c6e223667ca72dcd52713
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1952
CI-Build: Philippe Proulx <email address hidden>
Tested-by: jenkins <email address hidden>
Reviewed-by: Philippe Proulx <email address hidden>

87cd0f0... by .eepp on 2019-08-17

bt_common_parse_lttng_live_url(): don't accept `net://RDHOST/host/TGTHOST`

This patch makes the bt_common_parse_lttng_live_url() function not
accept LTTng live URLs with the form:

    net[4]://RDHOST[:RDPORT]/host/TGTHOST

This was previously accepted for the session listing feature, but in
fact the `babeltrace` program (Babeltrace 1) only accepts this form:

    net[4]://RDHOST[:RDPORT]

and the list of URLs that the `babeltrace2` program prints with the
first form is invalid.

Signed-off-by: Philippe Proulx <email address hidden>
Change-Id: I68a804c69ec557ed9cc77c9020afbbe2f79a7c43
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1961
Tested-by: jenkins <email address hidden>

a91cb83... by .eepp on 2019-08-16

src.ctf.lttng-live: return unsigned integers in `sessions` query object

Signed-off-by: Philippe Proulx <email address hidden>
Change-Id: I1a0f505ee17f5657395d358dfcaa09fdc8e2afa1
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1960
Tested-by: jenkins <email address hidden>

c57d9a6... by .eepp on 2019-08-16

Fix: pass `inputs` parameter to implicit `src.ctf.lttng-live`, not `url`

Since the `src.ctf.lttng-live` component class started to handle the
`babeltrace.support-info` query object, its component accepts the
`inputs` array parameter, not the `url` string parameter.

Signed-off-by: Philippe Proulx <email address hidden>
Change-Id: I5d74a16c50ba16518a12be9064afd604c456e3fb
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1959
Tested-by: jenkins <email address hidden>

3971c70... by Simon Marchi <email address hidden> on 2019-08-15

cli: allow map values in --params arguments

This patch makes it possible to use map values in --params arguments.
For example:

    --params 'a={hi="mlady",mapping={tete="epaule",genou="orteil"}}'

The chosen syntax uses curly braces to delimit the map. It uses an
equal sign between the key an value, to be consistent with the syntax of
the implicit map at the top-level of `--params` values.

Speaking of which: it's not done in this patch, but it should be
possible to make the new function a bit more generic and re-use it for
parsing the top-level dict of `--params` values.

Change-Id: I1400ff6a2cf6c9132a9c5dd731a462f43225146b
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1936
Tested-by: jenkins <email address hidden>
Reviewed-by: Philippe Proulx <email address hidden>

7b8c513... by Simon Marchi <email address hidden> on 2019-08-15

tests: add tests for CLI params parsing

Add tests that checks various forms of valid parameters passed to the
CLI.

Change-Id: I81eb0ceefb6e4326fa001febbecfee5c66ad18c1
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1943
Tested-by: jenkins <email address hidden>
Reviewed-by: Philippe Proulx <email address hidden>

be05cb0... by Simon Marchi <email address hidden> on 2019-08-15

cli: exit with error if a plugin fails to load

The CLI is currently permissive when plugins fails to load, it will
display an error but carry on. To make it easier for users to catch
configuration and programming problems, this patch changes that be
strict. If a plugin fails to load (for example, Python syntax error),
the CLI stops and the error is reported to the user.

If this ever becomes a problem (a user would like to carry on even
though some plugin fails to load), we can add a switch like
`--ignore-plugin-loading-error` to have a permissive mode.

Change-Id: Ic89d4e044ecdc34a6e169309479e17bb947ae637
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1937
Tested-by: jenkins <email address hidden>
Reviewed-by: Philippe Proulx <email address hidden>

ebddaeb... by Simon Marchi <email address hidden> on 2019-08-14

cli: set log levels earlier

The problem this patch is aiming to solve is that the effective log
level is not set when executing bt_config_convert_from_args. For
example, bt_python_bindings_bt2_log_level is still NONE, only to be set
later. So if Python plugin fails to be imported during the auto source
discovery phase, nothing will be logged, making debugging quite
difficult. Any argument passed (top level --log-level, --debug or
--verbose) won't help because they will take effect later, when we call
set_auto_log_levels.

This patch moves the call to set_auto_log_levels earlier, as soon as we
know what the default log level will be. For all commands but
`convert`, it is after we are done parsing the top-level arguments. The
default log level will be the most verbose any --debug, --verbose or
--log-level argument passed.

With the `convert` command, it is possible to pass --debug and
--verbose, with the same effect as the top-level equivalents. So for
this command, we call set_auto_log_levels just after parsing its
arguments.

The --debug argument sets the log level to TRACE and the --verbose
argument sets it to INFO. If more than one of --debug, --verbose and
--log-level are specified, the most verbose level of all specified
arguments is chosen.

Note that the --log-level argument of the convert command is not the
same as the top-level's --log-level argument. The argument of the
convert command sets the --log-level of a specific component or
auto-source-discovery input.

The behavior of the environment variables LIBBABELTRACE2_INIT_LOG_LEVEL,
BABELTRACE_PLUGIN_CTF_METADATA_LOG_LEVEL and
BABELTRACE_PYTHON_BT2_LOG_LEVEL is kept. If they are specified, they
force the log level of the corresponding subsystem, overriding the
log level specified on the command line.

Change-Id: I9ac558737df4789fc8f5bd8d0240887b3b11b295
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1935
Tested-by: jenkins <email address hidden>
Reviewed-by: Philippe Proulx <email address hidden>

70dfe5e... by Simon Marchi <email address hidden> on 2019-08-14

cli: return if bt_plugin_find_all_from_dir fails in load_dynamic_plugins

If the call to bt_plugin_find_all_from_dir in load_dynamic_plugins
returns an error (a negative status code), we currently continue
execution as if nothing happened.

This patch makes it so that we exit the loop and report the error to the
caller.

Change-Id: Ib22813b92fe06156cde1681c55651a294cd67909
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1934
Tested-by: jenkins <email address hidden>
Reviewed-by: Philippe Proulx <email address hidden>