Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp795454rwr; Thu, 4 May 2023 09:38:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IX9SS3cOQazulWg4VfoY5evmjokrFeo65Ueekz+Ik2bU03i9Z33vQSfMo9PqGKhzaXKvt X-Received: by 2002:a05:6a00:15cb:b0:63b:599b:a2ec with SMTP id o11-20020a056a0015cb00b0063b599ba2ecmr3402313pfu.27.1683218291287; Thu, 04 May 2023 09:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683218291; cv=none; d=google.com; s=arc-20160816; b=LxkldpvhuX5NSzgbtkIDW4Ffp2romX1RjQAfEpo1IR+ducyu/kKR7CCgO3oZ5jYOfE XFXamwCp/v2N73P/BXkXVUT3dW8M1T9I7PZICYm2ZAhC7VxpIoCM2Oe96rNxHXGTZneX MVGInKmY2xk/sjgpsbAbDf7YicB4eoFPyV84aT5eJP8mcHpsmtWmVW5l9aeXRc/tlRO5 K9CnWH0In63O2AbV8Zs7KjQVCvf1fpRD7dH8LriDyDqeXqUbt7K73S1Z0RXIoPMe+zpB f1PAs7nl+yxXI3ycHSAu6ut86FlKT5q7J5F7SpgKubBuju1XSa3lwHnhXixqj2Zq6SND RuNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=AUe4KSjSmgow7pnhbzVMvY+SZibTGhMGiwehv2aVHiY=; b=ASOKUQia4cODtZpTzaJMPviWS6bk7Ur12J/lnIMiE4Lx+ACYeDxFxj9a8troNbGu9O 23Q2qxbr9dgo18t+IVYIHkRTCfzWi+v5oEws2JK5Q0gdc4za0r7AsrEsjJSdHdBddpvG BRvrfgYeNWEUpyJXuR2YgGZth+LyNQd0U0SpO11q/Dcr+mLZ7a41Icik+77tE7UWnPNA hC7OWGTNn43ZP4KzYm4dxYqj6ciLnxtB714OH5sSzMgOWhWsOD0ET1ja6M7adDM5eiOH vot7LHh7wG+nvp2zMLLW4yy6sAmzbipHbsMN+LjGZIP134+jql/iDV+X2++CFXsFoRNY 7Gtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c200-20020a624ed1000000b0063b7b2669absi35348976pfb.130.2023.05.04.09.37.58; Thu, 04 May 2023 09:38:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231267AbjEDQJv (ORCPT + 99 others); Thu, 4 May 2023 12:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbjEDQJt (ORCPT ); Thu, 4 May 2023 12:09:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3F98468D; Thu, 4 May 2023 09:09:47 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0F761FB; Thu, 4 May 2023 09:10:31 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1DBD23F5A1; Thu, 4 May 2023 09:09:45 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org Cc: James Clark , John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf: arm64: Fix build with refcount checking Date: Thu, 4 May 2023 17:08:45 +0100 Message-Id: <20230504160845.2065510-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With EXTRA_CFLAGS=-DREFCNT_CHECKING=1 and build-test, some unwrapped map accesses appear. Wrap it in the new accessor to fix the error: error: 'struct perf_cpu_map' has no member named 'map' Signed-off-by: James Clark --- tools/perf/arch/arm64/util/header.c | 4 ++-- tools/perf/arch/arm64/util/pmu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/arch/arm64/util/header.c b/tools/perf/arch/arm64/util/header.c index d730666ab95d..80b9f6287fe2 100644 --- a/tools/perf/arch/arm64/util/header.c +++ b/tools/perf/arch/arm64/util/header.c @@ -29,8 +29,8 @@ static int _get_cpuid(char *buf, size_t sz, struct perf_cpu_map *cpus) char path[PATH_MAX]; FILE *file; - scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR, - sysfs, cpus->map[cpu]); + scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d" MIDR, + sysfs, RC_CHK_ACCESS(cpus)->map[cpu].cpu); file = fopen(path, "r"); if (!file) { diff --git a/tools/perf/arch/arm64/util/pmu.c b/tools/perf/arch/arm64/util/pmu.c index fa143acb4c8d..ef1ed645097c 100644 --- a/tools/perf/arch/arm64/util/pmu.c +++ b/tools/perf/arch/arm64/util/pmu.c @@ -18,7 +18,7 @@ static struct perf_pmu *pmu__find_core_pmu(void) * The cpumap should cover all CPUs. Otherwise, some CPUs may * not support some events or have different event IDs. */ - if (pmu->cpus->nr != cpu__max_cpu().cpu) + if (RC_CHK_ACCESS(pmu->cpus)->nr != cpu__max_cpu().cpu) return NULL; return pmu; -- 2.34.1