From: Han Pingtian <phan@redhat.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] try two methods to disable set_ftrace_pid
Date: Tue, 22 Feb 2011 15:47:45 +0800 [thread overview]
Message-ID: <20110222074745.GE2883@hpt.nay.redhat.com> (raw)
In-Reply-To: <49FB8369-77D6-4B9A-B69C-6E9E2DC54F80@gmail.com>
[-- 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
next prev parent reply other threads:[~2011-02-22 7:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=20110222074745.GE2883@hpt.nay.redhat.com \
--to=phan@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=yanegomi@gmail.com \
/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.