[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fVYmUvYawOBtUc_-PVzsTQhpOuMx4wxA7bHjwaZejii8Q@mail.gmail.com>
Date: Fri, 28 Jun 2024 11:28:17 -0700
From: Ian Rogers <irogers@...gle.com>
To: "Mi, Dapeng" <dapeng1.mi@...ux.intel.com>
Cc: "Liang, Kan" <kan.liang@...ux.intel.com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, Dapeng Mi <dapeng1.mi@...el.com>
Subject: Re: [PATCH] perf topdown: Correct leader selection with sample_read enabled
On Thu, Jun 27, 2024 at 11:17 PM Mi, Dapeng <dapeng1.mi@...ux.intel.com> wrote:
> On 6/27/2024 11:11 PM, Liang, Kan wrote:
> > On 2024-06-14 5:39 p.m., Dapeng Mi wrote:
> >
> > Besides, we need a test for the sampling read as well.
> > Ian has provided a very good base. Please add a topdown sampling read
> > case on top of it as well.
> > https://lore.kernel.org/lkml/CAP-5=fUkg-cAXTb+3wbFOQCfdXgpQeZw40XHjfrNFbnBD=NMXg@mail.gmail.com/
>
> Sure. I would look at it and add a test case.
Thanks Dapeng and thanks Kan too! I wonder if we can do a regular
counter and a leader sample counter then compare the counts are
reasonably consistent. Something like this:
```
$ perf stat -e instructions perf test -w noploop
Performance counter stats for '/tmp/perf/perf test -w noploop':
25,779,785,496 instructions
1.008047696 seconds time elapsed
1.003754000 seconds user
0.003999000 seconds sys
```
```
cat << "_end_of_file_" > a.py
last_count = None
def process_event(param_dict):
if ("ev_name" in param_dict and "sample" in param_dict and
param_dict["ev_name"] == "instructions"):
sample = param_dict["sample"]
if "values" in sample:
global last_count
last_count = sample["values"][1][1]
def trace_end():
global last_count
print(last_count)
_end_of_file_
$ sudo perf record -o - -e "{cycles,instructions}:S" perf test -w
noploop|perf script -i - -s ./a.py
[ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.459 MB - ]
22195356100
```
I didn't see a simpler way to get count and I don't think it is right.
There's some similar perf script checking of data in
tools/perf/tests/shell/test_intel_pt.sh.
Thanks,
Ian
Powered by blists - more mailing lists