Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbdF0Qxd (ORCPT ); Tue, 27 Jun 2017 12:53:33 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:46009 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751492AbdF0Qx0 (ORCPT ); Tue, 27 Jun 2017 12:53:26 -0400 Subject: Re: [PATCH] selftests: breakpoints: convert breakpoint_test_arm64 test to TAP13 To: Paul Elder , Greg KH Cc: panand@redhat.com, will.deacon@arm.com, labath@google.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Shuah Khan References: <20170627160447.11345-1-shuahkh@osg.samsung.com> <20170627161126.GA10534@kroah.com> <809d5156-4f0e-e8b9-888b-3510113fc3b3@osg.samsung.com> <591c3655-d911-c696-71b2-2c8b42f3d81a@pitt.edu> From: Shuah Khan Message-ID: <7f404d76-ef5e-eb20-dc57-6deb75909924@osg.samsung.com> Date: Tue, 27 Jun 2017 10:53:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <591c3655-d911-c696-71b2-2c8b42f3d81a@pitt.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2252 Lines: 70 On 06/27/2017 10:50 AM, Paul Elder wrote: > On 06/28/2017 01:36 AM, Shuah Khan wrote: >> On 06/27/2017 10:11 AM, Greg KH wrote: >>> 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 >>>> --- >>>> .../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. >> >> Right. Changing "msg" functions to take var args will make things easier. >> I will take care of that and use this test for a use-case. > I was going to work on this... Yeah. Thanks for the reminder. I suggested making these var args and did as you to do this already. > Do you want to take care of it or can I do it? Please take care of it. I will do the breakpoints_test_arm64 on top of yours. thanks, -- Shuah > > Thank you, > > Paul > >>> >>> So this could be: >>> ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s\n", strerror(errno)); >> >> Right. >> >>> >>> Anyway, just a thought, might make conversions a lot easier, no need for >>> intermediate buffers> >>> thanks, >>> >>> greg k-h >>> >> >> thanks, >> -- Shuah >>