Fix: disable event for JUL domain
authorDavid Goulet <dgoulet@efficios.com>
Fri, 5 Sep 2014 19:17:31 +0000 (15:17 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 5 Sep 2014 19:17:31 +0000 (15:17 -0400)
Could not be backported from master. Ref. commit is
0dcfcf94b356c12e3936fa27f350896d96724e4e

This fixes the disable event for JUL that was not working and fixes the
buggy test.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/event.c
tests/regression/ust/java-jul/test_java_jul
tests/utils/utils.sh

index 2ccffae657ba898c70c3ff161b46276a49f64486..280765a5f93bea165ea92c502f2718727af63d67 100644 (file)
@@ -768,6 +768,7 @@ int event_jul_disable(struct ltt_ust_session *usess, char *event_name)
                ret = LTTNG_ERR_UST_DISABLE_FAIL;
                goto error;
        }
+       uevent->enabled = 0;
 
        ret = jul_disable_event(jevent);
        if (ret != LTTNG_OK) {
index bf3bb0bc27dfa4820877acbe031f9bc84bebc2b2..421c0f51f5e8f387f906d35dd8ad8683281c3bf1 100755 (executable)
@@ -285,13 +285,13 @@ function test_jul_multi_session_disable()
        destroy_lttng_session $SESSION_NAME-2
 
        # Validate test. Expecting one event of the second TP.
-       trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
+       trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
        if [ $? -ne 0 ]; then
                return $?
        fi
 
        # Validate test. Expecting one event of the second TP.
-       trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
+       trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
        if [ $? -ne 0 ]; then
                return $?
        fi
@@ -430,7 +430,7 @@ function test_jul_disable()
        destroy_lttng_session $SESSION_NAME
 
        # Validate test. Expecting one event of the second TP only.
-       trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
+       trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
        if [ $? -ne 0 ]; then
                return $?
        fi
@@ -455,7 +455,7 @@ function test_jul_disable_enable()
        destroy_lttng_session $SESSION_NAME
 
        # Validate test. Expecting NR_ITER event of the main INFO tp.
-       trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
+       trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
        if [ $? -ne 0 ]; then
                return $?
        fi
index 9df1c4fe283e1d4f682804d99948faeecd5cc7f6..8cb664dd5c51a4c0bc116cbfa6c00eed2980a983 100644 (file)
@@ -472,3 +472,23 @@ function validate_trace
        IFS=$OLDIFS
        return $ret
 }
+
+function trace_match_only()
+{
+       local event_name=$1
+       local nr_iter=$2
+       local trace_path=$3
+
+       which $BABELTRACE_BIN >/dev/null
+       skip $? -ne 0 "Babeltrace binary not found. Skipping trace matches"
+
+       local count=$($BABELTRACE_BIN $trace_path | grep $event_name | wc -l)
+       local total=$($BABELTRACE_BIN $trace_path | wc -l)
+
+       if [ "$nr_iter" -eq "$count" ] && [ "$total" -eq "$nr_iter" ]; then
+               pass "Trace match with $total event $event_name"
+       else
+               fail "Trace match"
+               diag "$total event(s) found, expecting $nr_iter of event $event_name and only found $count"
+       fi
+}
This page took 0.037007 seconds and 4 git commands to generate.