Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2469782pxb; Fri, 8 Oct 2021 08:25:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3Ys9J6vybjAdig4BZw2xOTrW+HhkC0uu0iTaZOm+tgTcLZjFkc+Pc3wxjHzqAVC0Tkaaz X-Received: by 2002:a17:907:7388:: with SMTP id er8mr5091679ejc.324.1633706747605; Fri, 08 Oct 2021 08:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633706747; cv=none; d=google.com; s=arc-20160816; b=zX5mdYswPIpNiYVbuWDy7S0snJWeSI9SmyEzf7ausoeKzwyx3v9IQXNUJ4eWY7Xg5f Qs71+Gn5GFBpl9XJjuBENvs24bL8+Emlt7ACELpYR/TAk+lWWa3FmSWPip9Mha7VNWpr ga1UKVjVGDFfMusoKyG7GqJbDx5vGeW8T99sdSXkR0Xf8FGySfUEvYka1Gexzo6MFQ+e agVb/c5YNbK8LcyIOJrV9khEAyshEeGvHPQ4eCnJ/quR3h/wZtidt13eaDFcb7s5s3rY cYkHqJRc7Wxhk4rZ20pvjy/lg4q8JUvqIyVCKJ4Kl2OUAcnxLzzxUBVQpYJe6mxFOJsK k1hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=wK/uPfWWf31CLeB4vG+SCfzOwOGXINreDU7syrB044U=; b=vdwuHbECE2nMcM0QU6yAg1O1yXL5LpqgZ3ZJEnxhzVsF4vPBjq9qnNgMU5B+mNRw6Z krNyo4JYvpzoL3mqE1BgkNc8KnW6UmFL4++IH0SdgaWVZgu8HxKYsvBTjYxJjkK9jBnr 2eWkxzxgwUnX5DOs65xN+AYPcsXasEMjvQczq2gCGDj+LPwMgg8eS0NaFB4aD6Y+9usK ktWJnwYV7d2Cq0AwIj15/0Ioj+Nj1JOyzkZFIaUYBktoJEdw1Zn+RnEQ7d8jb6Kbzw0q +/zv+SFuLfq4g58cLxB0PrnTWVFgphFKrLQtnNldaOOThL/4Vdnozb8Psk/fW/UY8aXd dHgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e11si5938581edz.42.2021.10.08.08.25.23; Fri, 08 Oct 2021 08:25:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S242910AbhJHPY6 (ORCPT + 99 others); Fri, 8 Oct 2021 11:24:58 -0400 Received: from foss.arm.com ([217.140.110.172]:58712 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242780AbhJHPY4 (ORCPT ); Fri, 8 Oct 2021 11:24:56 -0400 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 C30131063; Fri, 8 Oct 2021 08:23:00 -0700 (PDT) Received: from [10.1.25.132] (e124483.cambridge.arm.com [10.1.25.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F00613F66F; Fri, 8 Oct 2021 08:22:52 -0700 (PDT) Message-ID: <90460425-a987-2f18-ba9c-f064af5fb941@arm.com> Date: Fri, 8 Oct 2021 16:22:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 02/21] perf pmu: Add const to pmu_events_map. Content-Language: en-US To: John Garry , Ian Rogers , Andi Kleen , Jiri Olsa , Jin Yao , Namhyung Kim , Kajol Jain , "Paul A . Clarke" , Arnaldo Carvalho de Melo , Riccardo Mancini , Kan Liang , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Kees Cook , Sami Tolvanen , Nick Desaulniers , Andrew Morton , Jacob Keller , Zhen Lei , ToastC , Joakim Zhang , Felix Fietkau , Jiapeng Chong , Song Liu , Fabian Hemmer , Alexander Antonov , Nicholas Fraser , Adrian Hunter , Denys Zagorui , Wan Jiabing , Thomas Richter , Sumanth Korikkar , Heiko Carstens , Changbin Du , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Stephane Eranian References: <20211007165647.3514803-1-irogers@google.com> <20211007165647.3514803-3-irogers@google.com> From: Andrew Kilroy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/2021 12:01, John Garry wrote: > On 07/10/2021 17:56, Ian Rogers wrote: >> The pmu_events_map is generated at compile time and used for lookup. For >> testing purposes we need to swap the map being used. Having the >> pmu_events_map be non-const is misleading as it may be an out argument. >> Make it const and update uses so they work on const too. >> >> Signed-off-by: Ian Rogers > > Reviewed-by: John Garry Got a compile error for this on arm64 when basing these patches on acme/perf/core (be8ecc57f180415e8a7c1cc5620c5236be2a7e56): $ make DEBUG=1 O=output ...... arch/arm64/util/pmu.c:6:24: error: conflicting types for ‘pmu_events_map__find’ struct pmu_events_map *pmu_events_map__find(void) ^~~~~~~~~~~~~~~~~~~~ In file included from arch/arm64/util/pmu.c:4:0: arch/arm64/util/../../../util/pmu.h:126:30: note: previous declaration of ‘pmu_events_map__find’ was here const struct pmu_events_map *pmu_events_map__find(void); ^~~~~~~~~~~~~~~~~~~~ arch/arm64/util/pmu.c: In function ‘pmu_events_map__find’: arch/arm64/util/pmu.c:21:10: error: return discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] return perf_pmu__find_map(pmu); ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors /home/andkil01/linux/tools/build/Makefile.build:96: recipe for target '/home/andkil01/linux/tools/perf/output/arch/arm64/util/pmu.o' failed make[6]: *** [/home/andkil01/linux/tools/perf/output/arch/arm64/util/pmu.o] Error 1 /home/andkil01/linux/tools/build/Makefile.build:139: recipe for target 'util' failed make[5]: *** [util] Error 2 /home/andkil01/linux/tools/build/Makefile.build:139: recipe for target 'arm64' failed make[4]: *** [arm64] Error 2 /home/andkil01/linux/tools/build/Makefile.build:139: recipe for target 'arch' failed make[3]: *** [arch] Error 2 make[3]: *** Waiting for unfinished jobs.... Andrew