Message ID | 20231213195154.1085945-1-kan.liang@linux.intel.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8030915dys; Wed, 13 Dec 2023 11:53:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOn9COj+8gwDsDuT5vdtdjzWJWLOHdvxjYwJzxYasbABqdDX+177Tfa+elowRW8Co+4y8X X-Received: by 2002:a05:6a20:8f14:b0:18f:f955:1ec8 with SMTP id b20-20020a056a208f1400b0018ff9551ec8mr10143344pzk.51.1702497186524; Wed, 13 Dec 2023 11:53:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702497186; cv=none; d=google.com; s=arc-20160816; b=o/aUqqkAniuaHcs3mK/ESSZB7yTyiuphZ3QodkOarOOoJALz0S9xZSpPwTgZ1iYqxC Pas6b/mhNMT4vG3zaKs09pGRQ02J2ErfET674keOdEBjF8M18H0WLugUqF8acLVW/ClS fACbrZAAyNcuJuiZsXX+jPJ4y1ys2aMEySW2YSy2EGIvCWB5xZXI05tt/8QMlBRK6FhY qg6KI4lrnOU/yFe3Chv4BUXndotDHymMWww2mVIFH7LDoy4mL90GLmeYuqWxUNa31Znx v5zIOvOK8EYcZ9UUFaNop4jtIr6IsZyPkPdfLagXoebq5rCZsqH8YnRWB+fkeNsmX/rz km1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=n8rSmhWRJWtLefPSMY78IxY+OuggzXncYuw5X988sfE=; fh=iLSAnLq+NupqBn1b7Bg2tc8oMJDL8rzKu6C1Qh73u/U=; b=bEmwSk8+fZQVzqpjGcqP/SgfmyVNaAMPpK8vh2kFZfmNXIiDpmdsZWJZktp1v6Lm7p LOlj3uG7X6u//cvXBEN79XAVcEzcMnOT0qjLte7DzkTKpDQLOW9ouYLnvbJ4PDteLhsL pR30+4NRJUuSAGbWvZEPnVlE4oZpC9Tb1xjuTejbWHIcjKvxgjKcA4Jgww0dM3gx9Mwk EujROrXnXXZen+Qj5bcQNWt1x2QOwGlzVBnzqltf/8z5hg3XvCTyPeNvjbLA4lMiBxHB 6ESJGtAivnY5KKC37/5/GIjX2/k1BfMkL08kTebPrumGLZqHWL6X+t7law+NysdkCA/3 EvHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HClcTJQP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n30-20020a634d5e000000b005be264316d8si10041349pgl.417.2023.12.13.11.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:53:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HClcTJQP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5CB7282A854D; Wed, 13 Dec 2023 11:53:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378997AbjLMTwv (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 13 Dec 2023 14:52:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233795AbjLMTwi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 13 Dec 2023 14:52:38 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED76F1987; Wed, 13 Dec 2023 11:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702497127; x=1734033127; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+2J+lMKmnDWmo0pwzPu6dSwdKZ/4VMnKLp1WLefwysQ=; b=HClcTJQPQ0uifvDdCeyKjDCK2m+fUlqf1VypgeYyZSkCoFniuiVXjfK7 jlxxz1mq6Y3IX3dLQf2PN1gS2aHLd5V6OB15U81kmg7u/r5WuIy9J0xRk 4fAwpIDsPZ+OyMPUzPFBT9tBCKLwTtZtunbaa7SC0vg+K6hoiTryrNUsv B6pZaHtQnKJKGePq7tlGsxhl9CLgTxGigRzqqkjGAu+FQkspIGqVQyfAH bpoh91VAQK1oOlMCdUQ0KT6L0mfBn2ONiVfW6oPCucO+qDM/TybECZjHm hyUhxDs/RpQmWRn2pg9CQRNrQ1Or6q8+Eo8i1PD8nDrM8F2tVxUE/oQ1i g==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="8412871" X-IronPort-AV: E=Sophos;i="6.04,273,1695711600"; d="scan'208";a="8412871" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 11:52:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="917772546" X-IronPort-AV: E=Sophos;i="6.04,273,1695711600"; d="scan'208";a="917772546" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmsmga001.fm.intel.com with ESMTP; 13 Dec 2023 11:52:04 -0800 From: kan.liang@linux.intel.com To: acme@kernel.org, irogers@google.com, peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, 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 V3 0/7] Clean up perf mem Date: Wed, 13 Dec 2023 11:51:47 -0800 Message-Id: <20231213195154.1085945-1-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:53:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785197689959573385 X-GMAIL-MSGID: 1785197689959573385 |
Series |
Clean up perf mem
|
|
Message
Liang, Kan
Dec. 13, 2023, 7:51 p.m. UTC
From: Kan Liang <kan.liang@linux.intel.com>
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/mem-events.c | 13 +-
tools/perf/arch/powerpc/util/mem-events.h | 7 +
tools/perf/arch/powerpc/util/pmu.c | 11 ++
tools/perf/arch/s390/util/pmu.c | 3 +
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, 278 insertions(+), 280 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
Comments
On Wed, Dec 13, 2023 at 11:51:47AM -0800, kan.liang@linux.intel.com wrote: [...] > 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. This patch series is fine for me: Reviewed-by: Leo Yan <leo.yan@linaro.org> I only compiled successfully it on my Arm64 machine but don't test it due to I have no chance to access a machine with Arm SPE. James, could you test it? Thanks a lot! > 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
Hi, I was trying to test this patchset on powerpc. After applying it on top of acme's perf-tools-next branch, I am getting below error: INSTALL libsubcmd_headers INSTALL libperf_headers INSTALL libsymbol_headers INSTALL libapi_headers INSTALL libbpf_headers CC arch/powerpc/util/mem-events.o In file included from arch/powerpc/util/mem-events.c:3: arch/powerpc/util/mem-events.h:5:52: error: ‘PERF_MEM_EVENTS__MAX’ undeclared here (not in a function) 5 | extern struct perf_mem_event perf_mem_events_power[PERF_MEM_EVENTS__MAX]; | ^~~~~~~~~~~~~~~~~~~~ make[6]: *** [/home/kajol/linux/tools/build/Makefile.build:105: arch/powerpc/util/mem-events.o] Error 1 make[5]: *** [/home/kajol/linux/tools/build/Makefile.build:158: util] Error 2 make[4]: *** [/home/kajol/linux/tools/build/Makefile.build:158: powerpc] Error 2 make[3]: *** [/home/kajol/linux/tools/build/Makefile.build:158: arch] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [Makefile.perf:693: perf-in.o] Error 2 make[1]: *** [Makefile.perf:251: sub-make] Error 2 make: *** [Makefile:70: all] Error 2 It seems some headerfiles are missing from arch/powerpc/util/mem- events.c Thanks, Kajol Jain On 12/14/23 01:21, kan.liang@linux.intel.com wrote: > From: Kan Liang <kan.liang@linux.intel.com> > > 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/mem-events.c | 13 +- > tools/perf/arch/powerpc/util/mem-events.h | 7 + > tools/perf/arch/powerpc/util/pmu.c | 11 ++ > tools/perf/arch/s390/util/pmu.c | 3 + > 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, 278 insertions(+), 280 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 >
On 2023-12-19 4:26 a.m., kajoljain wrote: > Hi, > I was trying to test this patchset on powerpc. > > After applying it on top of acme's perf-tools-next branch, I am getting > below error: > > INSTALL libsubcmd_headers > INSTALL libperf_headers > INSTALL libsymbol_headers > INSTALL libapi_headers > INSTALL libbpf_headers > CC arch/powerpc/util/mem-events.o > In file included from arch/powerpc/util/mem-events.c:3: > arch/powerpc/util/mem-events.h:5:52: error: ‘PERF_MEM_EVENTS__MAX’ > undeclared here (not in a function) > 5 | extern struct perf_mem_event > perf_mem_events_power[PERF_MEM_EVENTS__MAX]; > | > ^~~~~~~~~~~~~~~~~~~~ > make[6]: *** [/home/kajol/linux/tools/build/Makefile.build:105: > arch/powerpc/util/mem-events.o] Error 1 > make[5]: *** [/home/kajol/linux/tools/build/Makefile.build:158: util] > Error 2 > make[4]: *** [/home/kajol/linux/tools/build/Makefile.build:158: powerpc] > Error 2 > make[3]: *** [/home/kajol/linux/tools/build/Makefile.build:158: arch] > Error 2 > make[3]: *** Waiting for unfinished jobs.... > make[2]: *** [Makefile.perf:693: perf-in.o] Error 2 > make[1]: *** [Makefile.perf:251: sub-make] Error 2 > make: *** [Makefile:70: all] Error 2 > > It seems some headerfiles are missing from arch/powerpc/util/mem- > events.c > Leo updated the headerfiles for ARM. https://termbin.com/0dkn I guess powerpc has to do the same thing. Could you please try the below patch? diff --git a/tools/perf/arch/powerpc/util/mem-events.c b/tools/perf/arch/powerpc/util/mem-events.c index 72a6ac2b52f5..765d4a054b0a 100644 --- a/tools/perf/arch/powerpc/util/mem-events.c +++ b/tools/perf/arch/powerpc/util/mem-events.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 -#include "map_symbol.h" +#include "util/map_symbol.h" +#include "util/mem-events.h" #include "mem-events.h" #define E(t, n, s, l, a) { .tag = t, .name = n, .event_name = s, .ldlat = l, .aux_event = a } Thanks, Kan > Thanks, > Kajol Jain > > On 12/14/23 01:21, kan.liang@linux.intel.com wrote: >> From: Kan Liang <kan.liang@linux.intel.com> >> >> 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/mem-events.c | 13 +- >> tools/perf/arch/powerpc/util/mem-events.h | 7 + >> tools/perf/arch/powerpc/util/pmu.c | 11 ++ >> tools/perf/arch/s390/util/pmu.c | 3 + >> 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, 278 insertions(+), 280 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 >> >
Hi Kajol Jain On 2023-12-19 9:15 a.m., Liang, Kan wrote: > > > On 2023-12-19 4:26 a.m., kajoljain wrote: >> Hi, >> I was trying to test this patchset on powerpc. >> >> After applying it on top of acme's perf-tools-next branch, I am getting >> below error: >> >> INSTALL libsubcmd_headers >> INSTALL libperf_headers >> INSTALL libsymbol_headers >> INSTALL libapi_headers >> INSTALL libbpf_headers >> CC arch/powerpc/util/mem-events.o >> In file included from arch/powerpc/util/mem-events.c:3: >> arch/powerpc/util/mem-events.h:5:52: error: ‘PERF_MEM_EVENTS__MAX’ >> undeclared here (not in a function) >> 5 | extern struct perf_mem_event >> perf_mem_events_power[PERF_MEM_EVENTS__MAX]; >> | >> ^~~~~~~~~~~~~~~~~~~~ >> make[6]: *** [/home/kajol/linux/tools/build/Makefile.build:105: >> arch/powerpc/util/mem-events.o] Error 1 >> make[5]: *** [/home/kajol/linux/tools/build/Makefile.build:158: util] >> Error 2 >> make[4]: *** [/home/kajol/linux/tools/build/Makefile.build:158: powerpc] >> Error 2 >> make[3]: *** [/home/kajol/linux/tools/build/Makefile.build:158: arch] >> Error 2 >> make[3]: *** Waiting for unfinished jobs.... >> make[2]: *** [Makefile.perf:693: perf-in.o] Error 2 >> make[1]: *** [Makefile.perf:251: sub-make] Error 2 >> make: *** [Makefile:70: all] Error 2 >> >> It seems some headerfiles are missing from arch/powerpc/util/mem- >> events.c >> > > Leo updated the headerfiles for ARM. https://termbin.com/0dkn > > I guess powerpc has to do the same thing. Could you please try the below > patch? Does the patch work on powerpc? Thanks, Kan > > diff --git a/tools/perf/arch/powerpc/util/mem-events.c > b/tools/perf/arch/powerpc/util/mem-events.c > index 72a6ac2b52f5..765d4a054b0a 100644 > --- a/tools/perf/arch/powerpc/util/mem-events.c > +++ b/tools/perf/arch/powerpc/util/mem-events.c > @@ -1,5 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0 > -#include "map_symbol.h" > +#include "util/map_symbol.h" > +#include "util/mem-events.h" > #include "mem-events.h" > > #define E(t, n, s, l, a) { .tag = t, .name = n, .event_name = s, .ldlat > = l, .aux_event = a } > > Thanks, > Kan > >> Thanks, >> Kajol Jain >> >> On 12/14/23 01:21, kan.liang@linux.intel.com wrote: >>> From: Kan Liang <kan.liang@linux.intel.com> >>> >>> 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/mem-events.c | 13 +- >>> tools/perf/arch/powerpc/util/mem-events.h | 7 + >>> tools/perf/arch/powerpc/util/pmu.c | 11 ++ >>> tools/perf/arch/s390/util/pmu.c | 3 + >>> 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, 278 insertions(+), 280 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 >>> >> >
On 1/3/24 01:38, Liang, Kan wrote: > Hi Kajol Jain > > On 2023-12-19 9:15 a.m., Liang, Kan wrote: >> >> >> On 2023-12-19 4:26 a.m., kajoljain wrote: >>> Hi, >>> I was trying to test this patchset on powerpc. >>> >>> After applying it on top of acme's perf-tools-next branch, I am getting >>> below error: >>> >>> INSTALL libsubcmd_headers >>> INSTALL libperf_headers >>> INSTALL libsymbol_headers >>> INSTALL libapi_headers >>> INSTALL libbpf_headers >>> CC arch/powerpc/util/mem-events.o >>> In file included from arch/powerpc/util/mem-events.c:3: >>> arch/powerpc/util/mem-events.h:5:52: error: ‘PERF_MEM_EVENTS__MAX’ >>> undeclared here (not in a function) >>> 5 | extern struct perf_mem_event >>> perf_mem_events_power[PERF_MEM_EVENTS__MAX]; >>> | >>> ^~~~~~~~~~~~~~~~~~~~ >>> make[6]: *** [/home/kajol/linux/tools/build/Makefile.build:105: >>> arch/powerpc/util/mem-events.o] Error 1 >>> make[5]: *** [/home/kajol/linux/tools/build/Makefile.build:158: util] >>> Error 2 >>> make[4]: *** [/home/kajol/linux/tools/build/Makefile.build:158: powerpc] >>> Error 2 >>> make[3]: *** [/home/kajol/linux/tools/build/Makefile.build:158: arch] >>> Error 2 >>> make[3]: *** Waiting for unfinished jobs.... >>> make[2]: *** [Makefile.perf:693: perf-in.o] Error 2 >>> make[1]: *** [Makefile.perf:251: sub-make] Error 2 >>> make: *** [Makefile:70: all] Error 2 >>> >>> It seems some headerfiles are missing from arch/powerpc/util/mem- >>> events.c >>> >> >> Leo updated the headerfiles for ARM. https://termbin.com/0dkn >> >> I guess powerpc has to do the same thing. Could you please try the below >> patch? > > > Does the patch work on powerpc? Hi Kan, Sorry I went for vacation so couldn't update. Yes this fix works. But we have another issue, actually this patch set changes uses ldlat attribute. But ldlat is not supported in powerpc because of which perf mem is failing in powerpc. I am looking into a work around to fix this issue. I will update the fix. Thanks, Kajol Jain > > > Thanks, > Kan >> >> diff --git a/tools/perf/arch/powerpc/util/mem-events.c >> b/tools/perf/arch/powerpc/util/mem-events.c >> index 72a6ac2b52f5..765d4a054b0a 100644 >> --- a/tools/perf/arch/powerpc/util/mem-events.c >> +++ b/tools/perf/arch/powerpc/util/mem-events.c >> @@ -1,5 +1,6 @@ >> // SPDX-License-Identifier: GPL-2.0 >> -#include "map_symbol.h" >> +#include "util/map_symbol.h" >> +#include "util/mem-events.h" >> #include "mem-events.h" >> >> #define E(t, n, s, l, a) { .tag = t, .name = n, .event_name = s, .ldlat >> = l, .aux_event = a } >> >> Thanks, >> Kan >> >>> Thanks, >>> Kajol Jain >>> >>> On 12/14/23 01:21, kan.liang@linux.intel.com wrote: >>>> From: Kan Liang <kan.liang@linux.intel.com> >>>> >>>> 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/mem-events.c | 13 +- >>>> tools/perf/arch/powerpc/util/mem-events.h | 7 + >>>> tools/perf/arch/powerpc/util/pmu.c | 11 ++ >>>> tools/perf/arch/s390/util/pmu.c | 3 + >>>> 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, 278 insertions(+), 280 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 >>>> >>> >>
On 2024-01-05 1:38 a.m., kajoljain wrote: > > > On 1/3/24 01:38, Liang, Kan wrote: >> Hi Kajol Jain >> >> On 2023-12-19 9:15 a.m., Liang, Kan wrote: >>> >>> >>> On 2023-12-19 4:26 a.m., kajoljain wrote: >>>> Hi, >>>> I was trying to test this patchset on powerpc. >>>> >>>> After applying it on top of acme's perf-tools-next branch, I am getting >>>> below error: >>>> >>>> INSTALL libsubcmd_headers >>>> INSTALL libperf_headers >>>> INSTALL libsymbol_headers >>>> INSTALL libapi_headers >>>> INSTALL libbpf_headers >>>> CC arch/powerpc/util/mem-events.o >>>> In file included from arch/powerpc/util/mem-events.c:3: >>>> arch/powerpc/util/mem-events.h:5:52: error: ‘PERF_MEM_EVENTS__MAX’ >>>> undeclared here (not in a function) >>>> 5 | extern struct perf_mem_event >>>> perf_mem_events_power[PERF_MEM_EVENTS__MAX]; >>>> | >>>> ^~~~~~~~~~~~~~~~~~~~ >>>> make[6]: *** [/home/kajol/linux/tools/build/Makefile.build:105: >>>> arch/powerpc/util/mem-events.o] Error 1 >>>> make[5]: *** [/home/kajol/linux/tools/build/Makefile.build:158: util] >>>> Error 2 >>>> make[4]: *** [/home/kajol/linux/tools/build/Makefile.build:158: powerpc] >>>> Error 2 >>>> make[3]: *** [/home/kajol/linux/tools/build/Makefile.build:158: arch] >>>> Error 2 >>>> make[3]: *** Waiting for unfinished jobs.... >>>> make[2]: *** [Makefile.perf:693: perf-in.o] Error 2 >>>> make[1]: *** [Makefile.perf:251: sub-make] Error 2 >>>> make: *** [Makefile:70: all] Error 2 >>>> >>>> It seems some headerfiles are missing from arch/powerpc/util/mem- >>>> events.c >>>> >>> >>> Leo updated the headerfiles for ARM. https://termbin.com/0dkn >>> >>> I guess powerpc has to do the same thing. Could you please try the below >>> patch? >> >> >> Does the patch work on powerpc? > > Hi Kan, > Sorry I went for vacation so couldn't update. Yes this fix works. Thanks for the update. > But > we have another issue, actually this patch set changes uses ldlat > attribute. But ldlat is not supported in powerpc because of which perf > mem is failing in powerpc. For powerpc, the patch 3 introduced a perf_mem_events_power, which doesn't have ldlat. But it only be assigned to the pmu->is_core. I'm not sure if it's the problem. Also, S390 still uses the default perf_mem_events, which includes ldlat. I'm not sure if S390 supports the ldlat. Thanks, Kan > > I am looking into a work around to fix this issue. I will update the fix. > > Thanks, > Kajol Jain > > >> >> >> Thanks, >> Kan >>> >>> diff --git a/tools/perf/arch/powerpc/util/mem-events.c >>> b/tools/perf/arch/powerpc/util/mem-events.c >>> index 72a6ac2b52f5..765d4a054b0a 100644 >>> --- a/tools/perf/arch/powerpc/util/mem-events.c >>> +++ b/tools/perf/arch/powerpc/util/mem-events.c >>> @@ -1,5 +1,6 @@ >>> // SPDX-License-Identifier: GPL-2.0 >>> -#include "map_symbol.h" >>> +#include "util/map_symbol.h" >>> +#include "util/mem-events.h" >>> #include "mem-events.h" >>> >>> #define E(t, n, s, l, a) { .tag = t, .name = n, .event_name = s, .ldlat >>> = l, .aux_event = a } >>> >>> Thanks, >>> Kan >>> >>>> Thanks, >>>> Kajol Jain >>>> >>>> On 12/14/23 01:21, kan.liang@linux.intel.com wrote: >>>>> From: Kan Liang <kan.liang@linux.intel.com> >>>>> >>>>> 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/mem-events.c | 13 +- >>>>> tools/perf/arch/powerpc/util/mem-events.h | 7 + >>>>> tools/perf/arch/powerpc/util/pmu.c | 11 ++ >>>>> tools/perf/arch/s390/util/pmu.c | 3 + >>>>> 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, 278 insertions(+), 280 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 >>>>> >>>> >>> >
On Wed, Dec 13, 2023 at 11:51:47AM -0800, kan.liang@linux.intel.com wrote: [...] > 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 After applying this series, below tests pass with Arm SPE: # ./perf c2c record -- /home/leoy/false_sharing.exe 2 # ./perf c2c report # ./perf mem record -e list # ./perf mem record -e spe-load -v --ldlat 50 # ./perf mem record -v # ./perf mem report # ./perf mem record -t store -v # ./perf mem report Tested-by: Leo Yan <leo.yan@linaro.org>
On 2024-01-06 11:08 p.m., Leo Yan wrote: > On Wed, Dec 13, 2023 at 11:51:47AM -0800, kan.liang@linux.intel.com wrote: > > [...] > >> 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 > > After applying this series, below tests pass with Arm SPE: > > # ./perf c2c record -- /home/leoy/false_sharing.exe 2 > # ./perf c2c report > > # ./perf mem record -e list > # ./perf mem record -e spe-load -v --ldlat 50 > # ./perf mem record -v > # ./perf mem report > # ./perf mem record -t store -v > # ./perf mem report > > Tested-by: Leo Yan <leo.yan@linaro.org> > Thanks Leo. Kan
On 1/5/24 20:08, Liang, Kan wrote: > > > On 2024-01-05 1:38 a.m., kajoljain wrote: >> >> >> On 1/3/24 01:38, Liang, Kan wrote: >>> Hi Kajol Jain >>> >>> On 2023-12-19 9:15 a.m., Liang, Kan wrote: >>>> >>>> >>>> On 2023-12-19 4:26 a.m., kajoljain wrote: >>>>> Hi, >>>>> I was trying to test this patchset on powerpc. >>>>> >>>>> After applying it on top of acme's perf-tools-next branch, I am getting >>>>> below error: >>>>> >>>>> INSTALL libsubcmd_headers >>>>> INSTALL libperf_headers >>>>> INSTALL libsymbol_headers >>>>> INSTALL libapi_headers >>>>> INSTALL libbpf_headers >>>>> CC arch/powerpc/util/mem-events.o >>>>> In file included from arch/powerpc/util/mem-events.c:3: >>>>> arch/powerpc/util/mem-events.h:5:52: error: ‘PERF_MEM_EVENTS__MAX’ >>>>> undeclared here (not in a function) >>>>> 5 | extern struct perf_mem_event >>>>> perf_mem_events_power[PERF_MEM_EVENTS__MAX]; >>>>> | >>>>> ^~~~~~~~~~~~~~~~~~~~ >>>>> make[6]: *** [/home/kajol/linux/tools/build/Makefile.build:105: >>>>> arch/powerpc/util/mem-events.o] Error 1 >>>>> make[5]: *** [/home/kajol/linux/tools/build/Makefile.build:158: util] >>>>> Error 2 >>>>> make[4]: *** [/home/kajol/linux/tools/build/Makefile.build:158: powerpc] >>>>> Error 2 >>>>> make[3]: *** [/home/kajol/linux/tools/build/Makefile.build:158: arch] >>>>> Error 2 >>>>> make[3]: *** Waiting for unfinished jobs.... >>>>> make[2]: *** [Makefile.perf:693: perf-in.o] Error 2 >>>>> make[1]: *** [Makefile.perf:251: sub-make] Error 2 >>>>> make: *** [Makefile:70: all] Error 2 >>>>> >>>>> It seems some headerfiles are missing from arch/powerpc/util/mem- >>>>> events.c >>>>> >>>> >>>> Leo updated the headerfiles for ARM. https://termbin.com/0dkn >>>> >>>> I guess powerpc has to do the same thing. Could you please try the below >>>> patch? >>> >>> >>> Does the patch work on powerpc? >> >> Hi Kan, >> Sorry I went for vacation so couldn't update. Yes this fix works. > > Thanks for the update. > >> But >> we have another issue, actually this patch set changes uses ldlat >> attribute. But ldlat is not supported in powerpc because of which perf >> mem is failing in powerpc. > > For powerpc, the patch 3 introduced a perf_mem_events_power, which > doesn't have ldlat. But it only be assigned to the pmu->is_core. I'm not > sure if it's the problem. Hi Kan, Correct there were some small issues with patch 3, I added fix for that. > Also, S390 still uses the default perf_mem_events, which includes ldlat. > I'm not sure if S390 supports the ldlat. I checked it, I didn't find ldlat parameter defined in arch/s390 directory. I think its better to make default ldlat value as false in tools/perf/util/mem-events.c file. Thanks, Kajol Jain > > Thanks, > Kan >> >> I am looking into a work around to fix this issue. I will update the fix. >> >> Thanks, >> Kajol Jain >> >> >>> >>> >>> Thanks, >>> Kan >>>> >>>> diff --git a/tools/perf/arch/powerpc/util/mem-events.c >>>> b/tools/perf/arch/powerpc/util/mem-events.c >>>> index 72a6ac2b52f5..765d4a054b0a 100644 >>>> --- a/tools/perf/arch/powerpc/util/mem-events.c >>>> +++ b/tools/perf/arch/powerpc/util/mem-events.c >>>> @@ -1,5 +1,6 @@ >>>> // SPDX-License-Identifier: GPL-2.0 >>>> -#include "map_symbol.h" >>>> +#include "util/map_symbol.h" >>>> +#include "util/mem-events.h" >>>> #include "mem-events.h" >>>> >>>> #define E(t, n, s, l, a) { .tag = t, .name = n, .event_name = s, .ldlat >>>> = l, .aux_event = a } >>>> >>>> Thanks, >>>> Kan >>>> >>>>> Thanks, >>>>> Kajol Jain >>>>> >>>>> On 12/14/23 01:21, kan.liang@linux.intel.com wrote: >>>>>> From: Kan Liang <kan.liang@linux.intel.com> >>>>>> >>>>>> 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/mem-events.c | 13 +- >>>>>> tools/perf/arch/powerpc/util/mem-events.h | 7 + >>>>>> tools/perf/arch/powerpc/util/pmu.c | 11 ++ >>>>>> tools/perf/arch/s390/util/pmu.c | 3 + >>>>>> 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, 278 insertions(+), 280 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 >>>>>> >>>>> >>>> >> >
On 2024-01-16 9:05 a.m., kajoljain wrote: >> For powerpc, the patch 3 introduced a perf_mem_events_power, which >> doesn't have ldlat. But it only be assigned to the pmu->is_core. I'm not >> sure if it's the problem. > Hi Kan, > Correct there were some small issues with patch 3, I added fix for that. > Thanks Kajol Jain! I will fold your fix into V4. >> Also, S390 still uses the default perf_mem_events, which includes ldlat. >> I'm not sure if S390 supports the ldlat. > I checked it, I didn't find ldlat parameter defined in arch/s390 > directory. I think its better to make default ldlat value as false > in tools/perf/util/mem-events.c file. The s390 may not be the only user for the default perf_mem_events[] in the tools/perf/util/mem-events.c. We probably cannot change the default value. We may share the perf_mem_events_power[] between powerpc and s390. (We did the similar share for arm and arm64.) How about the below patch (not tested.) diff --git a/tools/perf/arch/s390/util/pmu.c b/tools/perf/arch/s390/util/pmu.c index 225d7dc2379c..411034c984bb 100644 --- a/tools/perf/arch/s390/util/pmu.c +++ b/tools/perf/arch/s390/util/pmu.c @@ -8,6 +8,7 @@ #include <string.h> #include "../../../util/pmu.h" +#include "../../powerpc/util/mem-events.h" #define S390_PMUPAI_CRYPTO "pai_crypto" #define S390_PMUPAI_EXT "pai_ext" @@ -21,5 +22,5 @@ void perf_pmu__arch_init(struct perf_pmu *pmu) pmu->selectable = true; if (pmu->is_core) - pmu->mem_events = perf_mem_events; + pmu->mem_events = perf_mem_events_power; } However, the original s390 code doesn't include any s390 specific code for perf_mem. So I thought it uses the default perf_mem_events[]. Is there something I missed? Or does the s390 even support mem events? If not, I may remove the mem_events from s390. Thanks, Kan
On 1/16/24 22:07, Liang, Kan wrote: > > > On 2024-01-16 9:05 a.m., kajoljain wrote: >>> For powerpc, the patch 3 introduced a perf_mem_events_power, which >>> doesn't have ldlat. But it only be assigned to the pmu->is_core. I'm not >>> sure if it's the problem. >> Hi Kan, >> Correct there were some small issues with patch 3, I added fix for that. >> > > Thanks Kajol Jain! I will fold your fix into V4. > >>> Also, S390 still uses the default perf_mem_events, which includes ldlat. >>> I'm not sure if S390 supports the ldlat. >> I checked it, I didn't find ldlat parameter defined in arch/s390 >> directory. I think its better to make default ldlat value as false >> in tools/perf/util/mem-events.c file. > > The s390 may not be the only user for the default perf_mem_events[] in > the tools/perf/util/mem-events.c. We probably cannot change the default > value. > We may share the perf_mem_events_power[] between powerpc and s390. (We > did the similar share for arm and arm64.) > > How about the below patch (not tested.) > > diff --git a/tools/perf/arch/s390/util/pmu.c > b/tools/perf/arch/s390/util/pmu.c > index 225d7dc2379c..411034c984bb 100644 > --- a/tools/perf/arch/s390/util/pmu.c > +++ b/tools/perf/arch/s390/util/pmu.c > @@ -8,6 +8,7 @@ > #include <string.h> > > #include "../../../util/pmu.h" > +#include "../../powerpc/util/mem-events.h" > > #define S390_PMUPAI_CRYPTO "pai_crypto" > #define S390_PMUPAI_EXT "pai_ext" > @@ -21,5 +22,5 @@ void perf_pmu__arch_init(struct perf_pmu *pmu) > pmu->selectable = true; > > if (pmu->is_core) > - pmu->mem_events = perf_mem_events; > + pmu->mem_events = perf_mem_events_power; > } > > > > However, the original s390 code doesn't include any s390 specific code > for perf_mem. So I thought it uses the default perf_mem_events[]. > Is there something I missed? > > Or does the s390 even support mem events? If not, I may remove the > mem_events from s390. Hi Kan, I don't have s390 system to do testing. But from my end I am fine with the changes. Thanks, Kajol Jain > > Thanks, > Kan
On 1/23/24 06:30, kajoljain wrote: > > > On 1/16/24 22:07, Liang, Kan wrote: >> >> >> On 2024-01-16 9:05 a.m., kajoljain wrote: >>>> For powerpc, the patch 3 introduced a perf_mem_events_power, which >>>> doesn't have ldlat. But it only be assigned to the pmu->is_core. I'm not >>>> sure if it's the problem. >>> Hi Kan, >>> Correct there were some small issues with patch 3, I added fix for that. >>> >> >> Thanks Kajol Jain! I will fold your fix into V4. >> >>>> Also, S390 still uses the default perf_mem_events, which includes ldlat. >>>> I'm not sure if S390 supports the ldlat. >>> I checked it, I didn't find ldlat parameter defined in arch/s390 >>> directory. I think its better to make default ldlat value as false >>> in tools/perf/util/mem-events.c file. >> >> The s390 may not be the only user for the default perf_mem_events[] in >> the tools/perf/util/mem-events.c. We probably cannot change the default >> value. >> We may share the perf_mem_events_power[] between powerpc and s390. (We >> did the similar share for arm and arm64.) >> >> How about the below patch (not tested.) >> >> diff --git a/tools/perf/arch/s390/util/pmu.c >> b/tools/perf/arch/s390/util/pmu.c >> index 225d7dc2379c..411034c984bb 100644 >> --- a/tools/perf/arch/s390/util/pmu.c >> +++ b/tools/perf/arch/s390/util/pmu.c >> @@ -8,6 +8,7 @@ >> #include <string.h> >> >> #include "../../../util/pmu.h" >> +#include "../../powerpc/util/mem-events.h" >> >> #define S390_PMUPAI_CRYPTO "pai_crypto" >> #define S390_PMUPAI_EXT "pai_ext" >> @@ -21,5 +22,5 @@ void perf_pmu__arch_init(struct perf_pmu *pmu) >> pmu->selectable = true; >> >> if (pmu->is_core) >> - pmu->mem_events = perf_mem_events; >> + pmu->mem_events = perf_mem_events_power; >> } >> >> >> >> However, the original s390 code doesn't include any s390 specific code >> for perf_mem. So I thought it uses the default perf_mem_events[]. >> Is there something I missed? >> >> Or does the s390 even support mem events? If not, I may remove the >> mem_events from s390. > > Hi Kan, > I don't have s390 system to do testing. But from my end I am fine > with the changes. > > Thanks, > Kajol Jain > s390 does not support perf mem at all. Right now it is save to remove it from s390. Thanks >> >> Thanks, >> Kan >
On 2024-01-23 12:56 a.m., Thomas Richter wrote: > On 1/23/24 06:30, kajoljain wrote: >> >> >> On 1/16/24 22:07, Liang, Kan wrote: >>> >>> >>> On 2024-01-16 9:05 a.m., kajoljain wrote: >>>>> For powerpc, the patch 3 introduced a perf_mem_events_power, which >>>>> doesn't have ldlat. But it only be assigned to the pmu->is_core. I'm not >>>>> sure if it's the problem. >>>> Hi Kan, >>>> Correct there were some small issues with patch 3, I added fix for that. >>>> >>> >>> Thanks Kajol Jain! I will fold your fix into V4. >>> >>>>> Also, S390 still uses the default perf_mem_events, which includes ldlat. >>>>> I'm not sure if S390 supports the ldlat. >>>> I checked it, I didn't find ldlat parameter defined in arch/s390 >>>> directory. I think its better to make default ldlat value as false >>>> in tools/perf/util/mem-events.c file. >>> >>> The s390 may not be the only user for the default perf_mem_events[] in >>> the tools/perf/util/mem-events.c. We probably cannot change the default >>> value. >>> We may share the perf_mem_events_power[] between powerpc and s390. (We >>> did the similar share for arm and arm64.) >>> >>> How about the below patch (not tested.) >>> >>> diff --git a/tools/perf/arch/s390/util/pmu.c >>> b/tools/perf/arch/s390/util/pmu.c >>> index 225d7dc2379c..411034c984bb 100644 >>> --- a/tools/perf/arch/s390/util/pmu.c >>> +++ b/tools/perf/arch/s390/util/pmu.c >>> @@ -8,6 +8,7 @@ >>> #include <string.h> >>> >>> #include "../../../util/pmu.h" >>> +#include "../../powerpc/util/mem-events.h" >>> >>> #define S390_PMUPAI_CRYPTO "pai_crypto" >>> #define S390_PMUPAI_EXT "pai_ext" >>> @@ -21,5 +22,5 @@ void perf_pmu__arch_init(struct perf_pmu *pmu) >>> pmu->selectable = true; >>> >>> if (pmu->is_core) >>> - pmu->mem_events = perf_mem_events; >>> + pmu->mem_events = perf_mem_events_power; >>> } >>> >>> >>> >>> However, the original s390 code doesn't include any s390 specific code >>> for perf_mem. So I thought it uses the default perf_mem_events[]. >>> Is there something I missed? >>> >>> Or does the s390 even support mem events? If not, I may remove the >>> mem_events from s390. >> >> Hi Kan, >> I don't have s390 system to do testing. But from my end I am fine >> with the changes. >> >> Thanks, >> Kajol Jain >> > > s390 does not support perf mem at all. Right now it is save to remove it from s390. Thanks for the confirmation! Thanks, Kan > Thanks > >>> >>> Thanks, >>> Kan >> >