sess_name=$1
trace_path=$2
- echo -n "Creating lttng session $SESSION_NAME in $TRACE_PATH "
+ echo -n "Creating lttng session $sess_name in $trace_path"
$TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -o $trace_path >/dev/null 2>&1
if [ $? -eq 1 ]; then
echo -e "\e[1;31mFAILED\e[0m"
return 1
else
echo -e "\e[1;32mOK\e[0m"
- #echo $out | grep "written in" | cut -d' ' -f6
+ fi
+}
+
+function enable_lttng_channel()
+{
+ sess_name=$1
+ channel_name=$2
+
+ echo -n "Enabling lttng channel $channel_name for session $sess_name"
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel $channel_name -s $sess_name >/dev/null 2>&1
+ if [ $? -eq 1 ]; then
+ echo -e "\e[1;31mFAILED\e[0m"
+ return 1
+ else
+ echo -e "\e[1;32mOK\e[0m"
+ fi
+}
+
+function disable_lttng_channel()
+{
+ sess_name=$1
+ channel_name=$2
+
+ echo -n "Disabling lttng channel $channel_name for session $sess_name"
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-channel $channel_name -s $sess_name >/dev/null 2>&1
+ if [ $? -eq 1 ]; then
+ echo -e "\e[1;31mFAILED\e[0m"
+ return 1
+ else
+ echo -e "\e[1;32mOK\e[0m"
fi
}