--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<sessions>
+ <session>
+ <name>load-42-trackers</name>
+ <domains>
+ <domain>
+ <type>UST</type>
+ <buffer_type>PER_UID</buffer_type>
+ <channels>
+ <channel>
+ <name>channel0</name>
+ <enabled>true</enabled>
+ <overwrite_mode>DISCARD</overwrite_mode>
+ <subbuffer_size>131072</subbuffer_size>
+ <subbuffer_count>4</subbuffer_count>
+ <switch_timer_interval>0</switch_timer_interval>
+ <read_timer_interval>0</read_timer_interval>
+ <output_type>MMAP</output_type>
+ <tracefile_size>0</tracefile_size>
+ <tracefile_count>0</tracefile_count>
+ <live_timer_interval>0</live_timer_interval>
+ <events>
+ <event>
+ <name>*</name>
+ <enabled>true</enabled>
+ <type>TRACEPOINT</type>
+ <loglevel_type>ALL</loglevel_type>
+ <loglevel>-1</loglevel>
+ </event>
+ </events>
+ <contexts/>
+ </channel>
+ </channels>
+ <trackers>
+ <pid_tracker>
+ <targets>
+ <pid_target>
+ <pid>666</pid>
+ </pid_target>
+ </targets>
+ </pid_tracker>
+ </trackers>
+ </domain>
+ </domains>
+ <started>false</started>
+ <output>
+ <consumer_output>
+ <enabled>true</enabled>
+ <destination>
+ <path>/tmp/lttng/load-42-1</path>
+ </destination>
+ </consumer_output>
+ </output>
+ </session>
+</sessions>
DIR=$(readlink -f $TESTDIR)
-NUM_TESTS=21
+NUM_TESTS=26
source $TESTDIR/utils/utils.sh
print_test_banner "$TEST_DESC"
-function disable_event()
-{
- local sess_name="$1"
- local chan_name="$2"
- local event_name="$3"
-
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event "$event_name" -s $sess_name -c $chan_name -u >/dev/null 2>&1
- ok $? "Disable event $event_name for session $sess_name"
-}
-
function test_basic_load()
{
diag "Test basic load"
# Once loaded, we are suppose to be able to disable certain events/channels
# thus having a confirmation that it's valid
- disable_event $sess chan1 uevent1
- disable_event $sess chan2 uevent2
- disable_event $sess chan3 uevent3*
+ disable_ust_lttng_event $sess uevent1 chan1
+ disable_ust_lttng_event $sess uevent2 chan2
+ disable_ust_lttng_event $sess uevent3* chan3
disable_ust_lttng_channel $sess chan1
disable_ust_lttng_channel $sess chan2
destroy_lttng_session_ok $SESSION_NAME
destroy_lttng_session_ok "$SESSION_NAME-complex"
+ destroy_lttng_session_ok "$SESSION_NAME-trackers"
stop_lttng_relayd_nocheck
}
destroy_lttng_session_ok $SESSION_NAME
}
+function test_trackers()
+{
+ diag "Test trackers loading"
+
+ lttng_load "-i $CURDIR/$SESSION_NAME-trackers.lttng"
+
+ diag "Test pid tracker"
+ local mi_output_file=$(mktemp)
+ if [ $? -ne 0 ]; then
+ break;
+ fi
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN --mi XML list "$SESSION_NAME-trackers" > $mi_output_file
+ mi_result=$($CURDIR/../mi/extract_xml -e $mi_output_file "//command/output/sessions/session/domains/domain/trackers/pid_tracker/targets/pid_target")
+ if [[ $mi_result = "true" ]]; then
+ ok 0 "Pid target is present"
+ else
+ fail "Pid target missing"
+ fi
+
+ # Test to remove the target just to make sure
+ lttng_untrack_ok "-p 666 -u -s $SESSION_NAME-trackers"
+
+ destroy_lttng_session_ok "$SESSION_NAME-trackers"
+}
+
start_lttng_sessiond
TESTS=(
test_complex_load
test_all_load
test_overwrite
+ test_trackers
)
for fct_test in ${TESTS[@]};
DIR=$(readlink -f $TESTDIR)
-NUM_TESTS=37
+NUM_TESTS=41
source $TESTDIR/utils/utils.sh
create_lttng_session_ok $SESSION_NAME $TRACE_PATH
enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
+ lttng_track_ok "-p 666 -u -s $SESSION_NAME"
lttng_save $SESSION_NAME "-o $TRACE_PATH"
enable_ust_lttng_event_ok $SESSION_NAME-2 $EVENT_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME-3 $EVENT_NAME $CHANNEL_NAME
+ lttng_track_ok "-p 666 -u -s $SESSION_NAME-1"
+ lttng_track_ok "-p 666 -u -s $SESSION_NAME-2"
+ lttng_track_ok "-p 666 -u -s $SESSION_NAME-3"
+
lttng_save "" "-a -o $TRACE_PATH"
is_session_saved $TRACE_PATH $SESSION_NAME-1