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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA28EC77B7D for ; Wed, 10 May 2023 17:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229447AbjEJRkF (ORCPT ); Wed, 10 May 2023 13:40:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235768AbjEJRjx (ORCPT ); Wed, 10 May 2023 13:39:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B63A03ABA; Wed, 10 May 2023 10:39:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4FC2F649C9; Wed, 10 May 2023 17:39:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E89CC433D2; Wed, 10 May 2023 17:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683740391; bh=L3QJRNGmXorOk4+D2bi74+pF6hHWPHZgyaNTHM83eTM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fohov/Oh2SFwh26blqbfeQghhlrVcSiPP2cTXcjuw4PkIe9o3mhAHaVEYKOzqFaDE X/6TV/42xXKoYE4KIS45fxySEnjXu6uQnXdL2ndjy6ZGKSrQqhD7hX1uray/pn4NgA vcPJG6/Dgcog8bbstNS6NnKR/FXgrp9jqhgY16QG44BkmL+H4zW0srEjY37mLGnHso UmQvpXGrKeGSHK+jgD+GpwvFlsihOup2O+vMnTHHVuw8KJDE4DQsyeKdeipqftNdbm 2KFSf/fqGXSr69S9Y3PsZowDSO+ct62qFZkPwf16fK8ySv3pcaUaY/IOuXexhZJohl 8LEKaBBG5236Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id F2543403B5; Wed, 10 May 2023 14:39:48 -0300 (-03) Date: Wed, 10 May 2023 14:39:48 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: James Clark , linux-perf-users@vger.kernel.org, John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: arm64: Fix build with refcount checking Message-ID: References: <20230504160845.2065510-1-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Thu, May 04, 2023 at 09:28:21AM -0700, Ian Rogers escreveu: > On Thu, May 4, 2023 at 9:09 AM James Clark wrote: > > > > 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 > > Thanks James and sorry for the breakage! > Acked-by: Ian Rogers Thanks, applied. - Arnaldo > Ian > > > --- > > 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 > > -- - Arnaldo