Skip to contentSkip to conversation

ftrace_stress_test.sh: remove the tracing_enabled file tests

PATCH New Chuyu Hu 3 participants 4 messages Dec 22, 2015 – Dec 23, 2015

lore
Share & tools
lore

Chuyu Hu

author
#0 lore raw

PATCH 1/1 ftrace_stress_test.sh: remove the tracing_enabled file tests

When running the tests on RHEL7, got message as below:
---------
/mnt/testarea/ltp/testcases/bin/ftrace_stress/ftrace_tracing_enabled.sh: line 25: /mnt/testarea/ltp/testcases/bin/debugfs/tracing/tracing_enabled: Permission denied /mnt/testarea/ltp/testcases/bin/ftrace_stress/ftrace_tracing_enabled.sh: line 26: /mnt/testarea/ltp/testcases/bin/debugfs/tracing/tracing_enabled: Permission denied
---------

The reason is that the tracing_enabled file has been removed since kernel v3.8 by commits:

02404ba tracing: Remove deprecated tracing_enabled file 0fb9656 tracing: Make tracing_enabled be equal to tracing_on 6752ab4 tracing: Deprecate tracing_enabled for tracing_on

---
 .../ftrace_stress/ftrace_tracing_enabled.sh        | 39 ----------------------
 .../ftrace_stress_test/ftrace_stress_test.sh       | 20 +++++------
 2 files changed, 8 insertions(+), 51 deletions(-)
 delete mode 100755 testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -39
deleted file mode 100755
index 69f2ae6..0000000
@@ -1,39 +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 <[email protected]>                                      #
-#                                                                             #
-###############################################################################
-
-MAX_LOOP=1500
-count=0
-
-for ((; ;))
-{
-	count=$(( $count + 1 ))
-
-	for ((i = 0; i < $MAX_LOOP; i++))
-	{
-		echo 0 > "$TRACING_PATH"/tracing_enabled
-		echo 1 > "$TRACING_PATH"/tracing_enabled
-	}
-
-	enable=$(( $count % 3 ))
-
-	if [ $enable -eq 0 ]; then
-		echo 0 > "$TRACING_PATH"/tracing_enabled
-	else
-		echo 1 > "$TRACING_PATH"/tracing_enabled
-	fi
-
-	sleep 1
-}
-
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress_test.sh +8 -12
index 6a111e9..24bb3ab 100755
@@ -42,7 +42,6 @@ save_old_setting()
 
 	old_trace_options=( `cat trace_options` )
 	old_tracing_on=`cat tracing_on`
-	old_tracing_enabled=`cat tracing_enabled`
 	old_buffer_size=`cat buffer_size_kb`
 
 	if [ -e stack_max_size ]; then
@@ -87,7 +86,6 @@ restore_old_setting()
 
 	echo $old_buffer_size > buffer_size_kb
 	echo $old_tracing_on > tracing_on
-	echo $old_tracing_enabled > tracing_enabled
 
 	for option in $old_trace_options
 	do
@@ -207,24 +205,22 @@ $SPATH/ftrace_stack_max_size.sh &
 pid6=$!
 $SPATH/ftrace_tracing_on.sh &
 pid7=$!
-$SPATH/ftrace_tracing_enabled.sh &
-pid8=$!
 $SPATH/ftrace_set_event.sh &
-pid9=$!
+pid8=$!
 $SPATH/ftrace_buffer_size.sh &
-pid10=$!
+pid9=$!
 $SPATH/ftrace_trace.sh &
-pid11=$!
+pid10=$!
 $SPATH/ftrace_trace_pipe.sh &
-pid12=$!
+pid11=$!
 $SPATH/ftrace_ftrace_enabled.sh &
-pid13=$!
+pid12=$!
 $SPATH/ftrace_set_ftrace_pid.sh &
-pid14=$!
+pid13=$!
 $SPATH/ftrace_profile_enabled.sh &
-pid15=$!
+pid14=$!
 $SPATH/ftrace_trace_stat.sh &
-pid16=$!
+pid15=$!
 
 export_pids
 
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 ftrace_stress_test.sh: remove the tracing_enabled file tests

Quoted 42 lines · Chuyu Hu

When running the tests on RHEL7, got message as below:
---------
/mnt/testarea/ltp/testcases/bin/ftrace_stress/ftrace_tracing_enabled.sh: line 25: /mnt/testarea/ltp/testcases/bin/debugfs/tracing/tracing_enabled: Permission denied /mnt/testarea/ltp/testcases/bin/ftrace_stress/ftrace_tracing_enabled.sh: line 26: /mnt/testarea/ltp/testcases/bin/debugfs/tracing/tracing_enabled: Permission denied
---------

The reason is that the tracing_enabled file has been removed since kernel v3.8 by commits:

02404ba tracing: Remove deprecated tracing_enabled file 0fb9656 tracing: Make tracing_enabled be equal to tracing_on 6752ab4 tracing: Deprecate tracing_enabled for tracing_on

---
 .../ftrace_stress/ftrace_tracing_enabled.sh        | 39 ----------------------
 .../ftrace_stress_test/ftrace_stress_test.sh       | 20 +++++------
 2 files changed, 8 insertions(+), 51 deletions(-)
 delete mode 100755 testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -16
deleted file mode 100755
index 69f2ae6..0000000
@@ -1,39 +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 <[email protected]>                                      #
-#                                                                             #
-###############################################################################
-
-MAX_LOOP=1500

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh line 26

Quoted 10 lines
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -10
-count=0
-
-for ((; ;))
-{
-	count=$(( $count + 1 ))
-
-	for ((i = 0; i < $MAX_LOOP; i++))
-	{
-		echo 0 > "$TRACING_PATH"/tracing_enabled
-		echo 1 > "$TRACING_PATH"/tracing_enabled

Maybe we should keep this file but switch it to "tracing_on"?

-- Steve

Quoted 66 lines
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -13
-	}
-
-	enable=$(( $count % 3 ))
-
-	if [ $enable -eq 0 ]; then
-		echo 0 > "$TRACING_PATH"/tracing_enabled
-	else
-		echo 1 > "$TRACING_PATH"/tracing_enabled
-	fi
-
-	sleep 1
-}
-
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress_test.sh +8 -12
index 6a111e9..24bb3ab 100755
@@ -42,7 +42,6 @@ save_old_setting()
 
 	old_trace_options=( `cat trace_options` )
 	old_tracing_on=`cat tracing_on`
-	old_tracing_enabled=`cat tracing_enabled`
 	old_buffer_size=`cat buffer_size_kb`
 
 	if [ -e stack_max_size ]; then
@@ -87,7 +86,6 @@ restore_old_setting()
 
 	echo $old_buffer_size > buffer_size_kb
 	echo $old_tracing_on > tracing_on
-	echo $old_tracing_enabled > tracing_enabled
 
 	for option in $old_trace_options
 	do
@@ -207,24 +205,22 @@ $SPATH/ftrace_stack_max_size.sh &
 pid6=$!
 $SPATH/ftrace_tracing_on.sh &
 pid7=$!
-$SPATH/ftrace_tracing_enabled.sh &
-pid8=$!
 $SPATH/ftrace_set_event.sh &
-pid9=$!
+pid8=$!
 $SPATH/ftrace_buffer_size.sh &
-pid10=$!
+pid9=$!
 $SPATH/ftrace_trace.sh &
-pid11=$!
+pid10=$!
 $SPATH/ftrace_trace_pipe.sh &
-pid12=$!
+pid11=$!
 $SPATH/ftrace_ftrace_enabled.sh &
-pid13=$!
+pid12=$!
 $SPATH/ftrace_set_ftrace_pid.sh &
-pid14=$!
+pid13=$!
 $SPATH/ftrace_profile_enabled.sh &
-pid15=$!
+pid14=$!
 $SPATH/ftrace_trace_stat.sh &
-pid16=$!
+pid15=$!
 
 export_pids
 
author
#2 lore raw

PATCH 1/1 ftrace_stress_test.sh: remove the tracing_enabled file tests

Quoted 82 lines

From: "Steven Rostedt" <[email protected]>
To: "Chuyu Hu" <[email protected]>
Cc: [email protected], [email protected], [email protected]
Sent: Tuesday, December 22, 2015 10:41:46 PM
Subject: Re: [PATCH] ftrace_stress_test.sh: remove the tracing_enabled file tests

Quoted 61 lines · Chuyu Hu

When running the tests on RHEL7, got message as below:
---------
/mnt/testarea/ltp/testcases/bin/ftrace_stress/ftrace_tracing_enabled.sh:
line 25: /mnt/testarea/ltp/testcases/bin/debugfs/tracing/tracing_enabled:
Permission denied /mnt/testarea/ltp/testcases/bin/ftrace_stress/ftrace_tracing_enabled.sh:
line 26: /mnt/testarea/ltp/testcases/bin/debugfs/tracing/tracing_enabled:
Permission denied
---------

The reason is that the tracing_enabled file has been removed since kernel v3.8 by commits:

02404ba tracing: Remove deprecated tracing_enabled file 0fb9656 tracing: Make tracing_enabled be equal to tracing_on 6752ab4 tracing: Deprecate tracing_enabled for tracing_on

---
 .../ftrace_stress/ftrace_tracing_enabled.sh        | 39
 ----------------------
 .../ftrace_stress_test/ftrace_stress_test.sh       | 20 +++++------
 2 files changed, 8 insertions(+), 51 deletions(-)
 delete mode 100755

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh

diff --git a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted file mode 100755
index 69f2ae6..0000000
---
a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh +++ /dev/null

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -4
@@ -1,39 +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 <[email protected]>
#
-#
#

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -3
-###############################################################################
-
-MAX_LOOP=1500

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh line 26

Quoted 10 lines
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -10
-count=0
-
-for ((; ;))
-{
-	count=$(( $count + 1 ))
-
-	for ((i = 0; i < $MAX_LOOP; i++))
-	{
-		echo 0 > "$TRACING_PATH"/tracing_enabled
-		echo 1 > "$TRACING_PATH"/tracing_enabled

Maybe we should keep this file but switch it to "tracing_on"?

Quoted 1 line

-- Steve

Thanks for kind review the patch. As the case was created in 2010 when the two files exit together.There is another case for testing tracing_on : ftrace_tracing_on.sh.

I think we need some checker to check whether tracing_on, tracing_enabled or other trace files are there, And then decide which sub stress scripts to run. And for some new trace file without test code,I'm also considering add some new stress script for them.

---
Regards,
Chunyu Hu

Quoted 71 lines
Quoted 68 lines
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -13
-	}
-
-	enable=$(( $count % 3 ))
-
-	if [ $enable -eq 0 ]; then
-		echo 0 > "$TRACING_PATH"/tracing_enabled
-	else
-		echo 1 > "$TRACING_PATH"/tracing_enabled
-	fi
-
-	sleep 1
-}
-

diff --git a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress_test.sh b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress_test.sh index 6a111e9..24bb3ab 100755

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress_test.sh +8 -12
@@ -42,7 +42,6 @@ save_old_setting()
 
 	old_trace_options=( `cat trace_options` )
 	old_tracing_on=`cat tracing_on`
-	old_tracing_enabled=`cat tracing_enabled`
 	old_buffer_size=`cat buffer_size_kb`
 
 	if [ -e stack_max_size ]; then
@@ -87,7 +86,6 @@ restore_old_setting()
 
 	echo $old_buffer_size > buffer_size_kb
 	echo $old_tracing_on > tracing_on
-	echo $old_tracing_enabled > tracing_enabled
 
 	for option in $old_trace_options
 	do
@@ -207,24 +205,22 @@ $SPATH/ftrace_stack_max_size.sh &
 pid6=$!
 $SPATH/ftrace_tracing_on.sh &
 pid7=$!
-$SPATH/ftrace_tracing_enabled.sh &
-pid8=$!
 $SPATH/ftrace_set_event.sh &
-pid9=$!
+pid8=$!
 $SPATH/ftrace_buffer_size.sh &
-pid10=$!
+pid9=$!
 $SPATH/ftrace_trace.sh &
-pid11=$!
+pid10=$!
 $SPATH/ftrace_trace_pipe.sh &
-pid12=$!
+pid11=$!
 $SPATH/ftrace_ftrace_enabled.sh &
-pid13=$!
+pid12=$!
 $SPATH/ftrace_set_ftrace_pid.sh &
-pid14=$!
+pid13=$!
 $SPATH/ftrace_profile_enabled.sh &
-pid15=$!
+pid14=$!
 $SPATH/ftrace_trace_stat.sh &
-pid16=$!
+pid15=$!
 
 export_pids
 
#3 lore raw

PATCH 1/1 ftrace_stress_test.sh: remove the tracing_enabled file tests

Hi,

Quoted 10 lines
Quoted 9 lines

-

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh line 26

Quoted 4 lines
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_tracing_enabled.sh deleted +0 -4
-   for ((i = 0; i < $MAX_LOOP; i++))
-   {
-           echo 0 > "$TRACING_PATH"/tracing_enabled
-           echo 1 > "$TRACING_PATH"/tracing_enabled

Maybe we should keep this file but switch it to "tracing_on"?

-- Steve

Quoted 9 lines

Thanks for kind review the patch. As the case was created in 2010 when the two files exit together.There is another case for testing tracing_on :
ftrace_tracing_on.sh.

I think we need some checker to check whether tracing_on, tracing_enabled or other trace files are there, And then decide which sub stress scripts to run. And for some new trace file without test code,I'm also considering add some new stress script for them.

Sounds good, feel free to format patch adding them.

To make the progress extendable, we could also take consider that reorganize the stress test to ftrace general test, then adding some function or regression testcases.

something like:
---------
tracing
- ftrace_test
- ftrace_lib.sh
- ftrace_function_test.sh
- ftrace_stress_test.sh
- ftrace_regression_test.sh
- frace testcase directory...
- Makefile

Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20151223/a54187dc/attachment.html>