From: Jin Yao <yao.jin@linux.intel.com>
To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com
Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, yao.jin@intel.com,
Jin Yao <yao.jin@linux.intel.com>
Subject: [PATCH v2 1/8] perf tools: Check mem-loads auxiliary event
Date: Thu, 27 May 2021 08:16:03 +0800 [thread overview]
Message-ID: <20210527001610.10553-2-yao.jin@linux.intel.com> (raw)
In-Reply-To: <20210527001610.10553-1-yao.jin@linux.intel.com>
For some platforms, an auxiliary event has to be enabled
simultaneously with the load latency event.
For Alderlake, the auxiliary event is created in "cpu_core" pmu.
So first we need to check the existing of "cpu_core" pmu
and then check if this pmu has auxiliary event.
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
---
v2:
- No change.
tools/perf/arch/x86/util/mem-events.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/perf/arch/x86/util/mem-events.c b/tools/perf/arch/x86/util/mem-events.c
index 588110fd8904..e79232e3f2a0 100644
--- a/tools/perf/arch/x86/util/mem-events.c
+++ b/tools/perf/arch/x86/util/mem-events.c
@@ -11,8 +11,13 @@ static bool mem_loads_name__init;
bool is_mem_loads_aux_event(struct evsel *leader)
{
- if (!pmu_have_event("cpu", "mem-loads-aux"))
- return false;
+ if (perf_pmu__find("cpu")) {
+ if (!pmu_have_event("cpu", "mem-loads-aux"))
+ return false;
+ } else if (perf_pmu__find("cpu_core")) {
+ if (!pmu_have_event("cpu_core", "mem-loads-aux"))
+ return false;
+ }
return leader->core.attr.config == MEM_LOADS_AUX;
}
--
2.17.1
next prev parent reply other threads:[~2021-05-27 7:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 0:16 [PATCH v2 0/8] perf: Support perf-mem/perf-c2c for AlderLake Jin Yao
2021-05-27 0:16 ` Jin Yao [this message]
2021-05-27 0:16 ` [PATCH v2 2/8] perf tools: Support pmu prefix for mem-load event Jin Yao
2021-05-27 0:16 ` [PATCH v2 3/8] perf tools: Support pmu prefix for mem-store event Jin Yao
2021-05-27 0:16 ` [PATCH v2 4/8] perf tools: Check if mem_events is supported for hybrid platform Jin Yao
2021-05-27 0:16 ` [PATCH v2 5/8] perf mem: Support record " Jin Yao
2021-05-27 0:16 ` [PATCH v2 6/8] perf mem: Fix wrong verbose output for recording events Jin Yao
2021-05-31 22:42 ` Jiri Olsa
2021-06-01 1:10 ` Jin, Yao
2021-05-27 0:16 ` [PATCH v2 7/8] perf mem: Disable 'mem-loads-aux' group before reporting Jin Yao
2021-05-27 0:16 ` [PATCH v2 8/8] perf c2c: Support record for hybrid platform Jin Yao
2021-05-31 22:49 ` [PATCH v2 0/8] perf: Support perf-mem/perf-c2c for AlderLake Jiri Olsa
2021-06-01 14:09 ` Arnaldo Carvalho de Melo
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=20210527001610.10553-2-yao.jin@linux.intel.com \
--to=yao.jin@linux.intel.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=yao.jin@intel.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