Re: [PATCH v6 4/5] perf: CXL Performance Monitoring Unit driver

From: Jonathan Cameron
Date: Fri May 26 2023 - 05:24:39 EST


On Thu, 25 May 2023 18:18:55 -0700
Stephane Eranian <eranian@xxxxxxxxxx> wrote:

> On Thu, May 25, 2023 at 6:06 PM Namhyung Kim <namhyung@xxxxxxxxx> wrote:
> >
> > Add Stephane to CC.
> >
> > On Thu, Apr 13, 2023 at 7:35 AM Jonathan Cameron
> > <Jonathan.Cameron@xxxxxxxxxx> wrote:
> > >
> > > CXL rev 3.0 introduces a standard performance monitoring hardware
> > > block to CXL. Instances are discovered using CXL Register Locator DVSEC
> > > entries. Each CXL component may have multiple PMUs.
> > >
> > > This initial driver supports a subset of types of counter.
> > > It supports counters that are either fixed or configurable, but requires
> > > that they support the ability to freeze and write value whilst frozen.
> > >
> > > Development done with QEMU model which will be posted shortly.
> > >
> > > Example:
> > >
> > > $ perf stat -e cxl_pmu_mem0.0/h2d_req_snpcur/ -e cpmu0/h2d_req_snpdata/ -e cpmu0/clock_ticks/ sleep 1
> > >
> > > Performance counter stats for 'system wide':
> > >
>
> Unless I am mistaken, I don't think this output corresponds to the
> cmdline above. I think the -a is missing.
> I don't think you can measure CXL traffic per-thread. Please confirm.
> Thanks.

It doesn't seem to make any difference whether I include -a or not and
the perf man page says

-a, --all-cpus
system-wide collection from all CPUs (default if no target is
specified)

However I'm not sure what target means in this case as there is no
mention of it anywhere else in the perf-stat man page. My guess is thread
or process provided by -p or -t. So default applies in the above command line.
Doesn't hurt to be more explicit though, so I've added -a.

The command line is wrong however as I failed to update the device name
for the 2nd and 3rd events.


>
> >
> > > 96,757,023,244,321 cxl_pmu_mem0.0/h2d_req_snpcur/
> > > 96,757,023,244,365 cxl_pmu_mem0.0/h2d_req_snpdata/
> > > 193,514,046,488,653 cxl_pmu_mem0.0/clock_ticks/
> > >
> > > 1.090539600 seconds time elapsed