From: Han P. <ph...@re...> - 2011-02-22 07:44:01
|
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 <ph...@re...> > > --- > > .../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 |