linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] perf/mem: AMD IBS and generic tools improvements
@ 2023-04-07 11:24 Ravi Bangoria
  2023-04-07 11:24 ` [PATCH v3 1/9] perf/mem: Introduce PERF_MEM_LVLNUM_UNC Ravi Bangoria
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Ravi Bangoria @ 2023-04-07 11:24 UTC (permalink / raw)
  To: peterz, namhyung, acme
  Cc: ravi.bangoria, mingo, eranian, kan.liang, jolsa, irogers,
	adrian.hunter, leo.yan, kjain, linux-perf-users, linux-kernel,
	sandipan.das, ananth.narayan, santosh.shukla

Kernel IBS driver wasn't using new PERF_MEM_* APIs due to some of its
limitations. Mainly:

1. mem_lvl_num doesn't allow setting multiple sources whereas old API
   allows it. Setting multiple data sources is useful because IBS on
   pre-zen4 uarch doesn't provide fine granular DataSrc details (there
   is only one such DataSrc(2h) though).
2. perf mem sorting logic (sort__lvl_cmp()) ignores mem_lvl_num. perf
   c2c (c2c_decode_stats()) does not use mem_lvl_num at all. perf mem
   prints mem_lvl and mem_lvl_num both if both are set, which is ugly.

Set mem_lvl_num, mem_remote and mem_hops for data_src via IBS. Handle
first issue using mem_lvl_num = ANY_CACHE | HOPS_0. In addition to
setting new API fields, convert all individual field assignments to
compile time wrapper macros built using PERF_MEM_S(). Also convert
DataSrc conditional code to array lookups.

Interpretation of perf_mem_data_src by perf_mem__lvl_scnprintf() was
non-intuitive. Make it sane.

v2: https://lore.kernel.org/r/20230327130851.1565-1-ravi.bangoria%40amd.com
v2->v3:
  - IBS: Don't club RmtNode with DataSrc=7 (IO)
  - Make perf_mem__lvl_scnprintf() more sane
  - Introduce PERF_MEM_LVLNUM_UNC, set it along with PERF_MEM_LVL_UNC
    and interpreat it in tool.
  - Add PERF_MEM_LVLNUM_NA to default data_src value
  - Change some of the IBS bit description according to latest PPR

Namhyung Kim (1):
  perf/x86/ibs: Set mem_lvl_num, mem_remote and mem_hops for data_src

Ravi Bangoria (8):
  perf/mem: Introduce PERF_MEM_LVLNUM_UNC
  perf/mem: Add PERF_MEM_LVLNUM_NA to PERF_MEM_NA
  perf headers: Sync uapi/linux/perf_event.h
  perf mem: Add PERF_MEM_LVLNUM_NA to PERF_MEM_DATA_SRC_NONE
  perf mem: Add support for printing PERF_MEM_LVLNUM_UNC
  perf mem: Refactor perf_mem__lvl_scnprintf()
  perf mem: Increase HISTC_MEM_LVL column size to 39 chars
  perf script ibs: Change bit description according to latest PPR

 arch/x86/events/amd/ibs.c             | 156 +++++++++++---------------
 include/linux/perf_event.h            |   3 +-
 include/uapi/linux/perf_event.h       |   3 +-
 tools/include/uapi/linux/perf_event.h |   3 +-
 tools/perf/util/amd-sample-raw.c      |  14 +--
 tools/perf/util/event.h               |   3 +-
 tools/perf/util/hist.c                |   2 +-
 tools/perf/util/mem-events.c          |  90 ++++++++-------
 8 files changed, 132 insertions(+), 142 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-06-30  6:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 11:24 [PATCH v3 0/9] perf/mem: AMD IBS and generic tools improvements Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 1/9] perf/mem: Introduce PERF_MEM_LVLNUM_UNC Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 2/9] perf/mem: Add PERF_MEM_LVLNUM_NA to PERF_MEM_NA Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 3/9] perf/x86/ibs: Set mem_lvl_num, mem_remote and mem_hops for data_src Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 4/9] perf headers: Sync uapi/linux/perf_event.h Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 5/9] perf mem: Add PERF_MEM_LVLNUM_NA to PERF_MEM_DATA_SRC_NONE Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 6/9] perf mem: Add support for printing PERF_MEM_LVLNUM_UNC Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 7/9] perf mem: Refactor perf_mem__lvl_scnprintf() Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 8/9] perf mem: Increase HISTC_MEM_LVL column size to 39 chars Ravi Bangoria
2023-04-07 11:24 ` [PATCH v3 9/9] perf script ibs: Change bit description according to latest PPR Ravi Bangoria
2023-04-07 21:44 ` [PATCH v3 0/9] perf/mem: AMD IBS and generic tools improvements Namhyung Kim
2023-04-10  2:23   ` Ravi Bangoria
2023-04-10 15:15     ` Arnaldo Carvalho de Melo
2023-04-10 22:31       ` Arnaldo Carvalho de Melo
2023-05-16  2:45     ` Ravi Bangoria
2023-05-29  4:05       ` Ravi Bangoria
2023-06-30  6:35         ` Ravi Bangoria

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).