babeltrace:master

Last commit made on 2021-02-19
Get this branch:
git clone -b master https://git.launchpad.net/babeltrace

Branch merges

Branch information

Name:
master
Repository:
lp:babeltrace

Recent commits

c429f86... by Michael Jeanson <email address hidden> on 2021-02-17

Fix: bootstrap with autoconf >= 2.70

We want to enable all warnings and treat them as errors when running
autoreconf but we have to disable 'obsolete' because of
AM_PATH_GLIB_2_0. Turns out that autoconf >= 2.70 will drop all other
warnings categories when 'all' is used. So the only way to enable all
categories but 'obsolete' is to list them all.

Change-Id: I6fae9c86130d79a1bc9d3bb7d0610a24d734532a
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Jérémie Galarneau <email address hidden>

4fb18ad... by Philippe Duplessis-Guindon <email address hidden> on 2020-10-16

Fix: lib: assert if an error occurs in `bt_message_iterator_class_finalize_method`

I tried to append an error with `BT_COMP_LOGE_APPEND_CAUSE_ERRNO`
in `bt_message_iterator_class_finalize_method` from a plugin, and
there was no error. The expected behavior would be for the plugin
to fail if there is an error on the current thread after returning.

This patch adds `BT_ASSERT_POST_NO_ERROR` and the assert fails if
there is an error on the current thread after returning

With this patch, here is the following output, which is the expected behavior:
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:64 Babeltrace 2 library postcondition not satisfied.
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:66 ------------------------------------------------------------------------
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:67 Condition ID: `post:message-iterator-class-finalize-method:no-error`.
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:69 Function: bt_message_iterator_class_finalize_method().
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:70 ------------------------------------------------------------------------
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:71 Error is:
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:73 Current thread has an error
 10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND <email address hidden>:76 Aborting...

Add `BT_ASSERT_POST_NO_ERROR` after calling the method.

Signed-off-by: Philippe Duplessis-Guindon <email address hidden>
Change-Id: I6cf6118661cbe615c1f6ddc77c8b3555dca3b526
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4201
CI-Build: Philippe Proulx <email address hidden>
Tested-by: jenkins <email address hidden>
Reviewed-by: Philippe Proulx <email address hidden>

c39793d... by Simon Marchi <email address hidden> on 2021-01-26

Fix: macro name for "get supported mip versions method" attribute descriptor

I tried to use BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD, I got:

    In file included from /home/simark/src/babeltrace/include/babeltrace2/babeltrace.h:67,
                     from /home/simark/src/babeltrace/src/cpp-common/bt2/plugin-dev.hpp:10,
                     from /home/simark/src/babeltrace/tests/cpp-common/plugin-dev/plugin.cpp:7:
    /home/simark/src/babeltrace/include/babeltrace2/plugin/plugin-dev.h:2214:91: error: ‘BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS’ was not declared in this scope; did you mean ‘BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD’?
     2214 | __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _plugin_id, _component_class_id, sink, _method)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/simark/src/babeltrace/include/babeltrace2/plugin/plugin-dev.h:2641:11: note: in definition of macro ‘__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE’
     2641 | .type = _attr_type, \
          | ^~~~~~~~~~
    /home/simark/src/babeltrace/include/babeltrace2/plugin/plugin-dev.h:2224:2: note: in expansion of macro ‘BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID’
     2224 | BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _method)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/simark/src/babeltrace/src/cpp-common/bt2/plugin-dev.hpp:110:5: note: in expansion of macro ‘BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD’
      110 | BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD( \
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/simark/src/babeltrace/tests/cpp-common/plugin-dev/plugin.cpp:19:1: note: in expansion of macro ‘BT_CPP_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD’
       19 | BT_CPP_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(the_sink, TheSink);
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I think it should be

    BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD

instead of

    BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS

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

3836459... by Michael Jeanson <email address hidden> on 2021-01-26

Fix: disable deprecation warnings for SWIG generated code

There is nothing we can do about deprecations in SWIG generated code so
silence this warning.

Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Jérémie Galarneau <email address hidden>
Change-Id: Ia3188e6e8fcb52a635d6793f4a40808479860252

b877064... by Simon Marchi <email address hidden> on 2021-01-26

Fix: configure: support Autoconf 2.70

This patch is stolen and adapted from lttng-tools' patch:

  https://git.lttng.org/?p=lttng-tools.git;a=commit;h=faa88ea855741f5c356d223011ff4b347576c7d2

The newly-released autoconf 2.70 introduces a number of breaking
changes [1] and is being rolled-out by some distros.

Amongst those changes, the AC_PROG_CC_STDC macro is marked as obsolete
and was merged into AC_PROG_CC, which we already use. On 2.70, this
results in a warning which we handle as an error.

A version check is added to invoke the AC_PROG_CC_STDC macro only when
running a pre-2.70 version of autoconf, fixing the issue.

The AC_PROG_LEX now takes an argument, and the argument-less version is
marked as obsolete. The macro is invoked with the `noyywrap` option, as
recommended in the documentation.

Also, the AX_PTHREAD macro makes use of the $as_echo built-in shell
variable which no longer exists in 2.70. A patch was submitted to the
GNU Autoconf archive in March, but there have been no signs of life
given since then [2].

As such, our local copy is updated to the latest version and the patch
(which looks fairly straight-forward / safe) is applied. This should
minimize changes once we go back to an "official" version of the macro.

Some issues with glib2 remain:

    configure.ac:264: warning: The macro `AC_TRY_RUN' is obsolete.
    configure.ac:264: You should run autoupdate.
    ./lib/autoconf/general.m4:2996: AC_TRY_RUN is expanded from...
    /usr/share/aclocal/glib-2.0.m4:11: AM_PATH_GLIB_2_0 is expanded from...
    configure.ac:264: the top level
    configure.ac:264: warning: The macro `AC_TRY_LINK' is obsolete.
    configure.ac:264: You should run autoupdate.
    ./lib/autoconf/general.m4:2919: AC_TRY_LINK is expanded from...
    /usr/share/aclocal/glib-2.0.m4:11: AM_PATH_GLIB_2_0 is expanded from...
    configure.ac:264: the top level

Those have been fixed upstream:

  https://gitlab.gnome.org/GNOME/glib/-/commit/6f26637e83727b05f865389937bb07c761c13c12

so it's always possible to get the modifications from there for local
development.

[1] https://lwn.net/Articles/839395/
[2] https://savannah.gnu.org/patch/?9906

Signed-off-by: Jérémie Galarneau <email address hidden>
Signed-off-by: Simon Marchi <email address hidden>
Reviewed-by: Michael Jeanson <email address hidden>
Change-Id: Ia9f5ac6721a556238e84bee64d57e04bf378fee9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4743
Reviewed-by: Michael Jeanson <email address hidden>

d6eb67a... by .eepp on 2020-09-10

Add `dev-requirements.txt` for pip

`dev-requirements.txt` contains which specific version of Black and
Flake8 to use for development and by a CI so that both parties agree.

Use specific versions as such:

    $ virtualenv -p python3 yo
    $ . yo/bin/activate
    $ pip install -r dev-requirements.txt

Signed-off-by: Philippe Proulx <email address hidden>
Change-Id: Id29e7f61c4038b55bed613e00f76f7c180699fa9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4057
CI-Build: Michael Jeanson <email address hidden>
Tested-by: jenkins <email address hidden>
Reviewed-by: Michael Jeanson <email address hidden>
Reviewed-by: Jérémie Galarneau <email address hidden>

8009058... by Fabrice Fontaine on 2020-09-26

tests/lib/test_trace_ir_ref.c: rename user structure

Rename user structure to bt_user to avoid the following build failure
with uclibc:

test_trace_ir_ref.c:41:8: error: redefinition of 'struct user'
 struct user {
        ^
In file included from /home/naourr/work/instance-0/output-1/per-package/babeltrace2/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/sys/procfs.h:33,
                 from /home/naourr/work/instance-0/output-1/per-package/babeltrace2/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/sys/ucontext.h:25,
                 from /home/naourr/work/instance-0/output-1/per-package/babeltrace2/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/signal.h:329,
                 from /home/naourr/work/instance-0/output-1/per-package/babeltrace2/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/glib-2.0/glib/gbacktrace.h:36,
                 from /home/naourr/work/instance-0/output-1/per-package/babeltrace2/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/glib-2.0/glib.h:34,
                 from ../../src/common/assert.h:28,
                 from ../../src/lib/object.h:28,
                 from test_trace_ir_ref.c:25:
/home/naourr/work/instance-0/output-1/per-package/babeltrace2/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/sys/user.h:48:8: note: originally defined here
 struct user
        ^~~~

Fixes:
 - http://autobuild.buildroot.org/results/e4229e2b9c892b419a9d2eaa6929b80ea62dd130

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

826b467... by .eepp on 2020-12-07

src/common/{assert,macros}.h: wrap code in C++ guards

Not strictly needed for `macros.h`, but adding it just in case.

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

fb7ff11... by .eepp on 2020-11-19

CONTRIBUTING.adoc: document C++ usage

This patch adds a C++ usage section to `CONTRIBUTING.adoc` as a baseline
of rules and recommended practices to write C++ code for Babeltrace 2.

The reminders at the end of the document are some points I could
initially think of, but we'll add more and probably categorize them as
we write C++ code for this project.

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

35cbc59... by .eepp on 2020-11-19

Add `.clang-format` file for C++ source files

This patch adds the `.clang-format` file which contains a style to be
applied automatically by the clang-format [1] tool to the project's C++
files.

To apply the style to all the project's C++ files, run:

    $ find -iname '*.cpp' -o -iname '*.hpp' -exec clang-format -i '{}' ';'

As of this patch, the project has no C++ files. This patch is part of an
effort to lay the ground for the introduction of C++ sources in
Babeltrace 2.

I chose to set the `PointerAlignment` style setting to `Left` as
clang-format also uses it for references:

    const char* str

    const std::string& str

[1]: https://clang.llvm.org/docs/ClangFormat.html

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