mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
Exercise the tracefs interface for trace remote with a set of tests to check: * loading/unloading (unloading.tc) * reset (reset.tc) * size changes (buffer_size.tc) * consuming read (trace_pipe.tc) * non-consuming read (trace.tc) Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: linux-kselftest@vger.kernel.org Link: https://patch.msgid.link/20260309162516.2623589-16-vdonnefort@google.com Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Vincent Donnefort <vdonnefort@google.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
42 lines
683 B
Bash
42 lines
683 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Test trace remote unloading
|
|
# requires: remotes/test
|
|
|
|
. $TEST_DIR/remotes/functions
|
|
|
|
test_unloading()
|
|
{
|
|
# No reader, writing
|
|
assert_loaded
|
|
|
|
# No reader, no writing
|
|
echo 0 > tracing_on
|
|
assert_unloaded
|
|
|
|
# 1 reader, no writing
|
|
cat trace_pipe &
|
|
pid=$!
|
|
sleep 1
|
|
assert_loaded
|
|
kill $pid
|
|
assert_unloaded
|
|
|
|
# No reader, no writing, events
|
|
echo 1 > tracing_on
|
|
echo 1 > write_event
|
|
echo 0 > tracing_on
|
|
assert_loaded
|
|
|
|
# Test reset
|
|
clear_trace
|
|
assert_unloaded
|
|
}
|
|
|
|
if [ -z "$SOURCE_REMOTE_TEST" ]; then
|
|
set -e
|
|
|
|
setup_remote_test
|
|
test_unloading
|
|
fi
|