public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: Ian Rogers <irogers@google.com>
Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org,
	mark.rutland@arm.com, peterz@infradead.org,
	adrian.hunter@intel.com, kan.liang@linux.intel.com,
	james.clark@arm.com, alisaidi@amazon.com, leo.yan@linaro.org,
	maddy@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,
	Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [PATCH 3/4] perf mem amd: Fix perf_pmus__num_mem_pmus()
Date: Wed, 14 Jun 2023 09:19:59 +0530	[thread overview]
Message-ID: <72e58cc7-acde-600d-b9a1-b89d9d8a168b@amd.com> (raw)
In-Reply-To: <CAP-5=fW0R2Dkwvw0twdzL5GrLy6jy0CXmFHYCsZtC8UQnZ4mVQ@mail.gmail.com>

>> +int perf_pmus__num_mem_pmus(void)
>> +{
>> +       /*
>> +        * AMD does not have hybrid cores and also uses IBS OP
>> +        * pmu for perf mem/c2c.
>> +        */
>> +       if (x86__is_amd_cpu())
>> +               return 1;
> 
> The code and comment seem out of sync here. For the hybrid part
> perf_pmus__num_core_pmus() will yield 1 if there is no hybrid, so we
> can just use perf_pmus__num_core_pmus(). For the IBS OP part, does
> that mean that AMD should have 2 mem pmus? Or is IBS OP a core PMU?

Sure. Let me remove hybrid part from the comment.

There are two IBS pmus: ibs_fetch// and ibs_op//. Both of them are
independent of the core pmu (cpu//). An instance of all 3 pmus is
present in each hw SMT thread. And, perf mem/c2c internally uses
ibs_op// pmu on AMD. See tools/perf/arch/x86/util/mem-events.c

  static struct perf_mem_event perf_mem_events_amd[PERF_MEM_EVENTS__MAX] = {
          E(NULL,         NULL,           NULL),
          E(NULL,         NULL,           NULL),
          E("mem-ldst",   "ibs_op//",     "ibs_op"),
  };

Hope this clarifies.

> Can we add this as an example in the core/other documentation in patch
> 1, as you've done for ARM, for clarity.

Sure. Let me also add IBS example in the patch #1 comment.

Thanks,
Ravi

  reply	other threads:[~2023-06-14  3:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  9:55 [PATCH 0/4] perf mem amd: Fix few logic bugs Ravi Bangoria
2023-06-13  9:55 ` [PATCH 1/4] perf pmus: Describe semantics of 'core_pmus' and 'other_pmus' Ravi Bangoria
2023-06-13  9:55 ` [PATCH 2/4] perf tool x86: Consolidate is_amd check into single function Ravi Bangoria
2023-06-13 19:49   ` Arnaldo Carvalho de Melo
2023-06-13 19:49   ` Ian Rogers
2023-06-13 20:28     ` Arnaldo Carvalho de Melo
2023-06-13  9:55 ` [PATCH 3/4] perf mem amd: Fix perf_pmus__num_mem_pmus() Ravi Bangoria
2023-06-13 15:25   ` Ian Rogers
2023-06-14  3:49     ` Ravi Bangoria [this message]
2023-06-13  9:55 ` [PATCH 4/4] perf mem amd: Scan all PMUs instead of just core ones Ravi Bangoria
2023-06-13 15:34   ` Ian Rogers
2023-06-14  3:58     ` Ravi Bangoria

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=72e58cc7-acde-600d-b9a1-b89d9d8a168b@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=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=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.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