[lttng-dev] [PATCH lttng-tools] Fix: tests: register thread for RCU operations.

Jérémie Galarneau jeremie.galarneau at efficios.com
Tue Feb 14 20:56:42 UTC 2017


Merged in master, stable-2.9 and stable-2.8.

Thanks,
Jérémie

On 26 January 2017 at 14:53, Jonathan Rajotte
<jonathan.rajotte-julien at efficios.com> wrote:
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> ---
>  tests/unit/test_session.c  | 4 ++++
>  tests/unit/test_ust_data.c | 5 +++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/tests/unit/test_session.c b/tests/unit/test_session.c
> index f2343c9..03e6b91 100644
> --- a/tests/unit/test_session.c
> +++ b/tests/unit/test_session.c
> @@ -24,6 +24,7 @@
>  #include <unistd.h>
>  #include <time.h>
>  #include <sys/types.h>
> +#include <urcu.h>
>
>  #include <tap/tap.h>
>
> @@ -302,6 +303,8 @@ int main(int argc, char **argv)
>
>         diag("Sessions unit tests");
>
> +       rcu_register_thread();
> +
>         test_session_list();
>
>         test_create_one_session();
> @@ -318,6 +321,7 @@ int main(int argc, char **argv)
>
>         test_large_session_number();
>
> +       rcu_unregister_thread();
>         assert(!fini_ht_cleanup_thread(&ht_cleanup_thread));
>
>         return exit_status();
> diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c
> index cf795cf..7996b8e 100644
> --- a/tests/unit/test_ust_data.c
> +++ b/tests/unit/test_ust_data.c
> @@ -23,6 +23,7 @@
>  #include <string.h>
>  #include <unistd.h>
>  #include <time.h>
> +#include <urcu.h>
>
>  #include <lttng/lttng.h>
>  #include <bin/lttng-sessiond/lttng-ust-abi.h>
> @@ -257,11 +258,15 @@ int main(int argc, char **argv)
>
>         diag("UST data structures unit test");
>
> +       rcu_register_thread();
> +
>         test_create_one_ust_session();
>         test_create_ust_channel();
>         test_create_ust_event();
>         test_create_ust_context();
>         test_create_ust_event_exclusion();
>
> +       rcu_unregister_thread();
> +
>         return exit_status();
>  }
> --
> 2.7.4
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list