All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] try two methods to disable set_ftrace_pid
@ 2011-02-22  6:55 Han Pingtian
  2011-02-22  6:57 ` Garrett Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Han Pingtian @ 2011-02-22  6:55 UTC (permalink / raw)
  To: ltp-list, Li Zefan

On older kernel, we should use "echo -1 > ..." to disable
set_ftrace_pid, but on the latest kernel we must use
"echo > ..." to disable it. So we have to try both methods
for disabling it in ftrace stress test.

Signed-off-by: Han Pingtian <phan@redhat.com>
---
 .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
index 541215c..2ab6cf2 100755
--- a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
+++ b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
@@ -36,7 +36,13 @@ for ((; ; ))
 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
 		}
 
-		echo > "$TRACING_PATH"/set_ftrace_pid
+		if ! echo > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1; then
+			echo -1 > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1 
+
+			if [ $? -ne 0 ]; then
+				tst_resm TBROK "Cannot disable set_ftrace_pid!"
+			fi
+		fi
 	}
 
 	sleep 1
-- 
1.7.1

------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [LTP] [PATCH] try two methods to disable set_ftrace_pid
  2011-02-22  6:55 [LTP] [PATCH] try two methods to disable set_ftrace_pid Han Pingtian
@ 2011-02-22  6:57 ` Garrett Cooper
  2011-02-22  7:47   ` Han Pingtian
  0 siblings, 1 reply; 5+ messages in thread
From: Garrett Cooper @ 2011-02-22  6:57 UTC (permalink / raw)
  To: Han Pingtian; +Cc: ltp-list

On Feb 21, 2011, at 10:55 PM, Han Pingtian wrote:

> On older kernel, we should use "echo -1 > ..." to disable
> set_ftrace_pid, but on the latest kernel we must use
> "echo > ..." to disable it. So we have to try both methods
> for disabling it in ftrace stress test.
> 
> Signed-off-by: Han Pingtian <phan@redhat.com>
> ---
> .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
> index 541215c..2ab6cf2 100755
> --- a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
> +++ b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
> @@ -36,7 +36,13 @@ for ((; ; ))
> 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
> 		}
> 
> -		echo > "$TRACING_PATH"/set_ftrace_pid
> +		if ! echo > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1; then
> +			echo -1 > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1 
> +
> +			if [ $? -ne 0 ]; then
> +				tst_resm TBROK "Cannot disable set_ftrace_pid!"

	Unlike the C APIs, this will never exit. Yes, I realize this is dumb.
Thanks,
-Garrett
------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [PATCH] try two methods to disable set_ftrace_pid
  2011-02-22  6:57 ` Garrett Cooper
@ 2011-02-22  7:47   ` Han Pingtian
  2011-02-23  8:37     ` Garrett Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Han Pingtian @ 2011-02-22  7:47 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

[-- Attachment #1: Type: text/plain, Size: 1595 bytes --]

On Mon, Feb 21, 2011 at 10:57:34PM -0800, Garrett Cooper wrote:
> On Feb 21, 2011, at 10:55 PM, Han Pingtian wrote:
> 
> > On older kernel, we should use "echo -1 > ..." to disable
> > set_ftrace_pid, but on the latest kernel we must use
> > "echo > ..." to disable it. So we have to try both methods
> > for disabling it in ftrace stress test.
> > 
> > Signed-off-by: Han Pingtian <phan@redhat.com>
> > ---
> > .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    8 +++++++-
> > 1 files changed, 7 insertions(+), 1 deletions(-)
> > 
> > diff --git a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
> > index 541215c..2ab6cf2 100755
> > --- a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
> > +++ b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
> > @@ -36,7 +36,13 @@ for ((; ; ))
> > 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
> > 		}
> > 
> > -		echo > "$TRACING_PATH"/set_ftrace_pid
> > +		if ! echo > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1; then
> > +			echo -1 > "$TRACING_PATH"/set_ftrace_pid >/dev/null 2>&1 
> > +
> > +			if [ $? -ne 0 ]; then
> > +				tst_resm TBROK "Cannot disable set_ftrace_pid!"
> 
> 	Unlike the C APIs, this will never exit. Yes, I realize this is dumb.
> Thanks,
> -Garrett
I have updated the patch, please have a review. Thanks.

-- 
Han Pingtian
Quality Engineer
hpt @ #kernel-qe
Red Hat, Inc
Freedom ... courage ... Commitment ... ACCOUNTABILITY

[-- Attachment #2: 0001-try-two-methods-to-disable-set_ftrace_pid.patch --]
[-- Type: text/plain, Size: 3392 bytes --]

From 7db898dbc4b57e20bca4fc5d2f736eef81b21c85 Mon Sep 17 00:00:00 2001
From: Han Pingtian <phan@redhat.com>
Date: Tue, 22 Feb 2011 14:22:52 +0800
Subject: [PATCH] try two methods to disable set_ftrace_pid

On older kernel, we should use "echo -1 > ..." to disable set_ftrace_pid,
but on the latest kernel we must use "echo > ..." to disable it. So we
have to try both methods for disabling it in ftrace stress test.

And if we failed to disable the set_ftrace_pid, will try to report test
failure to the user.

Signed-off-by: Han Pingtian <phan@redhat.com>
---
 .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    7 +++-
 .../ftrace_stress_test/ftrace_stress_test.sh       |   40 +++++++++++--------
 2 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
index 541215c..7bc76d9 100755
--- a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
+++ b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh
@@ -36,7 +36,12 @@ for ((; ; ))
 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
 		}
 
-		echo > "$TRACING_PATH"/set_ftrace_pid
+		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
 	}
 
 	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 874268e..b4b115a 100755
--- a/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress_test.sh
+++ b/testcases/kernel/tracing/ftrace_stress_test/ftrace_stress_test.sh
@@ -34,6 +34,7 @@ export TRACING_PATH="$PWD/debugfs/tracing"
 export SPATH="$TPATH/ftrace_stress"
 
 test_interval=$1
+test_success=true
 
 save_old_setting()
 {
@@ -100,22 +101,22 @@ restore_old_setting()
 
 clean_up()
 {
-	kill -KILL $pid1
-	kill -KILL $pid2
-	kill -KILL $pid3
-	kill -KILL $pid4
-	kill -KILL $pid5
-	kill -KILL $pid6
-	kill -KILL $pid7
-	kill -KILL $pid8
-	kill -KILL $pid9
-	kill -KILL $pid10
-	kill -KILL $pid11
-	kill -USR1 $pid12
-	kill -KILL $pid13
-	kill -KILL $pid14
-	kill -KILL $pid15
-	kill -KILL $pid16
+	kill -KILL $pid1 || test_success=false
+	kill -KILL $pid2 || test_success=false
+	kill -KILL $pid3 || test_success=false
+	kill -KILL $pid4 || test_success=false
+	kill -KILL $pid5 || test_success=false
+	kill -KILL $pid6 || test_success=false
+	kill -KILL $pid7 || test_success=false
+	kill -KILL $pid8 || test_success=false
+	kill -KILL $pid9 || test_success=false
+	kill -KILL $pid10 || test_success=false
+	kill -KILL $pid11 || test_success=false
+	kill -USR1 $pid12 || test_success=false
+	kill -KILL $pid13 || test_success=false
+	kill -KILL $pid14 || test_success=false
+	kill -KILL $pid15 || test_success=false
+	kill -KILL $pid16 || test_success=false
 
 	sleep 2
 	restore_old_setting
@@ -233,5 +234,10 @@ clean_up
 
 echo "Ftrace Stress Test End"
 
-tst_resm TPASS "finished running the test. Run dmesg to double-check for bugs"
+if $test_success; then
+	tst_resm TPASS "finished running the test. Run dmesg to double-check for bugs"
+else
+	tst_resm TFAIL "please check log message."
+	exit 1
+fi
 
-- 
1.7.1


[-- Attachment #3: Type: text/plain, Size: 427 bytes --]

------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [LTP] [PATCH] try two methods to disable set_ftrace_pid
  2011-02-22  7:47   ` Han Pingtian
@ 2011-02-23  8:37     ` Garrett Cooper
  2011-02-23  8:48       ` Han Pingtian
  0 siblings, 1 reply; 5+ messages in thread
From: Garrett Cooper @ 2011-02-23  8:37 UTC (permalink / raw)
  To: Garrett Cooper, ltp-list, Li Zefan

On Mon, Feb 21, 2011 at 11:47 PM, Han Pingtian <phan@redhat.com> wrote:
> On Mon, Feb 21, 2011 at 10:57:34PM -0800, Garrett Cooper wrote:
>> On Feb 21, 2011, at 10:55 PM, Han Pingtian wrote:
>>
>> > On older kernel, we should use "echo -1 > ..." to disable
>> > set_ftrace_pid, but on the latest kernel we must use
>> > "echo > ..." to disable it. So we have to try both methods
>> > for disabling it in ftrace stress test.

Committed -- thanks!
-Garrett

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [PATCH] try two methods to disable set_ftrace_pid
  2011-02-23  8:37     ` Garrett Cooper
@ 2011-02-23  8:48       ` Han Pingtian
  0 siblings, 0 replies; 5+ messages in thread
From: Han Pingtian @ 2011-02-23  8:48 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

On Wed, Feb 23, 2011 at 12:37:57AM -0800, Garrett Cooper wrote:
> On Mon, Feb 21, 2011 at 11:47 PM, Han Pingtian <phan@redhat.com> wrote:
> > On Mon, Feb 21, 2011 at 10:57:34PM -0800, Garrett Cooper wrote:
> >> On Feb 21, 2011, at 10:55 PM, Han Pingtian wrote:
> >>
> >> > On older kernel, we should use "echo -1 > ..." to disable
> >> > set_ftrace_pid, but on the latest kernel we must use
> >> > "echo > ..." to disable it. So we have to try both methods
> >> > for disabling it in ftrace stress test.
> 
> Committed -- thanks!
> -Garrett
Thanks so much!

-- 
Han Pingtian
Quality Engineer
hpt @ #kernel-qe
Red Hat, Inc
Freedom ... courage ... Commitment ... ACCOUNTABILITY

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-23  8:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22  6:55 [LTP] [PATCH] try two methods to disable set_ftrace_pid Han Pingtian
2011-02-22  6:57 ` Garrett Cooper
2011-02-22  7:47   ` Han Pingtian
2011-02-23  8:37     ` Garrett Cooper
2011-02-23  8:48       ` Han Pingtian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.