linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yicong Yang <yangyicong@huawei.com>
To: Ian Rogers <irogers@google.com>
Cc: yangyicong@hisilicon.com, "Xu Yang" <xu.yang_2@nxp.com>,
	"John Garry" <john.g.garry@oracle.com>,
	"Will Deacon" <will@kernel.org>,
	"James Clark" <james.clark@linaro.org>,
	"Mike Leach" <mike.leach@linaro.org>,
	"Leo Yan" <leo.yan@linux.dev>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Kan Liang" <kan.liang@linux.intel.com>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Bibo Mao" <maobibo@loongson.cn>,
	"Athira Rajeev" <atrajeev@linux.vnet.ibm.com>,
	"Ben Zong-You Xie" <ben717@andestech.com>,
	"Alexandre Ghiti" <alexghiti@rivosinc.com>,
	"Sandipan Das" <sandipan.das@amd.com>,
	"Benjamin Gray" <bgray@linux.ibm.com>,
	"Ravi Bangoria" <ravi.bangoria@amd.com>,
	"Clément Le Goffic" <clement.legoffic@foss.st.com>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	"Dima Kogan" <dima@secretsauce.net>,
	"Dr. David Alan Gilbert" <linux@treblig.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org,
	"Junhao He" <hejunhao3@huawei.com>
Subject: Re: [PATCH v2 8/8] perf pmu: Move pmu_metrics_table__find and remove ARM override
Date: Mon, 11 Nov 2024 16:39:09 +0800	[thread overview]
Message-ID: <e8603b0c-86db-c258-179a-f228c43ebf0b@huawei.com> (raw)
In-Reply-To: <CAP-5=fWw04Qi+3=y7M4uMrhgrFWpnF7mZ09yb4v0P0qFT1Gfnw@mail.gmail.com>

On 2024/11/10 0:10, Ian Rogers wrote:
> On Sat, Nov 9, 2024 at 2:54 AM Yicong Yang <yangyicong@huawei.com> wrote:
>>
>> Hi,
>>
>> On 2024/11/8 0:20, Ian Rogers wrote:
>>> Move pmu_metrics_table__find to the jevents.py generated pmu-events.c
>>> and remove indirection override for ARM. The movement removes
>>> perf_pmu__find_metrics_table that exists to enable the ARM
>>> override. The ARM override isn't necessary as just the CPUID, not PMU,
>>> is used in the metric table lookup. On non-ARM the CPU argument is
>>> just ignored for the CPUID, for ARM -1 is passed so that the CPUID for
>>> the first logical CPU is read.
>>
>> Since the logic here's already been touching, is it possible to step it further to just
>> ignore the CPUID matching when finding the system metrics/events tables? It's may not be
>> that reasonable for finding a system metrics/events from the CPUID, since one system PMU may
>> exists on different platforms with different CPU types.
> 
> The issue is for conciseness reasons we let metrics and metric
> thresholds refer to other metrics, for example:
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/pmu-events/arch/x86/icelakex/icx-metrics.json#n78
> ```
>     {
>         "BriefDescription": "This category represents fraction of
> slots where no uops are being delivered due to a lack of required
> resources for accepting new uops in the Backend",
>         "MetricExpr": "topdown\\-be\\-bound / (topdown\\-fe\\-bound +
> topdown\\-bad\\-spec + topdown\\-retiring + topdown\\-be\\-bound) + 5
> * cpu@INT_MISC.RECOVERY_CYCLES\\,cmask\\=1\\,edge@ / tma_info_slots",
>         "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",
>         "MetricName": "tma_backend_bound",
>         "MetricThreshold": "tma_backend_bound > 0.2",
>         "MetricgroupNoGroup": "TopdownL1",
>         "PublicDescription": "This category represents fraction of
> slots where no uops are being delivered due to a lack of required
> resources for accepting new uops in the Backend. Backend is the
> portion of the processor core where the out-of-order scheduler
> dispatches ready uops into their respective execution units; and once
> completed these uops get retired according to program order. For
> example; stalls due to data-cache misses or stalls due to the divider
> unit being overloaded are both categorized under Backend Bound.
> Backend Bound is further divided into two main categories: Memory
> Bound and Core Bound. Sample with: TOPDOWN.BACKEND_BOUND_SLOTS",
>         "ScaleUnit": "100%"
>     },
> ```
> 
> The system metrics were added on top of this and we never rethought
> the design. For a metric to refer to another metric there needs to be
> some kind of place we look up from and for that we use the CPUID
> associated table. Perhaps the easiest thing is that if no CPUID table
> is matched we have an empty table.
> 

thanks for the clarificaiton. ok then it's different from my problem and I
shouldn't have mixed them up.

Thanks.

  reply	other threads:[~2024-11-11  8:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 16:20 [PATCH v2 0/8] Refactor cpuid and metric table lookup code Ian Rogers
2024-11-07 16:20 ` [PATCH v2 1/8] perf jevents: fix breakage when do perf stat on system metric Ian Rogers
2024-11-07 16:20 ` [PATCH v2 2/8] perf header: Move is_cpu_online to numa bench Ian Rogers
2024-11-07 16:20 ` [PATCH v2 3/8] perf header: Refactor get_cpuid to take a CPU for ARM Ian Rogers
2024-11-07 16:20 ` [PATCH v2 4/8] perf arm64 header: Use cpu argument in get_cpuid Ian Rogers
2024-11-07 16:20 ` [PATCH v2 5/8] perf header: Avoid transitive PMU includes Ian Rogers
2024-11-07 16:20 ` [PATCH v2 6/8] perf header: Pass a perf_cpu rather than a PMU to get_cpuid_str Ian Rogers
2024-11-07 16:20 ` [PATCH v2 7/8] perf jevents: Add map_for_cpu Ian Rogers
2024-11-07 16:20 ` [PATCH v2 8/8] perf pmu: Move pmu_metrics_table__find and remove ARM override Ian Rogers
2024-11-09 10:54   ` Yicong Yang
2024-11-09 16:10     ` Ian Rogers
2024-11-11  8:39       ` Yicong Yang [this message]
2024-11-08  2:55 ` [PATCH v2 0/8] Refactor cpuid and metric table lookup code Xu Yang
2024-11-14 18:31   ` Ian Rogers
2024-11-15 15:35 ` James Clark
2024-11-15 15:43   ` Arnaldo Carvalho de Melo
2024-11-16 19:47     ` Arnaldo Carvalho de Melo
2024-12-11 22:32 ` patchwork-bot+linux-riscv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8603b0c-86db-c258-179a-f228c43ebf0b@huawei.com \
    --to=yangyicong@huawei.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=ben717@andestech.com \
    --cc=bgray@linux.ibm.com \
    --cc=chenhuacai@kernel.org \
    --cc=clement.legoffic@foss.st.com \
    --cc=dima@secretsauce.net \
    --cc=hejunhao3@huawei.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@treblig.org \
    --cc=maobibo@loongson.cn \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=sandipan.das@amd.com \
    --cc=will@kernel.org \
    --cc=xu.yang_2@nxp.com \
    --cc=yangyicong@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).