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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7E148C433EF for ; Tue, 11 Jan 2022 15:13:36 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ssBIdfDrtz1MXDTG703tRmV9ap74FYEPY4vuv2Q13xU=; b=pWGup9Rn2bk+2B ENR63nPoZ0BCf5rhW35tZUSTglELNDUqPWTDGTPqpoJcF7c89Zpl5UtTHVgym+LAXTh4FLCK3zItu IbOZ2/42YtM92kFobZKA+prUdibhbZTuzUmiF1qIvAxpLl2Y7YmOyJetqDOokaSP3zEo7yN8tUTFE 7DjnxywZ2wW4wfVYgifAWp0gi58UXteq5COQ9a2TD6wp1FhLA6gqvczJLFvebsDe4jl+jR219H/MJ LPfAloiFk92VbqJ5wWDrek9jiaHhiQkwIo7YcqVFFdr1WuJwUaFtm9rSIxys4K8mq/pGqGTFEMcaf EOWiyXC6qkqsFkG2OBiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Ion-00GgRz-0r; Tue, 11 Jan 2022 15:12:13 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Ioh-00GgRd-LH for linux-arm-kernel@bombadil.infradead.org; Tue, 11 Jan 2022 15:12:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZWVyuICWLCjxGEhlb57YZLA2s2jO0cD/KItUGi9YKTI=; b=ViZ1xVNtHzZgTxePhQuHciGTuJ HmqYLoZxrEhZO61yJKRnYTI6L7A6A0PDmgsrP9flHQYw4s+DV2qbEuamVddUnR7QRU2k8inHMgV6+ s9iplA+/twzgtlq8opYM5ScpiP5DRP6utZBDkAm1GH7UBYIQHH3ZC0PqDOif1RWvYAwXygb3ZexRA sYY5kX7I99hnom17l2Z0v6K8p0oaVduREGMDAf1sWKiRlzpMZc+RLi7k1vL5VPiAtOJNy3wuLULvs UQSdOGTdip01jksC5KJ5KUMLoAiOnZrayKdS+4MpryN8HL/6ROSKHc6mcV06ECgk+uuokUfMCPRQh RnemhP7w==; Received: from [179.97.37.151] (helo=quaco.ghostprotocols.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Iof-000d4i-GS; Tue, 11 Jan 2022 15:12:06 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BA16140714; Tue, 11 Jan 2022 12:12:02 -0300 (-03) Date: Tue, 11 Jan 2022 12:12:02 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Andi Kleen , Jiri Olsa , Namhyung Kim , John Garry , Kajol Jain , "Paul A . Clarke" , Riccardo Mancini , Kan Liang , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh , James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, zhengjun.xing@intel.com, eranian@google.com Subject: Re: [PATCH v3 06/48] perf cpumap: Switch cpu_map__build_map to cpu function Message-ID: References: <20211230072030.302559-1-irogers@google.com> <20211230072030.302559-8-irogers@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com 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 Em Mon, Jan 10, 2022 at 09:41:12PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Jan 10, 2022 at 02:29:58PM -0800, Ian Rogers escreveu: > > On Mon, Jan 10, 2022 at 1:34 PM Arnaldo Carvalho de Melo > > wrote: > > > > > > Em Mon, Jan 10, 2022 at 06:23:09PM -0300, Arnaldo Carvalho de Melo escreveu: > > > > Em Mon, Jan 10, 2022 at 06:03:04PM -0300, Arnaldo Carvalho de Melo escreveu: > > > > > Em Mon, Jan 10, 2022 at 05:46:52PM -0300, Arnaldo Carvalho de Melo escreveu: > > > > > > At this point we need to remove the now unused perf_env__get_cpu(), and > > > > > > then deal with the fallout in the following patches that needlessly > > > > > > modify this unused function. > > > > > > > > > > > > Doing that now. > > > > > > > > > > Done, force pushed to tmp.perf/perf_cpu, now it is going again thru the > > > > > build containers, a better start now: > > > > > > > So far so good: > > > > > > perf test ok, just that one that is failing, but before this series as > > > well: > > > > > > 89: perf all metricgroups test : FAILED! > > > > Could you add the verbose output? I suspect it is fixed by this: > > https://lore.kernel.org/lkml/20211223183948.3423989-1-irogers@google.com/ > > I'll try it. > > BTW, here are the final tests, problems with arm 32 and 64-bit, I'll go thru > them tomorrow, to fix in the cset the problem appears, so that we keep it > bisectable, else you can get what I have in tmp.perf/perf_cpu, fix it and > tomorrow I'll retest. > > 27 85.67 debian:11 : Ok gcc (Debian 10.2.1-6) 10.2.1 20210110 , Debian clang version 11.0.1-2 > 28 98.65 debian:experimental : Ok gcc (Debian 11.2.0-13) 11.2.0 , Debian clang version 13.0.0-9+b2 > 29 8.69 debian:experimental-x-arm64 : FAIL gcc version 11.2.0 (Debian 11.2.0-9) > arch/arm64/util/pmu.c: In function 'pmu_events_map__find': > arch/arm64/util/pmu.c:18:35: error: invalid operands to binary != (have 'int' and 'struct perf_cpu') > 18 | if (pmu->cpus->nr != cpu__max_cpu()) > | ~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~ > | | | > | int struct perf_cpu > make[5]: *** [/git/perf-5.16.0/tools/build/Makefile.build:139: util] Error 2 > make[4]: *** [/git/perf-5.16.0/tools/build/Makefile.build:139: arm64] Error 2 > make[3]: *** [/git/perf-5.16.0/tools/build/Makefile.build:139: arch] Error 2 > 30 19.15 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110 Fixed with the patch below squashed into 48/48 where the problem was introduced. tmp.perf/perf_cpu updated. [perfbuilder@five ~]$ dm debian:experimental-x-arm64 ubuntu:16.04-x-arm ubuntu:16.04-x-arm64 ubuntu:18.04-x-arm ubuntu:18.04-x-arm64 1 26.08 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 11.2.0-9) 11.2.0 2 21.68 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 3 21.53 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 4 61.22 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 5 108.41 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 BUILD_TARBALL_HEAD=5610e6f0b9e64a02dfc906c9db9d18fd198200d9 6 238.918 [perfbuilder@five ~]$ diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 129c0272d65b8596..2e8b2c4365a0003f 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -203,9 +203,11 @@ static int cs_etm_set_option(struct auxtrace_record *itr, struct perf_cpu_map *online_cpus = perf_cpu_map__new(NULL); /* Set option of each CPU we have */ - for (i = 0; i < cpu__max_cpu(); i++) { - if (!perf_cpu_map__has(event_cpus, i) || - !perf_cpu_map__has(online_cpus, i)) + for (i = 0; i < cpu__max_cpu().cpu; i++) { + struct perf_cpu cpu = { .cpu = i, }; + + if (!perf_cpu_map__has(event_cpus, cpu) || + !perf_cpu_map__has(online_cpus, cpu)) continue; if (option & BIT(ETM_OPT_CTXTID)) { @@ -522,9 +524,11 @@ cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused, /* cpu map is not empty, we have specific CPUs to work with */ if (!perf_cpu_map__empty(event_cpus)) { - for (i = 0; i < cpu__max_cpu(); i++) { - if (!perf_cpu_map__has(event_cpus, i) || - !perf_cpu_map__has(online_cpus, i)) + for (i = 0; i < cpu__max_cpu().cpu; i++) { + struct perf_cpu cpu = { .cpu = i, }; + + if (!perf_cpu_map__has(event_cpus, cpu) || + !perf_cpu_map__has(online_cpus, cpu)) continue; if (cs_etm_is_ete(itr, i)) @@ -536,8 +540,10 @@ cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused, } } else { /* get configuration for all CPUs in the system */ - for (i = 0; i < cpu__max_cpu(); i++) { - if (!perf_cpu_map__has(online_cpus, i)) + for (i = 0; i < cpu__max_cpu().cpu; i++) { + struct perf_cpu cpu = { .cpu = i, }; + + if (!perf_cpu_map__has(online_cpus, cpu)) continue; if (cs_etm_is_ete(itr, i)) @@ -722,8 +728,10 @@ static int cs_etm_info_fill(struct auxtrace_record *itr, } else { /* Make sure all specified CPUs are online */ for (i = 0; i < perf_cpu_map__nr(event_cpus); i++) { - if (perf_cpu_map__has(event_cpus, i) && - !perf_cpu_map__has(online_cpus, i)) + struct perf_cpu cpu = { .cpu = i, }; + + if (perf_cpu_map__has(event_cpus, cpu) && + !perf_cpu_map__has(online_cpus, cpu)) return -EINVAL; } @@ -743,9 +751,12 @@ static int cs_etm_info_fill(struct auxtrace_record *itr, offset = CS_ETM_SNAPSHOT + 1; - for (i = 0; i < cpu__max_cpu() && offset < priv_size; i++) - if (perf_cpu_map__has(cpu_map, i)) + for (i = 0; i < cpu__max_cpu().cpu && offset < priv_size; i++) { + struct perf_cpu cpu = { .cpu = i, }; + + if (perf_cpu_map__has(cpu_map, cpu)) cs_etm_get_metadata(i, &offset, itr, info); + } perf_cpu_map__put(online_cpus); diff --git a/tools/perf/arch/arm64/util/pmu.c b/tools/perf/arch/arm64/util/pmu.c index d3a18f9c85f6a731..79124bba713e5f0d 100644 --- a/tools/perf/arch/arm64/util/pmu.c +++ b/tools/perf/arch/arm64/util/pmu.c @@ -15,7 +15,7 @@ const struct pmu_events_map *pmu_events_map__find(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()) + if (pmu->cpus->nr != cpu__max_cpu().cpu) return NULL; return perf_pmu__find_map(pmu); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel