From: Steven Rostedt <rostedt@goodmis.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Shuah Khan <shuahkhan@gmail.com>, Shuah Khan <shuah@kernel.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH -tip v2 2/6] selftests: ftrace: Initialize ftrace before each test
Date: Mon, 14 Nov 2016 13:12:00 -0500 [thread overview]
Message-ID: <20161114131200.7aaaaa13@gandalf.local.home> (raw)
In-Reply-To: <147781045018.11952.9286420015716639736.stgit@devbox>
On Sun, 30 Oct 2016 15:54:10 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:
> Reset ftrace to initial state before running each test.
> This fixes some test cases to enable tracing before starting
> trace test. This can avoid false-positive failure when
> previous testcase fails while disabling tracing.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> tools/testing/selftests/ftrace/ftracetest | 2 +-
> tools/testing/selftests/ftrace/test.d/functions | 25 +++++++++++++++++++++++
> 2 files changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> index 4c6a0bf..a03d366 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -228,7 +228,7 @@ trap 'SIG_RESULT=$XFAIL' $SIG_XFAIL
>
> __run_test() { # testfile
> # setup PID and PPID, $$ is not updated.
> - (cd $TRACING_DIR; read PID _ < /proc/self/stat ; set -e; set -x; . $1)
> + (cd $TRACING_DIR; read PID _ < /proc/self/stat; set -e; set -x; initialize_ftrace; . $1)
> [ $? -ne 0 ] && kill -s $SIG_FAIL $SIG_PID
> }
>
> diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> index c37262f..fbaf565 100644
> --- a/tools/testing/selftests/ftrace/test.d/functions
> +++ b/tools/testing/selftests/ftrace/test.d/functions
> @@ -23,3 +23,28 @@ reset_trigger() { # reset all current setting triggers
> done
> }
>
> +reset_events_filter() { # reset all current setting filters
> + grep -v ^none events/*/*/filter |
> + while read line; do
> + echo 0 > `echo $line | cut -f1 -d:`
> + done
> +}
> +
> +disable_events() {
> + echo 0 > events/enable
> +}
> +
> +initialize_ftrace() { # Reset ftrace to initial-state
> +# As the initial state, ftrace will be set to nop tracer,
> +# no events, no triggers, no filters, no function filters,
> +# no probes, and tracing on.
> + disable_tracing
> + reset_tracer
> + reset_trigger
> + reset_events_filter
> + disable_events
> + echo | tee set_ftrace_* set_graph_* stack_trace_filter set_event_pid
I just disabled function graph tracing, and this causes every test to
fail.
tee: set_graph_*: Permission denied
-- Steve
> + echo > kprobe_events
> + echo > uprobe_events
> + enable_tracing
> +}
next prev parent reply other threads:[~2016-11-14 18:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-30 6:53 [PATCH -tip v2 0/6] ftrace: selftests: Add full glob matching and update ftracetest Masami Hiramatsu
2016-10-30 6:54 ` [PATCH -tip v2 1/6] ftrace: Support full glob matching Masami Hiramatsu
2016-10-30 6:54 ` [PATCH -tip v2 2/6] selftests: ftrace: Initialize ftrace before each test Masami Hiramatsu
2016-11-14 18:12 ` Steven Rostedt [this message]
2016-11-15 6:32 ` Masami Hiramatsu
2016-10-30 6:54 ` [PATCH -tip v2 3/6] selftests: ftrace: Hide ftracetest logs from git Masami Hiramatsu
2016-10-30 6:54 ` [PATCH -tip v2 4/6] selftests: ftrace: Introduce TMPDIR for temporary files Masami Hiramatsu
2016-10-30 6:54 ` [PATCH -tip v2 5/6] selftests: ftrace: Add a testcase for function filter glob match Masami Hiramatsu
2016-10-30 6:54 ` [PATCH -tip v2 6/6] selftests: ftrace: Add a testcase for types of kprobe event Masami Hiramatsu
2016-11-08 23:34 ` [PATCH -tip v2 0/6] ftrace: selftests: Add full glob matching and update ftracetest Masami Hiramatsu
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=20161114131200.7aaaaa13@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=shuah@kernel.org \
--cc=shuahkhan@gmail.com \
--cc=tom.zanussi@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).