From: shuah <shuah@kernel.org>
To: Po-Hsu Lin <po-hsu.lin@canonical.com>,
rostedt@goodmis.org, mingo@redhat.com,
linux-kselftest@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-kernel@vger.kernel.org, shuah <shuah@kernel.org>
Subject: Re: [PATCH] selftests/ftrace: skip ftrace test if FTRACE was not enabled
Date: Tue, 2 Jul 2019 13:22:26 -0600 [thread overview]
Message-ID: <4a44dd22-be88-ce5b-5c9b-6a3759b6c2eb@kernel.org> (raw)
In-Reply-To: <20190702062358.7330-1-po-hsu.lin@canonical.com>
Hi Po-Hsu Lin,
On 7/2/19 12:23 AM, Po-Hsu Lin wrote:
> The ftrace test will need to have CONFIG_FTRACE enabled to make the
> ftrace directory available.
>
> Add an additional check to skip this test if the CONFIG_FTRACE was not
> enabled.
>
> This will be helpful to avoid a false-positive test result when testing
> it directly with the following commad against a kernel that does not
> have CONFIG_FTRACE enabled:
> make -C tools/testing/selftests TARGETS=ftrace run_tests
>
> The test result on an Ubuntu KVM kernel will be changed from:
> selftests: ftrace: ftracetest
> ========================================
> Error: No ftrace directory found
> not ok 1..1 selftests: ftrace: ftracetest [FAIL]
> To:
Thanks for the patch.
Check patch fails with the above To:
WARNING: Use a single space after To:
#107:
To:
ERROR: Unrecognized email address: ''
#107:
To:
total: 1 errors, 1 warnings, 23 lines checked
Please fix and send v2.
> selftests: ftrace: ftracetest
> ========================================
> CONFIG_FTRACE was not enabled, test skipped.
> not ok 1..1 selftests: ftrace: ftracetest [SKIP]
>
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---
> tools/testing/selftests/ftrace/ftracetest | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> index 6d5e9e8..6c8322e 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -7,6 +7,9 @@
> # Written by Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> #
Hmm. You havem't cc'ed Masami on this. Adding Masami.
I would think Masami should be on the Signed-off-by as well,
since he is the author.
>
> +# Kselftest framework requirement - SKIP code is 4.
> +ksft_skip=4
> +
> usage() { # errno [message]
> [ ! -z "$2" ] && echo $2
> echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
> @@ -139,7 +142,13 @@ parse_opts $*
>
> # Verify parameters
> if [ -z "$TRACING_DIR" -o ! -d "$TRACING_DIR" ]; then
> - errexit "No ftrace directory found"
> + ftrace_enabled=`grep "^CONFIG_FTRACE=y" /lib/modules/$(uname -r)/build/.config`
> + if [ -z "$ftrace_enabled" ]; then
> + echo "CONFIG_FTRACE was not enabled, test skipped."
> + exit $ksft_skip
> + else
> + errexit "No ftrace directory found"
> + fi
> fi
>
> # Preparing logs
>
thanks,
-- Shuah
next prev parent reply other threads:[~2019-07-02 19:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 6:23 [PATCH] selftests/ftrace: skip ftrace test if FTRACE was not enabled Po-Hsu Lin
2019-07-02 19:22 ` shuah [this message]
2019-07-03 0:11 ` Masami Hiramatsu
2019-07-03 1:07 ` Steven Rostedt
2019-07-03 3:09 ` Masami Hiramatsu
2019-07-03 3:18 ` Steven Rostedt
2019-07-03 8:20 ` Masami Hiramatsu
2019-07-04 12:14 ` Po-Hsu Lin
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=4a44dd22-be88-ce5b-5c9b-6a3759b6c2eb@kernel.org \
--to=shuah@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=po-hsu.lin@canonical.com \
--cc=rostedt@goodmis.org \
/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