Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jeremie.galarneau@efficios.com (Jérémie Galarneau)
Subject: [lttng-dev] [PATCH lttng-tools 10/10] test: UST tracing destroy flush behavior with tracefile rotation
Date: Thu, 19 May 2016 00:46:08 -0400	[thread overview]
Message-ID: <CA+jJMxupEOTnmbLvfzYbCUE-d=4B0CrJrVQ2iX_kjyKYB4rLxQ@mail.gmail.com> (raw)
In-Reply-To: <1463594659-10964-11-git-send-email-mathieu.desnoyers@efficios.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 8173 bytes --]

Merged, thanks!

Jérémie

On Wed, May 18, 2016 at 2:04 PM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
>  configure.ac                                       |   1 +
>  tests/fast_regression                              |   1 +
>  tests/regression/ust/Makefile.am                   |   3 +-
>  .../ust/rotation-destroy-flush/Makefile.am         |  16 +++
>  .../test_rotation_destroy_flush                    | 150 +++++++++++++++++++++
>  5 files changed, 170 insertions(+), 1 deletion(-)
>  create mode 100644 tests/regression/ust/rotation-destroy-flush/Makefile.am
>  create mode 100755 tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
>
> diff --git a/configure.ac b/configure.ac
> index 20d0680..0c1f976 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1002,6 +1002,7 @@ AC_CONFIG_FILES([
>         tests/regression/ust/getcpu-override/Makefile
>         tests/regression/ust/clock-override/Makefile
>         tests/regression/ust/type-declarations/Makefile
> +       tests/regression/ust/rotation-destroy-flush/Makefile
>         tests/stress/Makefile
>         tests/unit/Makefile
>         tests/unit/ini_config/Makefile
> diff --git a/tests/fast_regression b/tests/fast_regression
> index aa0c043..0c4f079 100644
> --- a/tests/fast_regression
> +++ b/tests/fast_regression
> @@ -27,5 +27,6 @@ regression/ust/java-log4j/test_java_log4j
>  regression/ust/python-logging/test_python_logging
>  regression/ust/getcpu-override/test_getcpu_override
>  regression/ust/clock-override/test_clock_override
> +regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
>  regression/ust/test_event_basic
>  regression/ust/test_event_tracef
> diff --git a/tests/regression/ust/Makefile.am b/tests/regression/ust/Makefile.am
> index 1b87cc9..7686251 100644
> --- a/tests/regression/ust/Makefile.am
> +++ b/tests/regression/ust/Makefile.am
> @@ -2,7 +2,8 @@ if HAVE_LIBLTTNG_UST_CTL
>  SUBDIRS = nprocesses high-throughput low-throughput before-after multi-session \
>                 overlap buffers-pid linking daemon exit-fast fork libc-wrapper \
>                 periodical-metadata-flush java-jul java-log4j python-logging \
> -               getcpu-override clock-override type-declarations
> +               getcpu-override clock-override type-declarations \
> +               rotation-destroy-flush
>
>  if HAVE_OBJCOPY
>  SUBDIRS += baddr-statedump ust-dl
> diff --git a/tests/regression/ust/rotation-destroy-flush/Makefile.am b/tests/regression/ust/rotation-destroy-flush/Makefile.am
> new file mode 100644
> index 0000000..14b869e
> --- /dev/null
> +++ b/tests/regression/ust/rotation-destroy-flush/Makefile.am
> @@ -0,0 +1,16 @@
> +noinst_SCRIPTS = test_rotation_destroy_flush
> +EXTRA_DIST = test_rotation_destroy_flush
> +
> +all-local:
> +       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
> +               for script in $(EXTRA_DIST); do \
> +                       cp -f $(srcdir)/$$script $(builddir); \
> +               done; \
> +       fi
> +
> +clean-local:
> +       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
> +               for script in $(EXTRA_DIST); do \
> +                       rm -f $(builddir)/$$script; \
> +               done; \
> +       fi
> diff --git a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
> new file mode 100755
> index 0000000..a7a9377
> --- /dev/null
> +++ b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
> @@ -0,0 +1,150 @@
> +#!/bin/bash
> +#
> +# Copyright (C) - 2015 Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> +# Copyright (C) - 2016 Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> +#
> +# This library is free software; you can redistribute it and/or modify it under
> +# the terms of the GNU Lesser General Public License as published by the Free
> +# Software Foundation; version 2.1 of the License.
> +#
> +# This library is distributed in the hope that it will be useful, but WITHOUT
> +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
> +# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
> +# details.
> +#
> +# You should have received a copy of the GNU Lesser General Public License
> +# along with this library; if not, write to the Free Software Foundation, Inc.,
> +# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
> +TEST_DESC="UST - Rotation destroy flush"
> +
> +CURDIR=$(dirname $0)/
> +TESTDIR=$CURDIR/../../..
> +SESSION_NAME="rotation_destroy_flush"
> +
> +TESTAPP_PATH="$TESTDIR/utils/testapp"
> +TESTAPP_NAME="gen-ust-events"
> +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
> +NUM_EVENT=1000000
> +EVENT_NAME="tp:tptest"
> +CHANNEL_NAME="testchan"
> +PAGE_SIZE=$(getconf PAGE_SIZE)
> +SIZE_LIMIT=$PAGE_SIZE
> +
> +NR_ITER=10
> +NUM_TESTS=$((15*$NR_ITER))
> +
> +# Ensure the daemons invoke abort on error.
> +export LTTNG_ABORT_ON_ERROR=1
> +
> +source $TESTDIR/utils/utils.sh
> +
> +# MUST set TESTDIR before calling those functions
> +function run_app()
> +{
> +       $TESTAPP_BIN $NUM_EVENT
> +       ok $? "Application done"
> +}
> +
> +function signal_cleanup()
> +{
> +       diag "*** Exiting ***"
> +       stop_lttng_sessiond
> +       exit 1
> +}
> +
> +function enable_ust_lttng_channel_size_limit ()
> +{
> +       sess_name="$1"
> +       channel_name="$2"
> +       tracefile_size_limit="$3"
> +
> +       test_name="Enable channel $channel_name "
> +       test_name+="for session $sess_name: "
> +       test_name+="$tracefile_size_limit bytes tracefile limit"
> +
> +       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel \
> +           -u $channel_name -s $sess_name --buffers-pid \
> +           -C $tracefile_size_limit >/dev/null 2>&1
> +
> +       ok $? "$test_name"
> +}
> +
> +function enable_ust_lttng_event_per_channel ()
> +{
> +       sess_name="$1"
> +       event_name="$2"
> +       channel_name="$3"
> +
> +       test_name="Enable event $event_name "
> +       test_name+="for session $sess_name "
> +       test_name+="in channel $channel_name"
> +
> +       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" \
> +           -s $sess_name -u -c $channel_name >/dev/null 2>&1
> +
> +       ok $? "$test_name"
> +}
> +
> +function test_rotation_destroy_flush_single()
> +{
> +       start_lttng_sessiond
> +
> +       create_lttng_session_ok $SESSION_NAME $TRACE_PATH
> +       enable_ust_lttng_channel_size_limit \
> +               $SESSION_NAME $CHANNEL_NAME $SIZE_LIMIT
> +       enable_ust_lttng_event_per_channel \
> +               $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
> +       start_lttng_tracing_ok $SESSION_NAME
> +       run_app
> +       # stop and destroy
> +       stop_lttng_tracing_ok $SESSION_NAME
> +       destroy_lttng_session_ok $SESSION_NAME
> +
> +       rm -rf $TRACE_PATH
> +
> +       create_lttng_session_ok $SESSION_NAME $TRACE_PATH
> +       enable_ust_lttng_channel_size_limit \
> +               $SESSION_NAME $CHANNEL_NAME $SIZE_LIMIT
> +       enable_ust_lttng_event_per_channel \
> +               $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
> +       start_lttng_tracing_ok $SESSION_NAME
> +       run_app
> +       # destroy only
> +       destroy_lttng_session_ok $SESSION_NAME
> +
> +       rm -rf $TRACE_PATH
> +
> +       stop_lttng_sessiond
> +}
> +
> +function test_rotation_destroy_flush()
> +{
> +       for a in $(seq 1 ${NR_ITER}); do
> +               diag "Iteration ${a}/${NR_ITER}"
> +               test_rotation_destroy_flush_single
> +       done
> +}
> +
> +
> +plan_tests $NUM_TESTS
> +
> +print_test_banner "$TEST_DESC"
> +
> +TESTS=(
> +       "test_rotation_destroy_flush"
> +)
> +
> +TEST_COUNT=${#TESTS[@]}
> +i=0
> +
> +while [ "$i" -lt "$TEST_COUNT" ]; do
> +
> +       trap signal_cleanup SIGTERM SIGINT
> +
> +       TRACE_PATH=$(mktemp -d)
> +
> +       # Execute test
> +       ${TESTS[$i]}
> +
> +       let "i++"
> +done
> --
> 2.1.4
>



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


  reply	other threads:[~2016-05-19  4:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 18:04 [lttng-dev] [PATCH lttng-tools 00/10] Fix: tracefile rotation rm-after-destroy race Mathieu Desnoyers
2016-05-18 18:04 ` [lttng-dev] [PATCH lttng-tools 06/10] Fix: error.h: add missing parenthesis around macro parameter Mathieu Desnoyers
2016-05-19  4:13   ` Jérémie Galarneau
2016-05-18 18:04 ` [lttng-dev] [PATCH lttng-tools 07/10] Fix: WARN() should print as WARN level, not ERR Mathieu Desnoyers
2016-05-19  4:14   ` Jérémie Galarneau
2016-05-18 18:04 ` [lttng-dev] [PATCH lttng-tools 08/10] Add environment variable to allow abort on error Mathieu Desnoyers
2016-05-19  4:45   ` Jérémie Galarneau
2016-05-18 18:04 ` [lttng-dev] [PATCH lttng-tools 09/10] test: kernel tracing destroy flush behavior with tracefile rotation Mathieu Desnoyers
2016-05-19  4:45   ` Jérémie Galarneau
2016-05-18 18:04 ` [lttng-dev] [PATCH lttng-tools 10/10] test: UST " Mathieu Desnoyers
2016-05-19  4:46   ` Jérémie Galarneau [this message]
     [not found] ` <1463594659-10964-2-git-send-email-mathieu.desnoyers@efficios.com>
2016-05-19  2:57   ` [lttng-dev] [PATCH lttng-tools 01/10] Fix: bad file descriptors on close after rotation error Jérémie Galarneau
     [not found] ` <1463594659-10964-3-git-send-email-mathieu.desnoyers@efficios.com>
2016-05-19  4:09   ` [lttng-dev] [PATCH lttng-tools 02/10] Fix: UST should not generate packet at destroy after stop Jérémie Galarneau
     [not found] ` <1463594659-10964-4-git-send-email-mathieu.desnoyers@efficios.com>
2016-05-19  4:09   ` [lttng-dev] [PATCH lttng-tools 03/10] Fix: kernel tracing: flush " Jérémie Galarneau
     [not found] ` <1463594659-10964-5-git-send-email-mathieu.desnoyers@efficios.com>
2016-05-19  4:12   ` [lttng-dev] [PATCH lttng-tools 04/10] Fix: ust-consumer: flush empty packets on snapshot channel Jérémie Galarneau
     [not found] ` <1463594659-10964-6-git-send-email-mathieu.desnoyers@efficios.com>
2016-05-19  4:12   ` [lttng-dev] [PATCH lttng-tools 05/10] Fix: bogus mask on error.h PRINT types Jérémie Galarneau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+jJMxupEOTnmbLvfzYbCUE-d=4B0CrJrVQ2iX_kjyKYB4rLxQ@mail.gmail.com' \
    --to=jeremie.galarneau@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox