Most of the helper functions had inconsistent naming.
Suggested naming convention for helper functions:
<action>_<bin_name>
or
<action>_lttng_<command>
List of modified helper functions:
lttng_start_relayd -> start_lttng_relayd
lttng_stop_relayd -> stop_lttng_relayd
start_sessiond -> start_lttng_sessiond
stop_sessiond -> stop_lttng_sessiond
start_tracing -> start_lttng_tracing
stop_tracing -> stop_lttng_tracing
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
continue
fi
- start_sessiond
+ start_lttng_sessiond
./$bin $tmpdir
# Test must return 0 to pass.
if [ $? -ne 0 ]; then
exit_code=1
- stop_sessiond
+ stop_lttng_sessiond
break
fi
- stop_sessiond
+ stop_lttng_sessiond
done
# Cleaning up
lttng_create_session
lttng_enable_consumer_localhost
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
# Give a second
sleep 1
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
}
echo -e "\n=== Testing kernel streaming with event enable AFTER start\n"
lttng_create_session
lttng_enable_consumer_localhost
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
# Give a second
sleep 1
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
}
-start_sessiond
-lttng_start_relayd "-o $TRACE_PATH"
+start_lttng_sessiond
+start_lttng_relayd "-o $TRACE_PATH"
tests=( test_kernel_before_start )
done
echo ""
-stop_sessiond
-lttng_stop_relayd
+stop_lttng_sessiond
+stop_lttng_relayd
exit $out
# Run 5 times with a 1 second delay
./$CURDIR/$BIN_NAME 5 1000000 >/dev/null 2>&1 &
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
wait_apps
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
}
lttng_create_session
lttng_enable_consumer
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
# Run 5 times with a 1 second delay
./$CURDIR/$BIN_NAME 5 1000000 >/dev/null 2>&1 &
wait_apps
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
}
-start_sessiond
-lttng_start_relayd "-o $TRACE_PATH"
+start_lttng_sessiond
+start_lttng_relayd "-o $TRACE_PATH"
tests=( test_ust_before_start test_ust_after_start )
done
echo ""
-stop_sessiond
-lttng_stop_relayd
+stop_lttng_sessiond
+stop_lttng_relayd
exit $out
done
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
run_apps
wait_apps
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$RAND
lttng_create_session $FILE_URI
lttng_enable_consumer "$NETWORK_URI/$NET_PATH"
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
run_apps
wait_apps
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$NET_PATH
lttng_create_session $NETWORK_URI
lttng_enable_consumer "$FILE_URI/$FILE_PATH"
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
run_apps
wait_apps
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
validate_trace $EVENT_NAME $TMP_PATH/$FILE_PATH
}
-start_sessiond
+start_lttng_sessiond
echo ""
echo "=== Testing with IPv4"
-lttng_start_relayd "-o $TRACE_PATH"
+start_lttng_relayd "-o $TRACE_PATH"
test_uri_switch_localhost_folder "IPv4"
test_uri_switch_file_network "IPv4"
test_uri_switch_network_file "IPv4"
-lttng_stop_relayd
+stop_lttng_relayd
echo ""
echo "=== Testing with IPv6"
-lttng_start_relayd "-o $TRACE_PATH -C tcp6://localhost:5342 -D tcp6://localhost:5343"
+start_lttng_relayd "-o $TRACE_PATH -C tcp6://localhost:5342 -D tcp6://localhost:5343"
test_uri_switch_localhost_folder "IPv6"
test_uri_switch_file_network "IPv6"
test_uri_switch_network_file "IPv6"
-lttng_stop_relayd
+stop_lttng_relayd
-stop_sessiond
+stop_lttng_sessiond
# BEFORE application is spawned
create_lttng_session $SESSION_NAME $TRACE_PATH
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
# Start test
echo -n "Starting application... "
./$CURDIR/gen-nevents $NR_ITER
echo -n "Ended "
print_ok
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
# BEFORE application is spawned
create_lttng_session $SESSION_NAME $TRACE_PATH
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_tracing $SESSION_NAME
+ start_lttng_tracing $SESSION_NAME
# At least hit one event
sleep 2
- stop_tracing $SESSION_NAME
+ stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
# MUST set TESTDIR before calling those functions
-start_sessiond
+start_lttng_sessiond
echo ""
echo "=== Start application BEFORE tracing was started ==="
test_before_apps
out=$?
if [ $out -ne 0 ]; then
- stop_sessiond
+ stop_lttng_sessiond
exit $out
fi
test_after_apps
out=$?
if [ $out -ne 0 ]; then
- stop_sessiond
+ stop_lttng_sessiond
exit $out
fi
-stop_sessiond
+stop_lttng_sessiond
rm -rf $TRACE_PATH
# MUST set TESTDIR before calling those functions
-start_sessiond
+start_lttng_sessiond
create_lttng_session $SESSION_NAME $TRACE_PATH
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_tracing $SESSION_NAME
+start_lttng_tracing $SESSION_NAME
for i in `seq 1 $NR_ITER`; do
./$CURDIR/$BIN_NAME & >/dev/null 2>&1
done
echo ""
-stop_tracing $SESSION_NAME
+stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
-stop_sessiond
+stop_lttng_sessiond
# Validate test
# MUST set TESTDIR before calling those functions
-start_sessiond
+start_lttng_sessiond
create_lttng_session $SESSION_NAME $TRACE_PATH
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_tracing $SESSION_NAME
+start_lttng_tracing $SESSION_NAME
# This is going to take 20 minutes
./$CURDIR/$BIN_NAME >/dev/null 2>&1
-stop_tracing $SESSION_NAME
+stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
-stop_sessiond
+stop_lttng_sessiond
# Validate test
for i in `seq 0 3`; do
create_lttng_session "$SESSION_NAME-$i" "$TRACE_PATH/$i"
enable_ust_lttng_event "$SESSION_NAME-$i" "$EVENT_NAME$i"
- start_tracing "$SESSION_NAME-$i"
+ start_lttng_tracing "$SESSION_NAME-$i"
done
echo -n "Starting application generating $NR_ITER events... "
print_ok
for i in `seq 0 3`; do
- stop_tracing "$SESSION_NAME-$i"
+ stop_lttng_tracing "$SESSION_NAME-$i"
destroy_lttng_session "$SESSION_NAME-$i"
out=$(babeltrace "$TRACE_PATH/$i" | grep "$EVENT_NAMEi$i" | wc -l)
if [ $out -ne $NR_ITER ]; then
# MUST set TESTDIR before calling those functions
-start_sessiond
+start_lttng_sessiond
TRACE_PATH=$(mktemp -d)
test_multi_session
out=$?
if [ $out -ne 0 ]; then
- stop_sessiond
+ stop_lttng_sessiond
exit $out
fi
-stop_sessiond
+stop_lttng_sessiond
rm -rf "$TRACE_PATH"
# MUST set TESTDIR before calling those functions
-start_sessiond
+start_lttng_sessiond
./$CURDIR/ust-nprocesses $NR_ITER
-stop_sessiond
+stop_lttng_sessiond
exit 0
create_lttng_session $SESSION_NAME $TRACE_PATH
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_tracing $SESSION_NAME
+start_lttng_tracing $SESSION_NAME
echo "Sleeping $TEST_WAIT_SEC seconds for tracing to start everywhere"
echo "Warning: this arbitrary time can make the test fail on slower system"
sleep $TEST_WAIT_SEC
-stop_tracing $SESSION_NAME
+stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
rm -rf $TRACE_PATH
continue
fi
- start_sessiond
+ start_lttng_sessiond
./$bin $tmpdir
# Test must return 0 to pass.
if [ $? -ne 0 ]; then
exit_code=1
- stop_sessiond
+ stop_lttng_sessiond
break
fi
- stop_sessiond
+ stop_lttng_sessiond
done
# Cleaning up
fi
}
-function lttng_start_relayd
+function start_lttng_relayd
{
local opt="$1"
fi
}
-function lttng_stop_relayd
+function stop_lttng_relayd
{
PID_RELAYD=`pidof lt-$RELAYD_BIN`
fi
}
-function start_sessiond()
+function start_lttng_sessiond()
{
if [ -n $TEST_NO_SESSIOND ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
# Env variable requested no session daemon
sleep 2
}
-function stop_sessiond ()
+function stop_lttng_sessiond ()
{
if [ -n $TEST_NO_SESSIOND ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
# Env variable requested no session daemon
fi
}
-function start_tracing ()
+function start_lttng_tracing ()
{
sess_name=$1
fi
}
-function stop_tracing ()
+function stop_lttng_tracing ()
{
sess_name=$1