From patchwork Tue Feb 23 08:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Zhe X-Patchwork-Id: 12100031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71E33C433DB for ; Tue, 23 Feb 2021 08:27:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B8FE64E05 for ; Tue, 23 Feb 2021 08:27:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B8FE64E05 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=3Al1TGzCZmfotMU/5b8zjUBYLn4oXA8EO0brH/a4LOY=; b=BsGmWTC81ht+wZHyq9NH1aHUEX rihD7hnL5IjzE7xrH4s7ZaJKAXs19QToQEZr96X6HrAmJZ1gIQGcJp9F0PSJs5u7RqS2wiaoPtQ+N 1Zu5xIDaegxetuiRS7fP0SxiCDScuL+wmu9BqtSrWr+GKXiypybLSlYWxuV5Bvws8ldOeg0MyRKY2 0vuVYtX+ivIng7KfZzehLhVN2uq2fu/uQNKEiNcnjcbZQ1gVK2FuCFh48fmT3joLfaYiWU6j2RMFS kuKo/oCLijrLsvY/l3fs3b8NoypiFKWzcq5OBR97CHsCvKRNhCLgz6qNzVK8Tb1DO1dkUoFtO3R6K Ojg4cnhA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lET1F-0007hl-Jk; Tue, 23 Feb 2021 08:26:09 +0000 Received: from mail-dm6nam11on2077.outbound.protection.outlook.com ([40.107.223.77] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lET19-0007gi-Kz for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 08:26:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NQIC1fHRSuq+QJmwuywpgGy3i+eMF/3Rs1xNrtpDxeg5CyKSydKDr88CoPHwDDQz3geOT3I7quHvjNZFS+xIebV8y0sB+RhTor9ySfwVPPfLQ10MgdAX74Kn7XhPlT7Z8OI2I8LwYI+Hoi5zE8TyVybD7VpZH7TZKP3zj5okG/Q2/469S2joBvX1ue25qASb4mgC+s+EqidqJtO4Fdfp/rIGOX99198KL9gVD/z1l9tqKI3xnbRiFE0irRfwHpjR8icF+SqVZrbMuiRmZ7nofz//gR7LskYIKvPfcPOvUBj3R/mPKuNBpZ8e8OSy+ablJAL6f+DijlJV8bEB3GlRVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uG0ykDZ8H6mxiQTiG4V1tyssG0q/P/1IinwL5ZcF+EM=; b=AZgSBTndLoHqaZ3LCid0gByUKGZQ0OdK1kq9EWiN+HAxgEjaH9ncp75FMhqXhuIHiLAQFk9g9x+Ou09gOuyVBvCtkQuHNBNQTtuTeLvyydGhJdTiviJFZ93ALD0J///03NamymaULCFcO1Pv3BP/ygCDlh8oJPn4A7CgrQQV+U+LTVUUx9Ka08ByvnyD3v7+cdKtHztZWytFiGQ4A4r6EimLGNvOdCMUDp0dsuBiepnorovJjA+h39pe1QTarCp4AWR16OJGD+dtHZMlUXgQFrFN2fcQczw88ppQ4RyH6aHlVDFbAHNz+mIEV4KeoSaIfQ/Qnc2us9X6w5IaT55+mA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uG0ykDZ8H6mxiQTiG4V1tyssG0q/P/1IinwL5ZcF+EM=; b=ZcrM56dvsR3NkYVno9ENvZTfD5F+IzCBOQ7Gfsms3TpZJzFUjmGs/FrTJdcHbom1b3QzIHJ11agGjd5s7ah8KrZMKq7PmRa+7+rNuVDfNigVbiQGjRjDeLpSTBXznogCiVa0HmjOinxKAFrvVC5SSJNRIXeegcExWVhRytM220o= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=windriver.com; Received: from MWHPR1101MB2351.namprd11.prod.outlook.com (2603:10b6:300:74::18) by MWHPR11MB1679.namprd11.prod.outlook.com (2603:10b6:301:f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27; Tue, 23 Feb 2021 08:25:58 +0000 Received: from MWHPR1101MB2351.namprd11.prod.outlook.com ([fe80::ad02:3dcf:d3e5:b27d]) by MWHPR1101MB2351.namprd11.prod.outlook.com ([fe80::ad02:3dcf:d3e5:b27d%10]) with mapi id 15.20.3868.033; Tue, 23 Feb 2021 08:25:58 +0000 From: He Zhe To: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing Date: Tue, 23 Feb 2021 16:25:34 +0800 Message-Id: <20210223082535.48730-1-zhe.he@windriver.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [60.247.85.82] X-ClientProxiedBy: HKAPR03CA0003.apcprd03.prod.outlook.com (2603:1096:203:c8::8) To MWHPR1101MB2351.namprd11.prod.outlook.com (2603:10b6:300:74::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pek-lpg-core2.corp.ad.wrs.com (60.247.85.82) by HKAPR03CA0003.apcprd03.prod.outlook.com (2603:1096:203:c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.8 via Frontend Transport; Tue, 23 Feb 2021 08:25:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fa3b015-c74d-458a-524d-08d8d7d4a51c X-MS-TrafficTypeDiagnostic: MWHPR11MB1679: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dpw9Is1cS6DLRpATMwesCwgWwMpZ/hjf+pw5J0gPDA3MUJjO2zZN2VZFdtQlHTbiYy3Lk1ia4UDSzuyrczPrcgsK7epGOnKlGBLR8B0RmbLOT91DC4T4rqeHe2/WqgujajK9k1qlcsn3qtLLxH1dmB6M5b0DlGPizbl+PSctItfRDlFKFnnoJ2cwTJdBf0IroUClawOswekv63ixYFtrI36U9iI88rhfDGrdxBsLMZuARhcufaU+PG1dbkYdjIRCQa88O484/j0ml2PZJQI2UFaIxQFJP1RXZEzOUSbCep1Z+Qv07aRItki+i+NxjCsWuURdRjztqhnko27r8uhgDhlu5oRATfcFMxxNyWcQao1n1Ra0TEb+ZIF8zRoIv0WwAFwYUCAv3cbpBjDxmvyVC5+u/kxgchUD+Qs/D0B0KLH3VwbnGdI2NzB11X5gDG/mQ6yK2M387FZuqjcXm17p9H/Ve1C6BrPWec/SE2vRhzFET/+29m5rfGtlYq7CKRE6+Rq6BOpvg6GP/r8v78PbMw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1101MB2351.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(39850400004)(346002)(136003)(186003)(26005)(1076003)(8936002)(6512007)(6506007)(66946007)(16526019)(478600001)(6666004)(36756003)(5660300002)(8676002)(2616005)(83380400001)(52116002)(66556008)(2906002)(86362001)(956004)(66476007)(316002)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2TMwiCPOljYoHHAufbLPxy/zcOd70kz4EyCw15hakLteVpA6brExhPkjdxQPATy5hU14bXxJwTAImGByWV3s1lWj8ZIlVI4y6buLj4fdxkTaodVHuAlNw2GGLelSmXUz/xcEFWU3S/IIgZhm2P8Hmce+UA9z+bwR+HqRbQs90VB8qsrqB6spK+7XLHZjXb6idiu9bU2CzW7kvOiLL5A2ml3l3VeNlmd3vXOIqwxmUuExb1yUxm3BhAcxSq5VdtMWHK4a7/3gRf4mEbY8kgHfSjHpabUxfPWoGYd/CFbrJcTT8eqkJuGjkPDPXM+kwMN0H2dH4PjJaw68g15kxWED/uId6BMxLvPaGbbXxfwhtXWY9M2LNraVvKxGguy9/gGjIqRVHH7SM4pgH+OMMiFiS6wy/loNCK+yyIJNzt4Dtu+3gqOOI+RWjzUN/jy7xc+/7g+RwPHDBQ8ijF6VzEaBCefrD8gjdGQIPAhQrzn7i0jf3iGKU42K3RfFX4a8znsGhV9OBofJ1y7ODYYJf40I3kbCPNuAil082GKqCfybg/XFDFc7R4xpuT54n9+LzO0qzdnuUa/ziRb89ndGvdvEh4w3rMsaGZxYjL2qVXgw3hGhM9IdoTxOXSasDSjXuw3DDgxBVvIrQajVJZfDdkZ5qoOzbo5IgDdBeeuwTkwUglIQn7j0l3CpBVY7jXcmoX0V/GdQpnxNESLJmvNzfDY5WmMpWr4hFhC75X++9wJ2VNfxGGB/Gxfr7m7/+WDpG8iIGpdpLL19njSGRPhzYlETn1KP+FQIOU9LhdSw1AX6YN1AC7HRSX5ZDG1bTMjUSGUkMzAY9PFhN7SdcftEooz+/1FkTO8QaA2VLiY24n0e77R1XXw07AYGB0noFLxLcNDNbS9R+/PyL5INrywAF475/Zk1wN/dO4gOo/4XSnhtoWBGs4cZ3BCbwHf0fmHa7/pMuNoN4G8i9a6k/iTw/horOEfHsBYZIZXmqVOXcG3O5EYa6P+7Ae0dzpxgq6DFuHmQWrmHwgIYI9nk1jSNGA3wwC3XZJZq6Q6+iRNWzheFIwCK+ZRHs/yVGR0CBqipjCML8NpBF7UCsRnZPo8fYqZuZYzI1haDqKiZDMAlmWVaydMWvBiPY0VwAqdNZ9S4Xjo2GgT0pJnFZ8WSGtVjjk0S17WsqKhSYERc5WbfHfsb7WBderyS8SC+PziPiXHh88WxfvL4uh4mb2yvAyn+MmJ+ajtzbm9DXJm/FxEQbZbe4AyrxW14awAO5ZiiauVUQFagiQWMhlkr5cPtgDGdUojLwrjdLdwVe5H8JncArEQvK0xOnMta8hAapfO/ZkO7Pb1E X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa3b015-c74d-458a-524d-08d8d7d4a51c X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2351.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2021 08:25:58.0388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: //7UqtIbyK4/9Q47CTY0GSEyV5g+PFBJHhrpPJRpCyvqIYp7framXuGTzyZHRo+YFrNzIedEw82QloHsBMWl7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1679 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_032603_828306_B0DC6589 X-CRM114-Status: GOOD ( 10.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As stated in linux/errno.h, ENOTSUPP should never be seen by user programs. When we set up uprobe with 32-bit perf and arm64 kernel, we would see the following vague error without useful hint. The sys_perf_event_open() syscall returned with 524 (INTERNAL ERROR: strerror_r(524, [buf], 128)=22) Use EOPNOTSUPP instead to indicate such cases. Signed-off-by: He Zhe --- arch/arm64/kernel/probes/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/probes/uprobes.c b/arch/arm64/kernel/probes/uprobes.c index a412d8edbcd2..2c247634552b 100644 --- a/arch/arm64/kernel/probes/uprobes.c +++ b/arch/arm64/kernel/probes/uprobes.c @@ -38,7 +38,7 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, /* TODO: Currently we do not support AARCH32 instruction probing */ if (mm->context.flags & MMCF_AARCH32) - return -ENOTSUPP; + return -EOPNOTSUPP; else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE)) return -EINVAL; From patchwork Tue Feb 23 08:25:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Zhe X-Patchwork-Id: 12100033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DC74C433E6 for ; Tue, 23 Feb 2021 08:27:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9741601FF for ; Tue, 23 Feb 2021 08:27:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9741601FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=99EwvDH3Laro2XbkJ1uXhvfxFqwbEZ6FwOvxTPpQ/KI=; b=Vt0rzDfRcSYrXDDgAxMvdluNDj g/KklT3KC4/hX/1y1p0kJDR/vMW5c7ai3cIuSsLu/Smlw0Nu3weESbsl/7YWAF3qnkp4AsSgWu4hS RFuLb4q89tm00dRLrAbFFB8HL3WJ0DA1iabNzL90hwkFSo5RkHl9z6chJ/4LvNXEZ1+FFoqqC3CN/ iBgeaguOFWXn/R+AbjVuy8DvA6NdvdP3MfjMPCASLYqUVI0RdQNnNmRpDpFGuD7mMZNcViGk9bOGL tnbiROeg9PHXfWpj+VG1TwAFcHQHqz76ktk8kMCruqqz/BU4yYhu+XE4xKItvGG7/bzKb4Xqf9dmy T5orRqwg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lET1K-0007iS-8U; Tue, 23 Feb 2021 08:26:14 +0000 Received: from mail-bn7nam10on2066.outbound.protection.outlook.com ([40.107.92.66] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lET1B-0007h7-WB for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 08:26:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dSjg9PqUHtXCHY208H51+b/+kcJKr3p7gj2XWFNlL4KcS+1ovGM4zTdA8Y1Tyu+bEH3xKYw3jKkFzsEeDoHScZIwnWoFM4GnBP2l4ZvSMvAIs5V9ED5oXhJANjeQJl6uADt6mOdveWt4fiSlXTx6oNvO/fiOGoIJ0wPFrSGZB5YK2lOsOJ03m0lUMOWl2tExnq+7DoLGtjtQTwZgZMNgCuKO0weNTgoSvtzhLmsJ91bCo6wEG+8hhAQbxjZARyz1GP/pCMgUodbtsN5/2BZRFPxFq+LkIkATUuxQrdyCxRPAsKrLB2E1daEBZNkPiS15ej6CMBmSCYeHZbCLCnlFiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VlX64pFI4xchQAa4ixY4HiquPPDyxaOtGM0lBJxoM/M=; b=RkPd67B7AxEbRLuD3n7fxQ8xIoSI/+OJJFKjifYeamsLGZRYlTIDUThcfan1SUbJs0fwNwkfINsEjjmFGrPYBfuWohwTGgfRaB2qpH6mWllYHwiQF2DsYEoxRmEX5RAxqoZzj2ud2qMZW96IPTQBPEdyWy4c/bVQWkn0ZsJ2MNsp+O+XtpViv6x3H7Qo2MjEMh1CB4D4/HxuQlPGXppIKAyIp0u31IQ9us9i9MeExSHr3nFftez+6aM3RRMKw9wfKzud7RUJQmSUKCasf7zZAJZSVwgq61CKaRgHkBb0WE7rTXPC0wBpCxgJ2++8+Z4qmQB3+YRC2PIZ6Zk+57r1Pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VlX64pFI4xchQAa4ixY4HiquPPDyxaOtGM0lBJxoM/M=; b=RXTaByqzTgXRW4/b7skciwg+MHWuiLKKsY4Nx9FyMEEnwd/u0v/5gVFjOrgshyqGSAqVeJ9Bz0dINVFfImLt9+22Sjv5iArSfuNWQ8UjyUyEFNAdRVm2oZ4L9JrUHrgH3jG+fEPbjyb+c/r+lGQkyA7beSjXhlCOjqebGpyRPPE= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=windriver.com; Received: from MWHPR1101MB2351.namprd11.prod.outlook.com (2603:10b6:300:74::18) by CO1PR11MB5171.namprd11.prod.outlook.com (2603:10b6:303:95::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.30; Tue, 23 Feb 2021 08:26:00 +0000 Received: from MWHPR1101MB2351.namprd11.prod.outlook.com ([fe80::ad02:3dcf:d3e5:b27d]) by MWHPR1101MB2351.namprd11.prod.outlook.com ([fe80::ad02:3dcf:d3e5:b27d%10]) with mapi id 15.20.3868.033; Tue, 23 Feb 2021 08:26:00 +0000 From: He Zhe To: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] perf tools: Improve EOPNOTSUPP error reporting Date: Tue, 23 Feb 2021 16:25:35 +0800 Message-Id: <20210223082535.48730-2-zhe.he@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210223082535.48730-1-zhe.he@windriver.com> References: <20210223082535.48730-1-zhe.he@windriver.com> X-Originating-IP: [60.247.85.82] X-ClientProxiedBy: HKAPR03CA0003.apcprd03.prod.outlook.com (2603:1096:203:c8::8) To MWHPR1101MB2351.namprd11.prod.outlook.com (2603:10b6:300:74::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pek-lpg-core2.corp.ad.wrs.com (60.247.85.82) by HKAPR03CA0003.apcprd03.prod.outlook.com (2603:1096:203:c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.8 via Frontend Transport; Tue, 23 Feb 2021 08:25:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c9b4fca-de18-4070-4a76-08d8d7d4a6da X-MS-TrafficTypeDiagnostic: CO1PR11MB5171: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:551; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 75aZylm/iSzwMifJXUBzxwqioGWz0zXPcXs1asntCWHI1kFyGgcnSvoku0OwKRb4wyy5i2zrwzcRwzAVHVjZhZ08r2s8QidrG7UCf+EbOr0RRjkIJnj5Khz4lZqv9Kt2DFaEfco7SlpvFScscfSn1SIbby6Fpa2qgQOuA+S5AbvKFtX5QiMtkO7bT7ZJCUhL60jjEISBd7kelmUqKcM9fxtyF+TRQEuh1zbmS6PKQcr8kIGfLlCwlmxwtNw4frcwfUFktEyQnwCA2tp8+1qTgstV9O9RdcNXb45nqZc//UqC78A/nrJpzGWhcRSNxrldfY247YLjuW5AAGLlUFFFH14Ab9aJerOCTmo6yJtyIYIvJW/g3b2ADkSH8c4k+mqGk5cKqgP3rH4BJxUt4qxft3yqXvfmMuM8guooyYANdwv/Y4DKaoQWX+7dFDtIQseac4NOR4m/Dvf8UDHiFpVfapVFJDu3r+BO2dvxvY3mV+3/T6Tuw5OZXfu8C1hSSoUzRSHQXPoCCh86KSzTzYBL/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1101MB2351.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39850400004)(376002)(366004)(346002)(136003)(396003)(2906002)(316002)(6486002)(26005)(52116002)(66556008)(66476007)(66946007)(1076003)(6506007)(6512007)(186003)(8676002)(6666004)(2616005)(83380400001)(86362001)(36756003)(5660300002)(16526019)(478600001)(956004)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2yEaasxrdhH1omg+PrY7gsk/l7zUdEV17R8LctJpqu1UzCgAkV1CfIRzU29H/tAOFlKLr3PHBrsrMopAlxppyAh9bmjLkFJ9WcA1bz+SNn5ZebB2quQvzujjAp98Im8/UcTJ9+DRWD12WRp3LrABwRDNyIbq5YtqisRex3O+PJs6dFd5MRhUt8VbzFzdNPIUL+urKtQDhf+5zEuSvDWLt3fnQ6fIwRDje11ueQCdNGamfUmhKR7vuU0U+6Dd9OaSXwushPqMTIpqzyi+fV46w6gOvE1nqzZ58bZkVUII1FO9NIbLPga1vlPIO1ayvYMlYJFgY/GPf3b3r6yEhQM5KUV8upP+2en9XHPnjgb6+tAeX1xaM7FUVMwU/q5TtpkRYx9znlJPUki6R9AkMQa+pAG23gDcOs64wwcHJKWkfPEMuozQdlkhH71qQkpeGDaP0ucPDy1/DjfWcZDYDuo7XRZZQKbc3uMhVg34vPRifRhkOT0VZdqOwZo5w0DZo4MhxeZ/eAzpXw7RTyEAM+ckqvvhFQ1vjv1qb98JCQnau5xKHqogZhob+BIvajU+gwOym5jOkzihzdl4MMyw3F/MugbFsnJ7/anL+yzvSwJE4JWhbub1VlCHkAhH3KC9DWyvcVvJ1GtQDsivgB8TjPMaywTH6AAVbYpac7616af5p6GfgaiKyjTwSlHEK1UnBSMR45FRDtyBbqZD9z+UJwg+QxtiL7lNAyDUZKaJUG1mOF5bNxZFPEPh05CvjiVGLqpOpBavpG1bpVGh43iibmjVQcXNNT3mAOavAb+QEvuroxLuwxJ3WkAqwAx9dOB+Qn91dD7jaVUWJUKooqTMmmvwXMf9OiRG9fy1K0sZloGRarCd9Je2vLQqLojJJj3LtK1qW+rrAZlYtIY8be9vGEvopWB0LTqIm69ICWdSbS/Cks+GmxeMQgE/PlqJXLZRRjOj+bnWul+enJ9F1/HzdX7yRwdk3FQSkFo16q5u0MAp2wR8Vw0QBzgYCMC1keTJo1uCx13K2JR1QvsWt0TgsjQg+ChFby+tGcqrLr9I/PYN7ehwjrgaiGONkMl/c3FZnarhFB4bn80Ehq6N2fwytf9py7sKLo6SdO87daEuQJajbmTwAeYkJQsT0CthCvYCSQ0zc4LQr814EFqxXbjQK1w/n3bDcn1zihKVVh51dAtznVMJc4FDZPCopf+HwJjUNOS1VTY/vxFt16C0OHC45fOmpr/COmeQT9s1x2FxAU1jQ5bNi2n7WJiMtlYqukdSXPeiucjOsOGHZ/YFjCo51ha0XFMpLxnncyfk8lT9d43Umd9wCbqL2hdH/qhTK5/1VmrT X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c9b4fca-de18-4070-4a76-08d8d7d4a6da X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2351.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2021 08:26:00.8456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2fyLq8LUHX0lf0ejNrkNe2ZrXJgtkqUhbC9uwJtpyCx3MA0C4wiGnzvxu3XHP8IZBVsJ5toZ57I5d6e6VqUdkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5171 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_032606_080974_28157E54 X-CRM114-Status: GOOD ( 10.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There may be multiple reasons for EOPNOTSUPP. Sometimes we cannot determine which one it is. For example, when we set up uprobe with 32-bit perf and arm64 kernel on some hardware that does not support sampling/overflow-interrupts, $ perf probe -x /lib/libc.so.6 malloc $ perf record -e probe_libc:malloc -a ls Before this patch: probe_libc:malloc: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat' After this patch: probe_libc:malloc: PMU Hardware may not support sampling/overflow-interrupts. Try 'perf stat'. Some 64-bit architectures may not support 32-bit instruction probing. Signed-off-by: He Zhe --- tools/perf/util/evsel.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 1bf76864c4f2..aa56511ddf60 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2697,22 +2697,24 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target, break; case EOPNOTSUPP: if (evsel->core.attr.aux_output) - return scnprintf(msg, size, - "%s: PMU Hardware doesn't support 'aux_output' feature", + printed += scnprintf(msg + printed, size, + "%s: PMU Hardware may not support 'aux_output' feature.\n", evsel__name(evsel)); if (evsel->core.attr.sample_period != 0) - return scnprintf(msg, size, - "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'", + printed += scnprintf(msg + printed, size, + "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'.\n", evsel__name(evsel)); if (evsel->core.attr.precise_ip) - return scnprintf(msg, size, "%s", - "\'precise\' request may not be supported. Try removing 'p' modifier."); + printed += scnprintf(msg + printed, size, "%s", + "\'precise\' request may not be supported. Try removing 'p' modifier.\n"); #if defined(__i386__) || defined(__x86_64__) if (evsel->core.attr.type == PERF_TYPE_HARDWARE) - return scnprintf(msg, size, "%s", + printed += scnprintf(msg + printed, size, "%s", "No hardware sampling interrupt available.\n"); #endif - break; + scnprintf(msg + printed, size, "%s", + "Some 64-bit architectures may not support 32-bit instruction uprobe.\n"); + return; case EBUSY: if (find_process("oprofiled")) return scnprintf(msg, size,