Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2773390rwo; Mon, 24 Jul 2023 00:35:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHg6tvO2byPcYrk8w+/zAu2uH1QSaM3QBoUHc4/3lulGWzzxee20GYLjmnXsTY6CenyF0ek X-Received: by 2002:aa7:c592:0:b0:522:ee2:939e with SMTP id g18-20020aa7c592000000b005220ee2939emr5350501edq.2.1690184114563; Mon, 24 Jul 2023 00:35:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690184114; cv=none; d=google.com; s=arc-20160816; b=iwQVQT69krpO7rAuD4g86dUb4Dmu9NdzW1RBApB/F1xXo79nuWVtPEkJkfLmyYUxDJ Kbf4TBmuPq7Joxka0SenK/67McZXeLJ3idGYf15V05BhzHXKfgPN7QqWUC61moawFTug v7UIiHI9j4aiZvlsCG8MZJM0fAUnVQTdMAZdejSNHDUy2HCHuAIAW94gPzmpbKikX10d EpE83aV4kMKiwL+kH2kXxa9eKslKRsK+74SItUarV0O73BFa/in1dyhfazFcU/j8Y70z cvmBfJcoRbi7MVSGGyBqjCjQepGk5Uo15dm4zvIGzqh31xNNr7RJk396n1VlZ1lnoexd vc9Q== 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:to:content-language:subject:user-agent:mime-version:date :message-id; bh=MJ9x7+AaNT5BQB3Zf1/KETb1+HJxZS7GldIl0I8bcYU=; fh=ttnrphGhPA9KlHUrDw0E5KLCZCaZdRPwQHrHDJwskpU=; b=nZJ1KjnB+fjKa3MuRqwuYvrtJO3jzYninXEOwOiihvoK5z/U9ekQ+3Syob+FvbhCqq gDjdA1oCkGdlqKxPR3JzEEtNLhM1F9FmXj/A8UlSvLuKOhrLispF9lncRXE0Vgf3J50F 0d/BkXaLW+W2vjyFC7CrhfaE8CVpSLhU1fwG3IjDcN2Fot85Suzz6VrNHhuNfCjbdY1W i0+39y2PPIbqKrc6jBRKVLLIVfnZA//JjT4HcfY4EAdIFd/DfUUsHuahkOmRkIugY4gL GtSvssbXVVL0gukr35dChMiMj4X6lU+hQvAneO1YOfEaG8OCLLpycLvSWHoFlwCmNybM OXxw== 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 f5-20020a056402150500b00522307b6ff7si751798edw.428.2023.07.24.00.34.47; Mon, 24 Jul 2023 00:35:14 -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 S230162AbjGXG5s (ORCPT + 99 others); Mon, 24 Jul 2023 02:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbjGXG5p (ORCPT ); Mon, 24 Jul 2023 02:57:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 95EDAE55; Sun, 23 Jul 2023 23:57:42 -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 AB63BDE0; Sun, 23 Jul 2023 23:58:24 -0700 (PDT) Received: from [10.162.41.7] (a077893.blr.arm.com [10.162.41.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 25C8D3F67D; Sun, 23 Jul 2023 23:57:33 -0700 (PDT) Message-ID: Date: Mon, 24 Jul 2023 12:27:31 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v1 3/3] perf arm-spe: Support data source for Cortex-X4 CPU Content-Language: en-US To: Leo Yan , Arnaldo Carvalho de Melo , Catalin Marinas , Will Deacon , John Garry , James Clark , Mike Leach , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , D Scott Phillips , Marc Zyngier , German Gomez , Ali Saidi , Jing Zhang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, fissure2010@gmail.com References: <20230717054327.79815-1-leo.yan@linaro.org> <20230717054327.79815-4-leo.yan@linaro.org> From: Anshuman Khandual In-Reply-To: <20230717054327.79815-4-leo.yan@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 7/17/23 11:13, Leo Yan wrote: > We have a CPU list to maintain Neoverse CPUs (N1/N2/V2), this list is > used for parsing data source packet. Since Cortex-x4 CPU shares the > same data source format with Neoverse CPUs, this commit adds Cortex-x4 > CPU into the CPU list so we can reuse the parsing logic. > > The CPU list was assumed for only Neoverse CPUs, but now Cortex-X4 has > been added into the list. To avoid Neoverse specific naming, this patch > renames the variables and function as the default data source format. > > Signed-off-by: Leo Yan > --- > tools/perf/util/arm-spe.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c > index afbd5869f6bf..c2cdb9f2e188 100644 > --- a/tools/perf/util/arm-spe.c > +++ b/tools/perf/util/arm-spe.c > @@ -409,15 +409,16 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq, > return arm_spe_deliver_synth_event(spe, speq, event, &sample); > } > > -static const struct midr_range neoverse_spe[] = { > +static const struct midr_range cpus_use_default_data_src[] = { Is not 'cpus_use_default_data_src' too long ? 'use' could be dropped ? > MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1), > MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), > MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_X4), > {}, > }; > > -static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *record, > - union perf_mem_data_src *data_src) > +static void arm_spe__synth_data_source_default(const struct arm_spe_record *record, > + union perf_mem_data_src *data_src) > { > /* > * Even though four levels of cache hierarchy are possible, no known > @@ -518,7 +519,8 @@ static void arm_spe__synth_data_source_generic(const struct arm_spe_record *reco > static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 midr) > { > union perf_mem_data_src data_src = { .mem_op = PERF_MEM_OP_NA }; > - bool is_neoverse = is_midr_in_range_list(midr, neoverse_spe); > + bool is_default_dc = _dc stands for ? > + is_midr_in_range_list(midr, cpus_use_default_data_src); > > if (record->op & ARM_SPE_OP_LD) > data_src.mem_op = PERF_MEM_OP_LOAD; > @@ -527,8 +529,8 @@ static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 m > else > return 0; > > - if (is_neoverse) > - arm_spe__synth_data_source_neoverse(record, &data_src); > + if (is_default_dc) > + arm_spe__synth_data_source_default(record, &data_src); > else > arm_spe__synth_data_source_generic(record, &data_src); >