[LTP] [PATCH v5 5/5] ftrace: Remove obsolete shell test files
Praveen K Pandey
praveen@linux.ibm.com
Mon Jun 8 15:25:26 CEST 2026
Remove the old shell-based ftrace test files and helper scripts
that have been converted to C. This includes:
- ftrace_lib.sh (replaced by ftrace_lib.c/h)
- ftrace_stress/*.sh (18 helper scripts, replaced by ftrace_stress_test.c)
Also update:
- Makefile: Build new C tests, add .gitignore
- runtest/tracing: Update test entries for C versions
- .gitignore: Ignore compiled binaries
The C implementation provides better error handling, uses LTP's
modern test API, and is more maintainable.
Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
---
runtest/tracing | 6 +-
.../kernel/tracing/ftrace_test/.gitignore | 4 +
testcases/kernel/tracing/ftrace_test/Makefile | 19 +-
.../kernel/tracing/ftrace_test/ftrace_lib.sh | 180 ------------------
.../ftrace_stress/ftrace_buffer_size_kb.sh | 45 -----
.../ftrace_stress/ftrace_current_tracer.sh | 32 ----
.../ftrace_stress/ftrace_ftrace_enabled.sh | 38 ----
.../ftrace_function_profile_enabled.sh | 38 ----
.../ftrace_stress/ftrace_set_event.sh | 46 -----
.../ftrace_stress/ftrace_set_ftrace_filter.sh | 119 ------------
.../ftrace_stress/ftrace_set_ftrace_pid.sh | 37 ----
.../ftrace_stress/ftrace_stack_max_size.sh | 27 ---
.../ftrace_stress/ftrace_stack_trace.sh | 35 ----
.../ftrace_test/ftrace_stress/ftrace_trace.sh | 25 ---
.../ftrace_stress/ftrace_trace_clock.sh | 27 ---
.../ftrace_stress/ftrace_trace_options.sh | 58 ------
.../ftrace_stress/ftrace_trace_pipe.sh | 45 -----
.../ftrace_stress/ftrace_trace_stat.sh | 38 ----
.../ftrace_stress/ftrace_tracing_cpumask.sh | 91 ---------
.../ftrace_stress/ftrace_tracing_enabled.sh | 38 ----
.../ftrace_tracing_max_latency.sh | 27 ---
.../ftrace_stress/ftrace_tracing_on.sh | 38 ----
22 files changed, 24 insertions(+), 989 deletions(-)
create mode 100644 testcases/kernel/tracing/ftrace_test/.gitignore
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_lib.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_buffer_size_kb.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_current_tracer.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_ftrace_enabled.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_function_profile_enabled.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_event.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_filter.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_pid.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_max_size.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_trace.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_clock.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_options.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_stat.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_cpumask.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_enabled.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_max_latency.sh
delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_on.sh
diff --git a/runtest/tracing b/runtest/tracing
index 674e2ad97..4204c2dc4 100644
--- a/runtest/tracing
+++ b/runtest/tracing
@@ -1,7 +1,7 @@
#DESCRIPTION:Tracing testing
-ftrace_regression01 ftrace_regression01.sh
-ftrace_regression02 ftrace_regression02.sh
-ftrace-stress-test ftrace_stress_test.sh 90
+ftrace_regression01 ftrace_regression01
+ftrace_regression02 ftrace_regression02
+ftrace-stress-test ftrace_stress_test
dynamic_debug01 dynamic_debug01.sh
fanotify25 fanotify25
pt_full_trace_basic pt_test
diff --git a/testcases/kernel/tracing/ftrace_test/.gitignore b/testcases/kernel/tracing/ftrace_test/.gitignore
new file mode 100644
index 000000000..9e102074c
--- /dev/null
+++ b/testcases/kernel/tracing/ftrace_test/.gitignore
@@ -0,0 +1,4 @@
+ftrace_regression01
+ftrace_regression02
+ftrace_stress_test
+
diff --git a/testcases/kernel/tracing/ftrace_test/Makefile b/testcases/kernel/tracing/ftrace_test/Makefile
index e4a913a56..2528b9f15 100644
--- a/testcases/kernel/tracing/ftrace_test/Makefile
+++ b/testcases/kernel/tracing/ftrace_test/Makefile
@@ -1,7 +1,22 @@
-top_srcdir ?= ../../../..
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2010 FUJITSU LIMITED
+# Copyright (c) 2024 Linux Test Project
+# Copyright (c) IBM, 2026
+# Converted to C by: Praveen K Pandey <praveen@linux.ibm.com>
+
+top_srcdir ?= ../../../..
include $(top_srcdir)/include/mk/testcases.mk
-INSTALL_TARGETS := *.sh ftrace_stress/*
+# Filter out ftrace_lib from standalone build targets
+FILTER_OUT_MAKE_TARGETS := ftrace_lib
+
+# Only ftrace_stress_test needs pthread
+ftrace_stress_test: LDLIBS += -lpthread
include $(top_srcdir)/include/mk/generic_leaf_target.mk
+
+# C test binaries with shared library dependencies
+ftrace_regression01: ftrace_lib.o
+ftrace_regression02: ftrace_lib.o
+ftrace_stress_test: ftrace_lib.o
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_lib.sh b/testcases/kernel/tracing/ftrace_test/ftrace_lib.sh
deleted file mode 100755
index 5f8f8a2c4..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_lib.sh
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/bin/sh
-
-###########################################################################
-## ##
-## Copyright (c) 2010 FUJITSU LIMITED ##
-## ##
-## This program is free software: you can redistribute it and/or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation, either version 3 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program 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 General Public License for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program. If not, see <http://www.gnu.org/licenses/>. ##
-## ##
-## Author: Li Zefan <lizf@cn.fujitsu.com> ##
-## ##
-###########################################################################
-
-. test.sh
-
-ftrace_test_init()
-{
- export TPATH="$PWD"
- export SPATH="$TPATH/ftrace_stress"
-
- if grep -q debugfs /proc/mounts; then
- export DEBUGFS_PATH=/sys/kernel/debug/
- export TRACING_PATH="$DEBUGFS_PATH/tracing"
- debugfs_def_mounted=1
- else
- tst_tmpdir
- export DEBUGFS_PATH="$PWD/debugfs"
- export TRACING_PATH="$PWD/debugfs/tracing"
- mkdir $DEBUGFS_PATH
- mount -t debugfs xxx $DEBUGFS_PATH
- fi
-
- TST_CLEANUP=clean_up
-
- trap clean_up_exit INT
-
- tst_require_root
-
- # Check to see tracing feature is supported or not
- if [ ! -d $TRACING_PATH ]; then
- tst_brkm TCONF "Tracing is not supported. Skip the test..."
- fi
-
- save_old_setting
-}
-
-test_interval=$1
-
-save_old_setting()
-{
- cd $TRACING_PATH
-
- old_trace_options=`cat trace_options`
- old_tracing_on=`cat tracing_on`
- old_buffer_size=`cat buffer_size_kb`
- old_tracing_cpumask=`cat tracing_cpumask`
-
- if [ -e tracing_cpumask ]; then
- old_tracing_cpumask=`cat tracing_cpumask`
- fi
-
- if [ -e tracing_enabled ]; then
- old_tracing_enabled=`cat tracing_enabled`
- fi
-
- if [ -e stack_max_size ]; then
- old_stack_tracer_enabled=`cat /proc/sys/kernel/stack_tracer_enabled`
- fi
-
- if [ -e "/proc/sys/kernel/ftrace_enabled" ]; then
- old_ftrace_enabled=`cat /proc/sys/kernel/ftrace_enabled`
- fi
-
- if [ -e "function_profile_enabled" ]; then
- old_profile_enabled=`cat function_profile_enabled`
- fi
-
- setting_saved=1
-
- cd - > /dev/null
-}
-
-restore_old_setting()
-{
- if [ ! "$setting_saved" = 1 ]; then
- return
- fi
-
- cd $TRACING_PATH
-
- echo nop > current_tracer
- echo 0 > events/enable
- if [ -e tracing_max_latency ]; then
- echo 0 > tracing_max_latency
- fi
-
- if [ -e tracing_cpumask ]; then
- echo $old_tracing_cpumask > tracing_cpumask
- fi
-
- if [ -e trace_clock ]; then
- echo local > trace_clock
- fi
-
- if [ -e "function_pofile_enabled" ]; then
- echo $old_profile_enabled > function_profile_enabled
- fi
-
- if [ -e "/proc/sys/kernel/ftrace_enabled" ]; then
- echo $old_ftrace_enabled > /proc/sys/kernel/ftrace_enabled
- fi
-
- if [ -e stack_max_size ]; then
- echo $old_stack_tracer_enabled > /proc/sys/kernel/stack_tracer_enabled
- echo 0 > stack_max_size
- fi
-
- echo $old_buffer_size > buffer_size_kb
- echo $old_tracing_on > tracing_on
-
- if [ -e tracing_enabled ]; then
- echo $old_tracing_enabled > tracing_enabled
- fi
-
- for option in $old_trace_options; do
- echo $option > trace_options 2> /dev/null
- done
-
- echo > trace
-
- if [ -f set_ftrace_filter ]; then
- echo > set_ftrace_filter
- fi
-
- cd - > /dev/null
-}
-
-clean_up_mount()
-{
- if [ ! "$debugfs_def_mounted" = "1" ]; then
- umount $DEBUGFS_PATH
- rmdir $DEBUGFS_PATH
- fi
-}
-
-clean_up()
-{
- restore_old_setting
- clean_up_mount
-}
-
-clean_up_exit()
-{
- restore_old_setting
- clean_up_mount
- exit 1
-}
-
-test_begin()
-{
- start_time=`date +%s`
-}
-
-test_wait()
-{
- # run the test for $test_interval secs
- tst_sleep ${test_interval}s
-}
-
-ftrace_test_init
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_buffer_size_kb.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_buffer_size_kb.sh
deleted file mode 100755
index 665291406..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_buffer_size_kb.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-LOOP=200
-
-# Use up to 10% of free memory
-free_mem=`cat /proc/meminfo | grep '^MemFree' | awk '{ print $2 }'`
-cpus=`tst_ncpus`
-
-step=$(( $free_mem / 10 / $LOOP / $cpus ))
-
-if [ $step -eq 0 ]; then
- step=1
- LOOP=50
-fi
-
-while true; do
- new_size=1
- i=0
- while [ $i -lt $LOOP ]; do
- echo $new_size > "$TRACING_PATH"/buffer_size_kb
- new_size=$(( $new_size + $step ))
- i=$((i + 1))
- done
-
- i=0
- while [ $i -lt $LOOP ]; do
- new_size=$(( $new_size - $step ))
- echo $new_size > "$TRACING_PATH"/buffer_size_kb
- i=$((i + 1))
- done
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_current_tracer.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_current_tracer.sh
deleted file mode 100755
index 104b57750..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_current_tracer.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-LOOP=200
-
-while true; do
- i=0
- while [ $i -lt $LOOP ]; do
- for tracer in `cat "$TRACING_PATH"/available_tracers`
- do
- if [ "$tracer" = mmiotrace ]; then
- continue
- fi
-
- echo $tracer > "$TRACING_PATH"/current_tracer 2> /dev/null
- done
- i=$((i + 1))
- done
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_ftrace_enabled.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_ftrace_enabled.sh
deleted file mode 100755
index c6f8b48df..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_ftrace_enabled.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-MAX_LOOP=1500
-count=0
-
-while true; do
- count=$(( $count + 1 ))
- i=0
- while [ $i -lt $MAX_LOOP ]; do
- echo 0 > /proc/sys/kernel/ftrace_enabled
- echo 1 > /proc/sys/kernel/ftrace_enabled
- i=$((i + 1))
- done
-
- enable=$(( $count % 3 ))
-
- if [ $enable -eq 0 ]; then
- echo 1 > /proc/sys/kernel/ftrace_enabled
- else
- echo 0 > /proc/sys/kernel/ftrace_enabled
- fi
-
- sleep 1
-done
-
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_function_profile_enabled.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_function_profile_enabled.sh
deleted file mode 100755
index 7687420c7..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_function_profile_enabled.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-MAX_LOOP=1500
-count=0
-
-
-while true; do
- count=$(( $count + 1 ))
- i=0
- while [ $i -lt $MAX_LOOP ]; do
- echo 0 > "$TRACING_PATH"/function_profile_enabled 2> /dev/null
- echo 1 > "$TRACING_PATH"/function_profile_enabled 2> /dev/null
- i=$((i + 1))
- done
-
- enable=$(( $count % 3 ))
-
- if [ $enable -eq 0 ]; then
- echo 1 > "$TRACING_PATH"/function_profile_enabled 2> /dev/null
- else
- echo 0 > "$TRACING_PATH"/function_profile_enabled 2> /dev/null
- fi
-
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_event.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_event.sh
deleted file mode 100755
index 9a79b4201..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_event.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-while true; do
- i=0
- while [ $i -lt 100 ]; do
- echo 1 > "$TRACING_PATH"/events/enable
- echo 0 > "$TRACING_PATH"/events/enable
- i=$((i + 1))
- done
-
- for dir in `ls $TRACING_PATH/events/`; do
- if [ ! -d $dir -o "$dir" = ftrace ]; then
- continue;
- fi
-
- i=0
- while [ $i -lt 20 ]; do
- echo 1 > "$TRACING_PATH"/events/$dir/enable
- echo 0 > "$TRACING_PATH"/events/$dir/enable
- i=$((i + 1))
- done
- done
-
- for event in `cat $TRACING_PATH/available_events`; do
- # ftrace event sys is special, skip it
- if echo "$event" | grep "ftrace:*"; then
- continue
- fi
- echo $event >> "$TRACING_PATH"/set_event
- done
-
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_filter.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_filter.sh
deleted file mode 100755
index af6ec9f05..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_filter.sh
+++ /dev/null
@@ -1,119 +0,0 @@
-#! /bin/sh
-###########################################################################
-## ##
-## Copyright (c) 2015, Red Hat Inc. ##
-## ##
-## This program is free software: you can redistribute it and/or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation, either version 3 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program 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 General Public License for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program. If not, see <http://www.gnu.org/licenses/>. ##
-## ##
-## Author: Chunyu Hu <chuhu@redhat.com> ##
-## ##
-###########################################################################
-
-. test.sh
-
-triggers="traceon traceoff enable_event disable_event snapshot \
- dump cpudump stacktrace module function"
-nr_triggers=$(echo ${triggers} | wc -w)
-
-module_pick()
-{
- nr_module=$(lsmod | wc -l)
- pick_one=$(tst_random 1 $nr_module)
- picked_module=$(lsmod | awk "{if (NR == $pick_one) {print \$1}}")
-}
-
-filter_file=$TRACING_PATH/available_filter_functions
-nr_functions=$(awk 'END{print NR}' $filter_file)
-
-function_pick()
-{
- if [ -f $filter_file ]; then
- local pick_one=$(tst_random 1 $nr_functions)
- picked_function=$(awk "{if (NR == $pick_one) {print \$1}}" $filter_file)
- echo $picked_function
- else
- echo "\*sched\*"
- fi
-}
-
-event_pick()
-{
- local events_file=$TRACING_PATH/available_events
- if [ -f $events_file ]; then
- nr_events=$(awk 'END{print NR}' $events_file)
- local pick_one=$(tst_random 1 $nr_events)
- picked_event=$(awk "{if (NR == $pick_one) {print \$0}}" $events_file)
- echo "$picked_event"
- else
- echo "sched:sched_switch"
- fi
-}
-
-filter_formatter()
-{
- function_str=$(function_pick)
- count=$(tst_random 0 2)
-
- case $1 in
- traceon|traceoff|snapshot|dump|cpudump|stacktrace)
- trigger=$1
- ;;
- enable_event|disable_event)
- event_sys_name=$(event_pick)
- trigger=$1:$event_sys_name
- ;;
- module)
- module_pick
- echo ":mod:$picked_module"
- return
- ;;
- function)
- echo "$function_str"
- return
- ;;
- *)
- trigger=$1
- ;;
- esac
-
- if [ $count -gt 0 ]; then
- trigger=$trigger:$count
- fi
- echo $function_str:$trigger
-}
-
-signal_handler()
-{
- tst_exit
-}
-
-trap signal_handler SIGTERM
-
-while true; do
- # Here try to check if a race caused issue can be hit.
- cat $TRACING_PATH/set_ftrace_filter > /dev/null
-
- trigger_index=$(tst_random 1 $nr_triggers)
- trigger_name=$(echo $triggers | awk "{print \$$trigger_index}")
- filter_format=$(filter_formatter $trigger_name)
-
- echo "$filter_format" > $TRACING_PATH/set_ftrace_filter
- [ $? -ne 0 ] && tst_resm TFAIL "$0: setup filter <$filter_format> failed"
-
- sleep 2
-
- echo "!$filter_format" > $TRACING_PATH/set_ftrace_filter
- [ $? -ne 0 ] && tst_resm TFAIL "$0: remove filter <$filter_format> failed"
-done
-
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_pid.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_pid.sh
deleted file mode 100755
index fd42de4f3..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_pid.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-LOOP=300
-
-while true; do
- j=0
- while [ $j -lt $LOOP ]; do
- k=1
- while [ $k -le $NR_PIDS ]; do
- str="\$pid$k"
- eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
- k=$((k + 1))
- done
-
- if ! echo > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1; then
- if ! echo -1 > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1; then
- tst_resm TBROK "Cannot disable set_ftrace_pid!"
- exit 1
- fi
- fi
- j=$((j + 1))
- done
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_max_size.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_max_size.sh
deleted file mode 100755
index 0842929aa..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_max_size.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-MAX_STACK_SIZE=8192
-
-while true; do
- i=0
- while [ $i -lt $MAX_STACK_SIZE ]; do
- echo $i > "$TRACING_PATH"/stack_max_size
- cat "$TRACING_PATH"/stack_max_size > /dev/null
- i=$((i + 1))
- done
- sleep 1
-done
-
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_trace.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_trace.sh
deleted file mode 100755
index 4c16a0a1d..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_trace.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-LOOP=400
-
-while true; do
- i=0
- while [ $i -lt $LOOP ]; do
- cat "$TRACING_PATH"/stack_trace > /dev/null
- i=$((i + 1))
- done
-
- sleep 1
-
- i=0
- while [ $i -lt $LOOP ]; do
- echo 0 > /proc/sys/kernel/stack_tracer_enabled
- echo 1 > /proc/sys/kernel/stack_tracer_enabled
- i=$((i + 1))
- done
-
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace.sh
deleted file mode 100755
index 7c45f504a..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-LOOP=200
-
-i=0;
-while true; do
- while [ $i -lt $LOOP ]; do
- cat "$TRACING_PATH"/trace > /dev/null
- i=$((i + 1))
- done
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_clock.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_clock.sh
deleted file mode 100755
index 50329c684..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_clock.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-LOOP=400
-
-while true; do
- i=0
- while [ $i -lt $LOOP ]; do
- echo local > "$TRACING_PATH"/trace_clock
- echo global > "$TRACING_PATH"/trace_clock
- i=$((i + 1))
- done
- sleep 1
-done
-
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_options.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_options.sh
deleted file mode 100755
index 95da3f6c7..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_options.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-. test.sh
-
-LOOP=200
-
-while true; do
- j=0
- while [ $j -lt $LOOP ]; do
- trace_options="$(ls $TRACING_PATH/options/)"
- # enable the nop_test_refuse can cause an
- # 'write error: Invalid argument'. So don't test it.
- trace_options="$(echo $trace_options | sed 's/test_nop_refuse//')"
- nr_trace_options=$(echo "${trace_options}" | wc -w)
-
- option_index=$(tst_random 1 $nr_trace_options)
- option=$(echo "$trace_options" | awk "{print \$$option_index}")
- i=0
- while [ $i -lt $nr_trace_options ]; do
- n=$(tst_random 0 1)
- opt_f="$TRACING_PATH"/options/$option
- ret_val=0
- if [ $n -eq 0 ]; then
- operation="setup"
- else
- operation="clear"
- fi
- # On old kernel, some trace option dirs
- # won't be made if the option has nothing
- # to do with the current tracer. But on newer
- # kernel(4.4-rc1), all option dirs will be made.
- # So here check it to avoid 'Permision denied'
- if [ -f $opt_f ]; then
- echo $n > $opt_f
- ret_val=$?
- fi
-
- if [ $ret_val -ne 0 ]; then
- tst_resm TFAIL "$0: $operation trace option $option failed"
- fi
- i=$((i + 1))
- done
- j=$((j + 1))
- done
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh
deleted file mode 100755
index 7d49745ba..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-kill_this_pid()
-{
- kill -KILL $this_pid
- wait $this_pid
- exit 0
-}
-
-trap kill_this_pid SIGUSR1
-
-LOOP=20
-
-while true; do
- i=0
- while [ $i -lt $LOOP ]; do
- cat "$TRACING_PATH"/trace_pipe > /dev/null &
- this_pid=$!
-
- tst_sleep 200000us
-
- kill -INT $this_pid
- wait $this_pid
-
- this_pid=0
-
- tst_sleep 200000us
-
- i=$((i + 1))
- done
- sleep 2
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_stat.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_stat.sh
deleted file mode 100755
index f7177c988..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_stat.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-LOOP=200
-
-should_skip=0
-nr_cpus=`tst_ncpus`
-
-if [ ! -e "$TRACING_PATH"/function_profile_enabled ]; then
- should_skip=1
-fi
-
-while true; do
- if [ $should_skip -eq 1 ]; then
- sleep 2
- continue
- fi
- cpu=$(tst_random 0 $((nr_cpus - 1)))
- i=0;
- while [ $i -lt $LOOP ]; do
- cat "$TRACING_PATH"/trace_stat/function${cpu} > /dev/null 2>&1
- i=$((i + 1))
- done
-
- sleep 1
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_cpumask.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_cpumask.sh
deleted file mode 100755
index aeb0d92f8..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_cpumask.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#! /bin/sh
-
-###########################################################################
-## ##
-## Copyright (c) 2015, Red Hat Inc. ##
-## ##
-## This program is free software: you can redistribute it and/or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation, either version 3 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program 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 General Public License for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program. If not, see <http://www.gnu.org/licenses/>. ##
-## ##
-## Author: Chunyu Hu <chuhu@redhat.com> ##
-## ##
-###########################################################################
-
-. test.sh
-nr_cpus=`tst_ncpus`
-
-# the 32 bit integer count 32 cpus. One integer is not
-# enough to store the cpu mask for nr_cpu > 32.
-if [ $nr_cpus -gt 32 ]; then
- group_cnt=$((nr_cpus / 32))
- range=31
- rem=$((nr_cpus % 32))
- if [ $rem -ne 0 ]; then
- range_last=$((rem -1))
- fi
-else
- group_cnt=1
- range=$((nr_cpus - 1))
-fi
-
-get_test_cpumask()
-{
- mask=""
-
- local i=0
- while [ $i -lt $group_cnt ]; do
- # select count of cpu in one group, include the duplicate.
- local set_cnt=$(tst_random 1 $((range + 1)))
-
- local c=0
- local temp_mask=0
- while [ $c -lt $set_cnt ]; do
- local group_cpuid=$(tst_random 1 $range)
- temp_mask=$((temp_mask | $((1 << $group_cpuid))))
- c=$((c + 1))
- done
-
- if [ $i = 0 ]; then
- mask=`echo $temp_mask | awk '{printf "%x",$0}'`
- else
- mask=$mask","`echo $temp_mask | awk '{printf "%x",$0}'`
- fi
-
- i=$((i + 1))
- done
-
- if [ $group_cnt -gt 1 ]; then
- set_cnt=$(tst_random 1 $((range_last +1)))
- c=0;
- temp_mask=0
- while [ $c -lt $set_cnt ]; do
- local group_cpuid=$(tst_random 1 $range_last)
- temp_mask=$((temp_mask | $((1 << $group_cpuid))))
- c=$((c + 1))
- done
- mask=`echo $temp_mask | awk '{printf "%x",$0}'`
- fi
-
- echo "$mask"
-}
-
-signal_handler()
-{
- tst_exit
-}
-
-trap signal_handler SIGTERM SIGKILL
-
-while true; do
- get_test_cpumask > $TRACING_PATH/tracing_cpumask
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_enabled.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_enabled.sh
deleted file mode 100755
index 9e0f5a7cf..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_enabled.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-MAX_LOOP=1500
-count=0
-
-while true; do
- count=$(( $count + 1 ))
- i=0
- while [ $i -lt $MAX_LOOP ]; do
- echo 0 > "$TRACING_PATH"/tracing_enabled
- echo 1 > "$TRACING_PATH"/tracing_enabled
- i=$((i + 1))
- done
-
- enable=$(( $count % 3 ))
-
- if [ $enable -eq 0 ]; then
- echo 0 > "$TRACING_PATH"/tracing_enabled
- else
- echo 1 > "$TRACING_PATH"/tracing_enabled
- fi
-
- sleep 1
-done
-
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_max_latency.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_max_latency.sh
deleted file mode 100755
index 4ad88910c..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_max_latency.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-MAX_LATENCY=100000
-
-while true; do
- i=0
- while [ $i -lt $MAX_LATENCY ]; do
- echo $i > "$TRACING_PATH"/tracing_max_latency
- i=$((i + 400))
- done
-
- sleep 1
-
-done
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_on.sh b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_on.sh
deleted file mode 100755
index 5ae9d762c..000000000
--- a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_on.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-
-###############################################################################
-# #
-# Copyright (c) 2010 FUJITSU LIMITED #
-# #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; either version 2 of the License, or (at your option) #
-# any later version. #
-# #
-# Author: Li Zefan <lizf@cn.fujitsu.com> #
-# #
-###############################################################################
-
-MAX_LOOP=1500
-count=0
-
-while true; do
- count=$(( $count + 1 ))
- i=0
- while [ $i -lt $MAX_LOOP ]; do
- echo 0 > "$TRACING_PATH"/tracing_on
- echo 1 > "$TRACING_PATH"/tracing_on
- i=$((i + 1))
- done
-
- enable=$(( $count % 3 ))
-
- if [ $enable -eq 0 ]; then
- echo 0 > "$TRACING_PATH"/tracing_on
- else
- echo 1 > "$TRACING_PATH"/tracing_on
- fi
-
- sleep 1
-done
-
--
2.50.1
More information about the ltp
mailing list