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

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.