All of lore.kernel.org
 help / color / mirror / Atom feed
From: Han Pingtian <phan@redhat.com>
To: ltp-list@lists.sourceforge.net, Li Zefan <lizf@cn.fujitsu.com>
Subject: [LTP] [PATCH] try two methods to disable set_ftrace_pid
Date: Tue, 22 Feb 2011 14:55:07 +0800	[thread overview]
Message-ID: <20110222065507.GA7689@hpt.nay.redhat.com> (raw)

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

             reply	other threads:[~2011-02-22  6:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-22  6:55 Han Pingtian [this message]
2011-02-22  6:57 ` [LTP] [PATCH] try two methods to disable set_ftrace_pid Garrett Cooper
2011-02-22  7:47   ` Han Pingtian
2011-02-23  8:37     ` Garrett Cooper
2011-02-23  8:48       ` Han Pingtian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110222065507.GA7689@hpt.nay.redhat.com \
    --to=phan@redhat.com \
    --cc=lizf@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.