From patchwork Tue Jun 8 14:52:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12307113 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.9 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 374ACC4743E for ; Tue, 8 Jun 2021 14:54:24 +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 02F6661059 for ; Tue, 8 Jun 2021 14:54:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02F6661059 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=HgYtk/PQGnxOgo0n7KpTl6N0hxIvIy/CyAlkm954OYg=; b=r/YEkJglUT6DXQ pgnLl54lscdmuYQ1BRZag4QChN3vSvIZX+HFXLUaGoSTs2a3Luf64LTgoncxuCm+85jQ7vhaxePXI CMn0cGtNWM3/Hs4LFK0daEv9QjqPP+EVjso2cS/vrFf/zXgxi7kCp6WDEMQ60TKp+sPs3XyilVCXF IklTNRJU2Q/TUDHu1fkX/lZFx89udBYC90+UkNmfoIPwdjnw92UGrLgzT9navm/aIoGnrCkFaejdT rCAhFSxVgvllm1HiYn45o8B0ZuqqdOeJgVXYz7SWvRa4ZwD1uA0ywssbeALpGw9Z0/83CSAEXiEwi Krdnk1/SBY95XYESJmGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqd62-00918i-BS; Tue, 08 Jun 2021 14:52:50 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqd5y-00917x-KB for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 14:52:48 +0000 Received: by mail-pf1-x436.google.com with SMTP id m7so2950010pfa.10 for ; Tue, 08 Jun 2021 07:52:45 -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=GjjYvlo6o9qYmuvrmoD8jiP53R/+0wba+qif8TcHjrA=; b=u5mAwC3u3L5IH46vd4ciAayfeQ3nM5sy5exzt+TJQM2OAWL93U9IvLDtrUkohttu9F KvDPwUjzRKCry+ExqTn8qeDxr6nrRdvYoygi01TupNLKCuP7cnjpZzRZK8qiRMi2NRrc 5P4+FnoivbBeUQj8kXjARRI+/Ya6Ezudu/TnVq8xRHXPCLNIFXkNvgK+6WhVQl3qWsbO 3zu+SAOEyiE3b1NUiFn1sOBDKkdYJEcAwRpP0LuMevVh4GeakYKK6TjbGlNDRYoqKbNO GhEoGVdYM3WzA5k8o2hjzKy7CzQ/bVkpWw2hJ53GNm7J9RAywW6VFWshcRWYZ3q+n6ko yQxw== 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=GjjYvlo6o9qYmuvrmoD8jiP53R/+0wba+qif8TcHjrA=; b=XpNbQrde0VTOY3csLcumIe+zKqV8u3HuOwRsEhz7PX3vIC9KsCI9efY87YBfHQnCKQ At1ghZlj0euDFW8EiiJYnqGpJ9JQD25ZP7JDIerIfsf05XDBIXr9sj6YUEQd7dcINTjY eRM7fxJyPP/Ym1s7n+ebpdN94l55tguvX1snp/2zKbQ2gtRpGqpwm7KyZtSSnWYbSWAk vM4cnPnu7j1UXasdSPCJp2X4xC9OZcrNYjz3xt1aRQZdPRDfhXbqGzAHr0ITlOIZayi6 vLB8S2z9cUoiVfLt6eIwjUY/JpAnolG9sUK0zriRgk7+z61FW4lDN+KLP5/U3nK6DHqX PPzA== X-Gm-Message-State: AOAM530ri5EcKtOof6OT37nfoH3kHR34/+4YKHGx8ubk7ntTJ1RHrnhY AxXRjTSNN+VoTwDCUvF07Mrjhg== X-Google-Smtp-Source: ABdhPJys2rCAqYVEXhJeccvB2e2xd98ttYnH2gIKxpWEHJqhce3k27GEFOHEg/jAY1/ItRpj2TDPoA== X-Received: by 2002:a63:b30a:: with SMTP id i10mr22916323pgf.306.1623163965453; Tue, 08 Jun 2021 07:52:45 -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 r5sm2793644pjd.2.2021.06.08.07.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 07:52:45 -0700 (PDT) From: Leo Yan To: Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 2/2] arm64: perf: Report error if PMU fails to support current CPU Date: Tue, 8 Jun 2021 22:52:28 +0800 Message-Id: <20210608145228.36595-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210608145228.36595-1-leo.yan@linaro.org> References: <20210608145228.36595-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-20210608_075246_683465_0C0A59E1 X-CRM114-Status: GOOD ( 17.94 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When run perf command on the Arm big.LITTLE system (Juno-r2 board): perf record -e cycles --per-thread program The command executes normally without any errors; but when report the result with "perf report", it fails to parse the symbols. This is because the perf data file doesn't contain MMAP2 events, thus it cannot find the correct object file for parsing symbols. On the big.LITTLE system, if the initialized PMU doesn't match with the CPU the profiled task is scheduled on; for example, the initialized PMU is on CPU0 in the LITTLE cluster, when invoke the function perf_event_mmap_event() on CPU2 in the big cluster, the event is always filtered out due to the CPU2 is not supported by the initialized PMU. Finally, there have no any MMAP2 samples are generated for the profiling. This patch doesn't fix for this issue, alternatively, it simply reports an error when detect the current CPU is not supported by PMU, so can remind the user for the abnormal situation. Signed-off-by: Leo Yan --- drivers/perf/arm_pmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index aedea060ca8b..99ddc8bf6466 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -565,6 +565,9 @@ static int armpmu_filter_match(struct perf_event *event) int ret; ret = cpumask_test_cpu(cpu, &armpmu->supported_cpus); + if (!ret) + pr_err("PMU doesn't support current CPU %d\n", cpu); + if (ret && armpmu->filter_match) return armpmu->filter_match(event);