From: kan.liang@linux.intel.com
To: acme@kernel.org, namhyung@kernel.org, irogers@google.com,
peterz@infradead.org, mingo@redhat.com, jolsa@kernel.org,
adrian.hunter@intel.com, john.g.garry@oracle.com,
will@kernel.org, james.clark@arm.com, mike.leach@linaro.org,
leo.yan@linaro.org, yuhaixin.yhx@linux.alibaba.com,
renyu.zj@linux.alibaba.com, tmricht@linux.ibm.com,
ravi.bangoria@amd.com, atrajeev@linux.vnet.ibm.com,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Kan Liang <kan.liang@linux.intel.com>
Subject: [PATCH V4 0/7] Clean up perf mem
Date: Tue, 23 Jan 2024 10:50:29 -0800 [thread overview]
Message-ID: <20240123185036.3461837-1-kan.liang@linux.intel.com> (raw)
From: Kan Liang <kan.liang@linux.intel.com>
Changes since V3:
- Fix the powerPC building error (Kajol Jain)
- The s390 does not support perf mem. Remove the code. (Thomas)
- Add reviewed-by and tested-by from Kajol Jain for patch 1 and 2
- Add tested-by from Leo
Changes since V2:
- Fix the Arm64 building error (Leo)
- Add two new patches to clean up perf_mem_events__record_args()
and perf_pmus__num_mem_pmus() (Leo)
Changes since V1:
- Fix strcmp of PMU name checking (Ravi)
- Fix "/," typo (Ian)
- Rename several functions with perf_pmu__mem_events prefix. (Ian)
- Fold the header removal patch into the patch where the cleanups made.
(Arnaldo)
- Add reviewed-by and tested-by from Ian and Ravi
As discussed in the below thread, the patch set is to clean up perf mem.
https://lore.kernel.org/lkml/afefab15-cffc-4345-9cf4-c6a4128d4d9c@linux.intel.com/
Introduce generic functions perf_mem_events__ptr(),
perf_mem_events__name() ,and is_mem_loads_aux_event() to replace the
ARCH specific ones.
Simplify the perf_mem_event__supported().
Only keeps the ARCH-specific perf_mem_events array in the corresponding
mem-events.c for each ARCH.
There is no functional change.
The patch set touches almost all the ARCHs, Intel, AMD, ARM, Power and
etc. But I can only test it on two Intel platforms.
Please give it try, if you have machines with other ARCHs.
Here are the test results:
Intel hybrid machine:
$perf mem record -e list
ldlat-loads : available
ldlat-stores : available
$perf mem record -e ldlat-loads -v --ldlat 50
calling: record -e cpu_atom/mem-loads,ldlat=50/P -e cpu_core/mem-loads,ldlat=50/P
$perf mem record -v
calling: record -e cpu_atom/mem-loads,ldlat=30/P -e cpu_atom/mem-stores/P -e cpu_core/mem-loads,ldlat=30/P -e cpu_core/mem-stores/P
$perf mem record -t store -v
calling: record -e cpu_atom/mem-stores/P -e cpu_core/mem-stores/P
Intel SPR:
$perf mem record -e list
ldlat-loads : available
ldlat-stores : available
$perf mem record -e ldlat-loads -v --ldlat 50
calling: record -e {cpu/mem-loads-aux/,cpu/mem-loads,ldlat=50/}:P
$perf mem record -v
calling: record -e {cpu/mem-loads-aux/,cpu/mem-loads,ldlat=30/}:P -e cpu/mem-stores/P
$perf mem record -t store -v
calling: record -e cpu/mem-stores/P
Kan Liang (7):
perf mem: Add mem_events into the supported perf_pmu
perf mem: Clean up perf_mem_events__ptr()
perf mem: Clean up perf_mem_events__name()
perf mem: Clean up perf_mem_event__supported()
perf mem: Clean up is_mem_loads_aux_event()
perf mem: Clean up perf_mem_events__record_args()
perf mem: Clean up perf_pmus__num_mem_pmus()
tools/perf/arch/arm/util/pmu.c | 3 +
tools/perf/arch/arm64/util/mem-events.c | 39 +---
tools/perf/arch/arm64/util/mem-events.h | 7 +
tools/perf/arch/powerpc/util/Build | 1 +
tools/perf/arch/powerpc/util/mem-events.c | 16 +-
tools/perf/arch/powerpc/util/mem-events.h | 7 +
tools/perf/arch/powerpc/util/pmu.c | 12 ++
tools/perf/arch/x86/util/mem-events.c | 99 ++--------
tools/perf/arch/x86/util/mem-events.h | 10 +
tools/perf/arch/x86/util/pmu.c | 19 +-
tools/perf/builtin-c2c.c | 45 ++---
tools/perf/builtin-mem.c | 48 ++---
tools/perf/util/mem-events.c | 217 +++++++++++++---------
tools/perf/util/mem-events.h | 19 +-
tools/perf/util/pmu.c | 4 +-
tools/perf/util/pmu.h | 7 +
tools/perf/util/pmus.c | 6 -
tools/perf/util/pmus.h | 1 -
18 files changed, 279 insertions(+), 281 deletions(-)
create mode 100644 tools/perf/arch/arm64/util/mem-events.h
create mode 100644 tools/perf/arch/powerpc/util/mem-events.h
create mode 100644 tools/perf/arch/powerpc/util/pmu.c
create mode 100644 tools/perf/arch/x86/util/mem-events.h
--
2.35.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2024-01-23 18:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 18:50 kan.liang [this message]
2024-01-23 18:50 ` [PATCH V4 1/7] perf mem: Add mem_events into the supported perf_pmu kan.liang
2024-01-23 18:50 ` [PATCH V4 2/7] perf mem: Clean up perf_mem_events__ptr() kan.liang
2024-01-23 18:50 ` [PATCH V4 3/7] perf mem: Clean up perf_mem_events__name() kan.liang
2024-01-23 18:50 ` [PATCH V4 4/7] perf mem: Clean up perf_mem_event__supported() kan.liang
2024-01-23 18:50 ` [PATCH V4 5/7] perf mem: Clean up is_mem_loads_aux_event() kan.liang
2024-01-23 18:50 ` [PATCH V4 6/7] perf mem: Clean up perf_mem_events__record_args() kan.liang
2024-01-24 18:22 ` Ian Rogers
2024-01-23 18:50 ` [PATCH V4 7/7] perf mem: Clean up perf_pmus__num_mem_pmus() kan.liang
2024-01-24 18:23 ` Ian Rogers
2024-01-24 18:24 ` [PATCH V4 0/7] Clean up perf mem Ian Rogers
2024-01-25 5:24 ` Namhyung Kim
2024-01-25 21:44 ` 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=20240123185036.3461837-1-kan.liang@linux.intel.com \
--to=kan.liang@linux.intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=james.clark@arm.com \
--cc=john.g.garry@oracle.com \
--cc=jolsa@kernel.org \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=renyu.zj@linux.alibaba.com \
--cc=tmricht@linux.ibm.com \
--cc=will@kernel.org \
--cc=yuhaixin.yhx@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).