Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp794898pxb; Wed, 3 Feb 2021 19:06:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLLxeHZwNRWGqCiIPPhyizV+OIsdeepxo+9tExpXO8+DJUaLF0YABB/+52C6gmMCK2jCyA X-Received: by 2002:a05:6402:3508:: with SMTP id b8mr6190746edd.341.1612408008696; Wed, 03 Feb 2021 19:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612408008; cv=none; d=google.com; s=arc-20160816; b=Xm+A99LqQaM0WFs5N8sNShXUKByMOduLKMelckr2L2iddPdvYkOooZlakcNWtMBxlF fzULIlXmksZo/9eDirA/0cDcMJrNo7AwA3qv89MdLgsd9ClmSecU7n5q+P2JC/hNoI9U g7RYXd4ccICQP9drqwaZbXWduZDtw3Jc3Kilw/xhduQ5Wcsr+fxQa0Wfuv82CDA5dmon bmDUEPmQlY+71VfZ4GYvGxMGyBmhMfhHEtZ1aevnoXl8dyLASMfxFEok0h+68ZIup9be UWmDuLlfkNsiCpdcDIWOU4rjBJLk7S1qYUCrGTAqeNWuhYS0fqg2dT0mH2J6pZKQ+PzJ 6v0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=DfBuGiRxyIo4ZNtk0GDbsoamqmdsHI5nZtWcPvdL8MI=; b=KhhN7KcX6XSiiM7gicstLU4dZLjGbcxeiuPXNGYpXZqLQj024+wUi7ZsbNG/A5m5Om cO5li7SwX1A0fhBgBznoWXQzGm7lRkOyQiITgV7tTzePca2t5096Ed6R4w3UH9uMphSL /c4obGnV1fyWV2H3rYdaIsvrVe8M+Rg46bVi0EtkBPTHqnjGqKDB/E9qMEyQqMvfBaCn bVZbzUuIz9AzPVMajQcR4XG4iNBJMGJ+5clPsxZy2yH1ThGZQHUrm29SMOWFm21Mxc19 esMbutsnOe+WXYQBWXZhXRCooY6LnFEfAekYNGm009Df1Zi3WEEtZpZMtyUOiEHK7J0M oOQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by17si1470098ejb.604.2021.02.03.19.06.24; Wed, 03 Feb 2021 19:06:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234620AbhBDCha (ORCPT + 99 others); Wed, 3 Feb 2021 21:37:30 -0500 Received: from mail.loongson.cn ([114.242.206.163]:35282 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233517AbhBDCh2 (ORCPT ); Wed, 3 Feb 2021 21:37:28 -0500 Received: from [10.130.0.135] (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxadS2XRtg+ikDAA--.3874S3; Thu, 04 Feb 2021 10:36:39 +0800 (CST) Subject: Re: [PATCH] selftests: breakpoints: Fix wrong argument of ptrace() when single step To: Shuah Khan , Shuah Khan References: <1612341547-22225-1-git-send-email-yangtiezhu@loongson.cn> Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org From: Tiezhu Yang Message-ID: Date: Thu, 4 Feb 2021 10:36:38 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-CM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GrUvcSsGvfC2KfnxnUUI43 ZEXa7IU8mZX5UUUUU== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/04/2021 02:30 AM, Shuah Khan wrote: > On 2/3/21 1:39 AM, Tiezhu Yang wrote: >> According to the error message, the first argument of ptrace() should be >> PTRACE_SINGLESTEP instead of PTRACE_CONT when ptrace single step. >> >> Fixes: f43365ee17f8 ("selftests: arm64: add test for >> unaligned/inexact watchpoint handling") >> Signed-off-by: Tiezhu Yang >> --- >> tools/testing/selftests/breakpoints/breakpoint_test_arm64.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git >> a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c >> b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c >> index ad41ea6..2f4d4d6 100644 >> --- a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c >> +++ b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c >> @@ -143,7 +143,7 @@ static bool run_test(int wr_size, int wp_size, >> int wr, int wp) >> if (!set_watchpoint(pid, wp_size, wp)) >> return false; >> - if (ptrace(PTRACE_CONT, pid, NULL, NULL) < 0) { >> + if (ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL) < 0) { >> ksft_print_msg( >> "ptrace(PTRACE_SINGLESTEP) failed: %s\n", >> strerror(errno)); >> > > Right before this it does a set_watchpoint(). PTRACE_CONT is what > makes sense to me. Error might be the one that is incorrect here? What do you think the following change? If it is OK, I will send v2 soon. diff --git a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c index ad41ea6..e704181 100644 --- a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c +++ b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c @@ -145,7 +145,7 @@ static bool run_test(int wr_size, int wp_size, int wr, int wp) if (ptrace(PTRACE_CONT, pid, NULL, NULL) < 0) { ksft_print_msg( - "ptrace(PTRACE_SINGLESTEP) failed: %s\n", + "ptrace(PTRACE_CONT) failed: %s\n", strerror(errno)); return false; } @@ -159,7 +159,7 @@ static bool run_test(int wr_size, int wp_size, int wr, int wp) } alarm(0); if (WIFEXITED(status)) { - ksft_print_msg("child did not single-step\n"); + ksft_print_msg("child exited prematurely\n"); return false; } if (!WIFSTOPPED(status)) { Thanks, Tiezhu > > thanks, > -- Shuah