From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: irogers@google.com, jolsa@kernel.org, namhyung@kernel.org,
peterz@infradead.org, james.clark@arm.com, alisaidi@amazon.com,
leo.yan@linaro.org, adrian.hunter@intel.com,
kan.liang@linux.intel.com, mark.rutland@arm.com,
maddy@linux.ibm.com, tmricht@linux.ibm.com,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
sandipan.das@amd.com, ananth.narayan@amd.com,
santosh.shukla@amd.com
Subject: Re: [PATCH v2.1 2/3] perf mem amd: Fix perf_pmus__num_mem_pmus()
Date: Fri, 16 Jun 2023 10:59:52 -0300 [thread overview]
Message-ID: <ZIxq2FBX+qBoYIRv@kernel.org> (raw)
In-Reply-To: <20230615061238.2042-1-ravi.bangoria@amd.com>
Em Thu, Jun 15, 2023 at 11:42:38AM +0530, Ravi Bangoria escreveu:
> perf mem/c2c on AMD internally uses IBS OP PMU, not the core PMU. Also,
> AMD platforms does not have heterogeneous PMUs.
Thanks, applied the series.
- Arnaldo
> Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
> ---
> tools/perf/arch/x86/util/pmu.c | 12 ++++++++++++
> tools/perf/util/pmus.c | 2 +-
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c
> index 3c0de3370d7e..65d8cdff4d5f 100644
> --- a/tools/perf/arch/x86/util/pmu.c
> +++ b/tools/perf/arch/x86/util/pmu.c
> @@ -14,6 +14,8 @@
> #include "../../../util/intel-bts.h"
> #include "../../../util/pmu.h"
> #include "../../../util/fncache.h"
> +#include "../../../util/pmus.h"
> +#include "env.h"
>
> struct pmu_alias {
> char *name;
> @@ -168,3 +170,13 @@ char *pmu_find_alias_name(const char *name)
>
> return __pmu_find_alias_name(name);
> }
> +
> +int perf_pmus__num_mem_pmus(void)
> +{
> + /* AMD uses IBS OP pmu and not a core PMU for perf mem/c2c */
> + if (x86__is_amd_cpu())
> + return 1;
> +
> + /* Intel uses core pmus for perf mem/c2c */
> + return perf_pmus__num_core_pmus();
> +}
> diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
> index 8c50ab8894b7..a2032c1b7644 100644
> --- a/tools/perf/util/pmus.c
> +++ b/tools/perf/util/pmus.c
> @@ -242,7 +242,7 @@ const struct perf_pmu *perf_pmus__pmu_for_pmu_filter(const char *str)
> return NULL;
> }
>
> -int perf_pmus__num_mem_pmus(void)
> +int __weak perf_pmus__num_mem_pmus(void)
> {
> /* All core PMUs are for mem events. */
> return perf_pmus__num_core_pmus();
> --
> 2.40.1
>
--
- Arnaldo
next prev parent reply other threads:[~2023-06-16 14:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 5:16 [PATCH v2 0/3] perf mem amd: Fix few logic bugs Ravi Bangoria
2023-06-15 5:16 ` [PATCH v2 1/3] perf pmus: Describe semantics of 'core_pmus' and 'other_pmus' Ravi Bangoria
2023-06-15 5:16 ` [PATCH v2 2/3] perf mem amd: Fix perf_pmus__num_mem_pmus() Ravi Bangoria
2023-06-15 6:02 ` Ian Rogers
2023-06-15 6:03 ` Ravi Bangoria
2023-06-15 6:12 ` [PATCH v2.1 " Ravi Bangoria
2023-06-16 13:59 ` Arnaldo Carvalho de Melo [this message]
2023-06-15 5:17 ` [PATCH v2 3/3] perf mem: Scan all PMUs instead of just core ones Ravi Bangoria
2023-06-15 6:03 ` [PATCH v2 0/3] perf mem amd: Fix few logic bugs Ian Rogers
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=ZIxq2FBX+qBoYIRv@kernel.org \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alisaidi@amazon.com \
--cc=ananth.narayan@amd.com \
--cc=irogers@google.com \
--cc=james.clark@arm.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mark.rutland@arm.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=sandipan.das@amd.com \
--cc=santosh.shukla@amd.com \
--cc=tmricht@linux.ibm.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