#!/bin/bash
#
-# Copyright (C) - 2013 Julien Desfossez <jdesfossez@efficios.com>
+# Copyright (C) 2013 Julien Desfossez <jdesfossez@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
+# SPDX-License-Identifier: LGPL-2.1-only
+
TEST_DESC="Snapshots - Kernel tracing"
CURDIR=$(dirname $0)/
TESTDIR=$CURDIR/../../..
EVENT_NAME="sched_switch"
-PID_RELAYD=0
SESSION_NAME=""
CHANNEL_NAME="snapchan"
source $TESTDIR/utils/utils.sh
-# LTTng kernel modules check
-out=`ls /lib/modules/$(uname -r)/extra | grep lttng`
-if [ -z "$out" ]; then
- BAIL_OUT "LTTng modules not detected."
-fi
-
function test_kernel_local_snapshot ()
{
diag "Test local kernel snapshots"
enable_lttng_mmap_overwrite_kernel_channel $SESSION_NAME $CHANNEL_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
lttng_snapshot_record $SESSION_NAME
stop_lttng_tracing_ok $SESSION_NAME
destroy_lttng_session_ok $SESSION_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
stop_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
lttng_snapshot_record $SESSION_NAME
destroy_lttng_session_ok $SESSION_NAME
enable_lttng_mmap_overwrite_kernel_channel $SESSION_NAME $CHANNEL_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT1 $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
# first snapshot with only 1 event
lttng_snapshot_record $SESSION_NAME
$CHANNEL_NAME
lttng_enable_kernel_syscall_ok $SESSION_NAME -a $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
true_loop_cpu0 10000
$CHANNEL_NAME
lttng_enable_kernel_syscall_ok $SESSION_NAME -a $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
true_loop_cpu0 10000
enable_lttng_mmap_overwrite_kernel_channel $SESSION_NAME $CHANNEL_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
for i in $(seq 1 $NB_SNAP); do
diag "Snapshot $i/$NB_SNAP"
rm -rf $TRACE_PATH/snapshot/* 2>/dev/null
skip $isroot "Root access is needed. Skipping all kernel snapshot tests." $NUM_TESTS ||
{
+
+ validate_lttng_modules_present
+
start_lttng_sessiond
#tests=( test_kernel_1000_local_snapshots )