All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>,
	Andi Kleen <ak@linux.intel.com>,
	linux-perf-users@vger.kernel.org,
	Vince Weaver <vincent.weaver@maine.edu>
Subject: Re: [PATCH] Update perf tools topdown documentation
Date: Wed, 11 Dec 2024 15:47:57 -0500	[thread overview]
Message-ID: <d071b641-b62a-4f9e-8ce3-eacbe77a62a5@linux.intel.com> (raw)
In-Reply-To: <CAP-5=fVx8GukBdDNe0Ckb1oPBVwsG4A4xGvj1s9VARQC4k3Dow@mail.gmail.com>



On 2024-12-11 1:20 p.m., Ian Rogers wrote:
> On Wed, Dec 11, 2024 at 8:07 AM Liang, Kan <kan.liang@linux.intel.com> wrote:
>>> The RDPMC can automatically reset the perf metrics.
>>> Maybe change it to "automatically resetting the perf metrics RDPMC"
>>>
>>
>> The new post can be found at
>> https://lore.kernel.org/lkml/20241211160318.235056-2-kan.liang@linux.intel.com/
>>
>> I also added the reviewed-by in the new patch.
>>
>> Please let me know if there are more comments.
> 
> Hi Kan,
> 
> Vince Weaver posted to the list a related question on topdown + rdpmc + hybrid:
> https://lore.kernel.org/linux-perf-users/b0b0ae91-785e-64f6-348a-ca6edd448b74@maine.edu/
> The topic of being rescheduled isn't part of the rdpmc documentation:
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/include/uapi/linux/perf_event.h?h=perf-tools-next#n610

Maybe we should emphasis that the example in the documentation is only
for p-core.

diff --git a/tools/perf/Documentation/topdown.txt
b/tools/perf/Documentation/topdown.txt
index 44644e917ffd..a229d0043399 100644
--- a/tools/perf/Documentation/topdown.txt
+++ b/tools/perf/Documentation/topdown.txt
@@ -21,14 +21,14 @@ per architecture.
      5.704818971                 14.0                 27.5
    51.3                    7.3
 ...

-New Topdown features in Intel Ice Lake
+New Topdown features in Intel Ice Lake and later p-core
 ======================================

 With Ice Lake CPUs the TopDown metrics are directly available as
 fixed counters and do not require generic counters. This allows
 to collect TopDown always in addition to other events.

-Using TopDown through RDPMC in applications on Intel Ice Lake
+Using TopDown through RDPMC in applications on Intel Ice Lake and later
p-core
 =============================================================

 For more fine grained measurements it can be useful to


> In the testing we're only testing per-task mode and not per-CPU:
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/lib/perf/tests/test-evsel.c?h=perf-tools-next#n145

The event type is hard code to PERF_TYPE_HARDWARE, which is available
for both core. It doesn't matter which core the event is scheduled to.

If you plan to add a topdown event, the PERF_TYPE_RAW should be used,
which is the type for the p-core. If the app is scheduled on an e-core,
the event is disabled.

> It isn't clear to me how per-CPU would work given rescheduling, you
> could read a counter that doesn't match the mmap page unless you pin
> everything to just 1 CPU. Given the issues with rdpmc, perhaps it is
> safer in the documentation to cover cases without it.

As long as the scope of the RDPMC is clearly defined, I think it's OK
to add the usage in the documentation.

Thanks,
Kan


  reply	other threads:[~2024-12-11 20:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 19:35 [PATCH] Update perf tools topdown documentation Andi Kleen
2024-12-11 10:13 ` James Clark
2024-12-11 15:49   ` Liang, Kan
2024-12-11 16:06     ` Liang, Kan
2024-12-11 18:20       ` Ian Rogers
2024-12-11 20:47         ` Liang, Kan [this message]
2024-12-11 15:28 ` Liang, Kan
2024-12-11 17:50 ` Namhyung Kim

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=d071b641-b62a-4f9e-8ce3-eacbe77a62a5@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=vincent.weaver@maine.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.