[PATCH v2 0/6] Add support for sysfs event.cpus and cpu event term

Ian Rogers posted 6 patches 1 year, 5 months ago
.../sysfs-bus-event_source-devices-events     |  14 ++
tools/lib/perf/cpumap.c                       |  10 ++
tools/lib/perf/include/perf/cpumap.h          |   2 +
tools/perf/Documentation/perf-list.txt        |   9 +
tools/perf/util/evsel_config.h                |   1 +
tools/perf/util/parse-events.c                | 162 ++++++++++++------
tools/perf/util/parse-events.h                |   3 +-
tools/perf/util/parse-events.l                |   1 +
tools/perf/util/pmu.c                         |  92 +++++++---
tools/perf/util/pmu.h                         |   1 +
10 files changed, 221 insertions(+), 74 deletions(-)
[PATCH v2 0/6] Add support for sysfs event.cpus and cpu event term
Posted by Ian Rogers 1 year, 5 months ago
The need for a sysfs event.cpus file is discussed here:
https://lore.kernel.org/lkml/CAP-5=fXXuWchzUK0n5KTH8kamr=DQoEni+bUoo8f-4j8Y+eMBg@mail.gmail.com/
following Dhananjay Ugwekar's work on the RAPL /sys/devices/power PMU.
These changes add support for the event.cpus file in sysfs and also a
cpu event term allowing events to have differing CPUs. This was added
in order to test the parsing and map propagation for the sysfs case.

v2: Add support for multiple cpu terms on an event that are
    merged. For example, an event of "l1d-misses/cpu=4,cpu=5/" will
    now be opened on both CPU 4 and 5 rather than just CPU 4.

Ian Rogers (6):
  perf pmu: Merge boolean sysfs event option parsing
  perf parse-events: Pass cpu_list as a perf_cpu_map in __add_event
  perf pmu: Add support for event.cpus files in sysfs
  libperf cpumap: Add ability to create CPU from a single CPU number
  perf parse-events: Set is_pmu_core for legacy hardware events
  perf parse-events: Add "cpu" term to set the CPU an event is recorded
    on

 .../sysfs-bus-event_source-devices-events     |  14 ++
 tools/lib/perf/cpumap.c                       |  10 ++
 tools/lib/perf/include/perf/cpumap.h          |   2 +
 tools/perf/Documentation/perf-list.txt        |   9 +
 tools/perf/util/evsel_config.h                |   1 +
 tools/perf/util/parse-events.c                | 162 ++++++++++++------
 tools/perf/util/parse-events.h                |   3 +-
 tools/perf/util/parse-events.l                |   1 +
 tools/perf/util/pmu.c                         |  92 +++++++---
 tools/perf/util/pmu.h                         |   1 +
 10 files changed, 221 insertions(+), 74 deletions(-)

-- 
2.45.2.1089.g2a221341d9-goog
Re: [PATCH v2 0/6] Add support for sysfs event.cpus and cpu event term
Posted by Dhananjay Ugwekar 1 year, 5 months ago
Hello Ian,

On 7/18/2024 6:00 AM, Ian Rogers wrote:
> The need for a sysfs event.cpus file is discussed here:
> https://lore.kernel.org/lkml/CAP-5=fXXuWchzUK0n5KTH8kamr=DQoEni+bUoo8f-4j8Y+eMBg@mail.gmail.com/
> following Dhananjay Ugwekar's work on the RAPL /sys/devices/power PMU.
> These changes add support for the event.cpus file in sysfs and also a
> cpu event term allowing events to have differing CPUs. This was added
> in order to test the parsing and map propagation for the sysfs case.

Tried applying the patchset on top of v6.10, torvalds/master and tip/master, 
it is failing at patch#2, what is the base commit/branch for this patchset?

Thanks,
Dhananjay

> 
> v2: Add support for multiple cpu terms on an event that are
>     merged. For example, an event of "l1d-misses/cpu=4,cpu=5/" will
>     now be opened on both CPU 4 and 5 rather than just CPU 4.
> 
> Ian Rogers (6):
>   perf pmu: Merge boolean sysfs event option parsing
>   perf parse-events: Pass cpu_list as a perf_cpu_map in __add_event
>   perf pmu: Add support for event.cpus files in sysfs
>   libperf cpumap: Add ability to create CPU from a single CPU number
>   perf parse-events: Set is_pmu_core for legacy hardware events
>   perf parse-events: Add "cpu" term to set the CPU an event is recorded
>     on
> 
>  .../sysfs-bus-event_source-devices-events     |  14 ++
>  tools/lib/perf/cpumap.c                       |  10 ++
>  tools/lib/perf/include/perf/cpumap.h          |   2 +
>  tools/perf/Documentation/perf-list.txt        |   9 +
>  tools/perf/util/evsel_config.h                |   1 +
>  tools/perf/util/parse-events.c                | 162 ++++++++++++------
>  tools/perf/util/parse-events.h                |   3 +-
>  tools/perf/util/parse-events.l                |   1 +
>  tools/perf/util/pmu.c                         |  92 +++++++---
>  tools/perf/util/pmu.h                         |   1 +
>  10 files changed, 221 insertions(+), 74 deletions(-)
>
Re: [PATCH v2 0/6] Add support for sysfs event.cpus and cpu event term
Posted by Ian Rogers 1 year, 5 months ago
On Thu, Jul 18, 2024 at 6:42 AM Dhananjay Ugwekar
<Dhananjay.Ugwekar@amd.com> wrote:
>
> Hello Ian,
>
> On 7/18/2024 6:00 AM, Ian Rogers wrote:
> > The need for a sysfs event.cpus file is discussed here:
> > https://lore.kernel.org/lkml/CAP-5=fXXuWchzUK0n5KTH8kamr=DQoEni+bUoo8f-4j8Y+eMBg@mail.gmail.com/
> > following Dhananjay Ugwekar's work on the RAPL /sys/devices/power PMU.
> > These changes add support for the event.cpus file in sysfs and also a
> > cpu event term allowing events to have differing CPUs. This was added
> > in order to test the parsing and map propagation for the sysfs case.
>
> Tried applying the patchset on top of v6.10, torvalds/master and tip/master,
> it is failing at patch#2, what is the base commit/branch for this patchset?

Hi Dhanajay,

The latest perf tool work is on the perf-tool-next branch of the
perf-tool-next.git:
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/

That said, Kan isn't keen on event.cpus, so  let's have a discussion about it.

Thanks,
Ian

> Thanks,
> Dhananjay
>
> >
> > v2: Add support for multiple cpu terms on an event that are
> >     merged. For example, an event of "l1d-misses/cpu=4,cpu=5/" will
> >     now be opened on both CPU 4 and 5 rather than just CPU 4.
> >
> > Ian Rogers (6):
> >   perf pmu: Merge boolean sysfs event option parsing
> >   perf parse-events: Pass cpu_list as a perf_cpu_map in __add_event
> >   perf pmu: Add support for event.cpus files in sysfs
> >   libperf cpumap: Add ability to create CPU from a single CPU number
> >   perf parse-events: Set is_pmu_core for legacy hardware events
> >   perf parse-events: Add "cpu" term to set the CPU an event is recorded
> >     on
> >
> >  .../sysfs-bus-event_source-devices-events     |  14 ++
> >  tools/lib/perf/cpumap.c                       |  10 ++
> >  tools/lib/perf/include/perf/cpumap.h          |   2 +
> >  tools/perf/Documentation/perf-list.txt        |   9 +
> >  tools/perf/util/evsel_config.h                |   1 +
> >  tools/perf/util/parse-events.c                | 162 ++++++++++++------
> >  tools/perf/util/parse-events.h                |   3 +-
> >  tools/perf/util/parse-events.l                |   1 +
> >  tools/perf/util/pmu.c                         |  92 +++++++---
> >  tools/perf/util/pmu.h                         |   1 +
> >  10 files changed, 221 insertions(+), 74 deletions(-)
> >