From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.1 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,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 C6493C47083 for ; Wed, 2 Jun 2021 10:36:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8FDBB61090 for ; Wed, 2 Jun 2021 10:36:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FDBB61090 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=bombadil.20210309; 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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=chvyx+j7xpBXCnMYM2vzN3BOAkrWJl3OAmG1HhSMBwM=; b=Pc9jRz991Y7msU KH6wGCiqzjUvpGL1wWBxJ/+eJWS1UGHb2HtR78I3gwv2WHt3+j/a2cn1nEZaM8W4N5Hby3SeRHMZM Y3HBaekwFbmhK/SAmU//T0QIHC3ccAg7nWKIhPP5Xh48EP3wMu9AlJuEbtqVDmien0FrDWJYqI9Ur 5UASE+zDfqXhNStfglnAcKj/Bjgc0SsWBebDChDDRlKteDi4shh/3IFx9Fd554dCOfPw/FhEMC5s4 h9/d3+kzYKqUP/pJhk+t3bDY913f2+i4L4nt0nljz7boscdzcXprfsop1GOCYpSWg3yO1qATJ+HGG sH/P7wgs0nWD33VIAZzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loOCA-003MVI-2h; Wed, 02 Jun 2021 10:33:54 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loO93-003L6X-Kj for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 10:30:45 +0000 Received: by mail-pf1-x42c.google.com with SMTP id z26so1831941pfj.5 for ; Wed, 02 Jun 2021 03:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9ethqvFDGtJ7pygL6O7+7W1A8KYpMXPVj/v6wIqt0W0=; b=P7Nl3qoG2cR/l1a0GaRz5SGODttE3PK1+fLPoFdWJRNZITEUVt9CGmC2MseKhHKWoA jv9a2pLhsevTHrxkBo9HVQyYJZJIqvaDnxoNKLdzSMS0Xxp0vB7yjbyi7FHcumGwYDqq E8fJtd0VfJWBd+GV+dIrBrNzyW1mFsSM92TWjlLg6Bq6Dyk/lurPws7rPkyXUP1HuaC+ Ba7LceFajeDe2f5sNRrfvQrWh1AVraF37RZweYZa8OUZ/20a37juKY8w1g2iCtg0lVZv kAzAEtC7RYKMuDeB6M7TES+S7xfuxQW35iPn+QFRSa/R5ddK8FXKOzlJ38jxJxUfmcha V0MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ethqvFDGtJ7pygL6O7+7W1A8KYpMXPVj/v6wIqt0W0=; b=Smb2hjBNHFBmXAZqO7BmNNOB2O0Vci053Zr+62pnspdz2oxRz9tKEwMhe7CkPVPFNK QogxxNG836sQQFpyAgZMoS05TKM3Ed2i3Xl4XRfVTL5D4N+JhRKXhr2Yh/WxCF7BghU9 GsIS3l8PJo04SzeIQlE5tE3FsDkJFqaQfqvLGqudA2JSucRD5WbdaxuuP+9PYXDLlDuF kijx1zDrvnj+y7DaLIHF/lzIHbPZt14RP0369Hlqn+5PZrLnB0JTUPlTLo9znY78CfSA cty8ZX7zMly+13IwqkwkZrYV4QyytH+XVGJ76R6m+LfxeLEVAW8ecj1ykkwr443qsmCl OclQ== X-Gm-Message-State: AOAM532JemwLU3caP+RYk84k5hj0n+89JratuZk4QNZXMRn0zRxqVuy/ SfUN9LUst3C1h/q33pWeDhmqUw== X-Google-Smtp-Source: ABdhPJx0EfBw6QaTO9+VL3wMCj4oJnHgh5bVeyIeRmYvkSdry99ww/+lQjMFdUFcUK7C3Asky0mOxg== X-Received: by 2002:a63:8f0b:: with SMTP id n11mr32834096pgd.342.1622629840534; Wed, 02 Jun 2021 03:30:40 -0700 (PDT) Received: from localhost (ec2-18-167-84-74.ap-east-1.compute.amazonaws.com. [18.167.84.74]) by smtp.gmail.com with ESMTPSA id g2sm7950812pfv.106.2021.06.02.03.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 03:30:40 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , x86@kernel.org, "H. Peter Anvin" , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Adrian Hunter , Andi Kleen , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v2 8/8] perf record: Directly bail out for compat case Date: Wed, 2 Jun 2021 18:30:07 +0800 Message-Id: <20210602103007.184993-9-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210602103007.184993-1-leo.yan@linaro.org> References: <20210602103007.184993-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_033041_724814_D62F2223 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since the 64-bit atomicity is not promised in 32-bit perf, directly report the error and bail out for this case. Now only applies on x86_64 and Arm64 platforms. Suggested-by: Adrian Hunter Signed-off-by: Leo Yan --- tools/perf/builtin-record.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 3337b5f93336..f47e298281f7 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -74,6 +74,7 @@ #include #include #include +#include struct switch_output { bool enabled; @@ -848,6 +849,22 @@ static int record__mmap_evlist(struct record *rec, opts->auxtrace_sample_mode; char msg[512]; +#ifndef __LP64__ + struct utsname uts; + int ret; + + ret = uname(&uts); + if (ret < 0) + return ret; + + if (!strncmp(uts.machine, "x86_64", 6) || !strncmp(uts.machine, "aarch64", 7) || + !strncmp(uts.machine, "arm64", 5)) { + pr_err("Error, 32-bit perf cannot record from a 64-bit kernel.\n" + "Please use a 64-bit version of perf instead.\n"); + return -ENOTSUP; + } +#endif + if (opts->affinity != PERF_AFFINITY_SYS) cpu__setup_cpunode_map(); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel