From: Greg KH <gregkh@linuxfoundation.org>
To: Shuah Khan <shuahkh@osg.samsung.com>
Cc: paul.elder@pitt.edu, panand@redhat.com, will.deacon@arm.com,
labath@google.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: breakpoints: convert breakpoint_test_arm64 test to TAP13
Date: Tue, 27 Jun 2017 18:11:26 +0200 [thread overview]
Message-ID: <20170627161126.GA10534@kroah.com> (raw)
In-Reply-To: <20170627160447.11345-1-shuahkh@osg.samsung.com>
On Tue, Jun 27, 2017 at 10:04:47AM -0600, Shuah Khan wrote:
> Convert breakpoint_test_arm64 output to TAP13 format.
>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
> .../selftests/breakpoints/breakpoint_test_arm64.c | 114 ++++++++++++++-------
> 1 file changed, 79 insertions(+), 35 deletions(-)
>
> diff --git a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> index fa6d57af5217..d13bd0dea13e 100644
> --- a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> +++ b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> @@ -41,20 +41,27 @@ static volatile uint8_t var[96] __attribute__((__aligned__(32)));
> static void child(int size, int wr)
> {
> volatile uint8_t *addr = &var[32 + wr];
> + char msg_buf[512];
>
> if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) != 0) {
> - perror("ptrace(PTRACE_TRACEME) failed");
> - _exit(1);
> + snprintf(msg_buf, sizeof(msg_buf),
> + "ptrace(PTRACE_TRACEME) failed: %s\n",
> + strerror(errno));
> + ksft_exit_fail_msg(msg_buf);
No objection to this patch, but perhaps the "msg" functions could either
be variable arg macros, or just a printk() like function that can take
the string and anything you want to send to it.
So this could be:
ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s\n", strerror(errno));
Anyway, just a thought, might make conversions a lot easier, no need for
intermediate buffers.
thanks,
greg k-h
next prev parent reply other threads:[~2017-06-27 16:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 16:04 [PATCH] selftests: breakpoints: convert breakpoint_test_arm64 test to TAP13 Shuah Khan
2017-06-27 16:11 ` Greg KH [this message]
2017-06-27 16:36 ` Shuah Khan
2017-06-27 16:50 ` Paul Elder
2017-06-27 16:53 ` Shuah Khan
2017-06-27 16:47 ` Paul Elder
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=20170627161126.GA10534@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=labath@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=panand@redhat.com \
--cc=paul.elder@pitt.edu \
--cc=shuahkh@osg.samsung.com \
--cc=will.deacon@arm.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.