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+DRWD12WRp3LrABwRDNyIb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QT9s1x2FxAU1jQ5bNi2n7WJiMtlYqukdSXPeiucjOsOGHZ/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,