All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Leo Yan <leo.yan@linaro.org>
Subject: [PATCH v1 2/2] arm64: perf: Report error if PMU fails to support current CPU
Date: Tue,  8 Jun 2021 22:52:28 +0800	[thread overview]
Message-ID: <20210608145228.36595-2-leo.yan@linaro.org> (raw)
In-Reply-To: <20210608145228.36595-1-leo.yan@linaro.org>

When run perf command on the Arm big.LITTLE system (Juno-r2 board):

  perf record -e cycles --per-thread program

The command executes normally without any errors; but when report the
result with "perf report", it fails to parse the symbols.  This is
because the perf data file doesn't contain MMAP2 events, thus it cannot
find the correct object file for parsing symbols.

On the big.LITTLE system, if the initialized PMU doesn't match with the
CPU the profiled task is scheduled on; for example, the initialized PMU
is on CPU0 in the LITTLE cluster, when invoke the function
perf_event_mmap_event() on CPU2 in the big cluster, the event is always
filtered out due to the CPU2 is not supported by the initialized PMU.
Finally, there have no any MMAP2 samples are generated for the
profiling.

This patch doesn't fix for this issue, alternatively, it simply reports
an error when detect the current CPU is not supported by PMU, so can
remind the user for the abnormal situation.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 drivers/perf/arm_pmu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index aedea060ca8b..99ddc8bf6466 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -565,6 +565,9 @@ static int armpmu_filter_match(struct perf_event *event)
 	int ret;
 
 	ret = cpumask_test_cpu(cpu, &armpmu->supported_cpus);
+	if (!ret)
+		pr_err("PMU doesn't support current CPU %d\n", cpu);
+
 	if (ret && armpmu->filter_match)
 		return armpmu->filter_match(event);
 
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Leo Yan <leo.yan@linaro.org>
To: Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Leo Yan <leo.yan@linaro.org>
Subject: [PATCH v1 2/2] arm64: perf: Report error if PMU fails to support current CPU
Date: Tue,  8 Jun 2021 22:52:28 +0800	[thread overview]
Message-ID: <20210608145228.36595-2-leo.yan@linaro.org> (raw)
In-Reply-To: <20210608145228.36595-1-leo.yan@linaro.org>

When run perf command on the Arm big.LITTLE system (Juno-r2 board):

  perf record -e cycles --per-thread program

The command executes normally without any errors; but when report the
result with "perf report", it fails to parse the symbols.  This is
because the perf data file doesn't contain MMAP2 events, thus it cannot
find the correct object file for parsing symbols.

On the big.LITTLE system, if the initialized PMU doesn't match with the
CPU the profiled task is scheduled on; for example, the initialized PMU
is on CPU0 in the LITTLE cluster, when invoke the function
perf_event_mmap_event() on CPU2 in the big cluster, the event is always
filtered out due to the CPU2 is not supported by the initialized PMU.
Finally, there have no any MMAP2 samples are generated for the
profiling.

This patch doesn't fix for this issue, alternatively, it simply reports
an error when detect the current CPU is not supported by PMU, so can
remind the user for the abnormal situation.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 drivers/perf/arm_pmu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index aedea060ca8b..99ddc8bf6466 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -565,6 +565,9 @@ static int armpmu_filter_match(struct perf_event *event)
 	int ret;
 
 	ret = cpumask_test_cpu(cpu, &armpmu->supported_cpus);
+	if (!ret)
+		pr_err("PMU doesn't support current CPU %d\n", cpu);
+
 	if (ret && armpmu->filter_match)
 		return armpmu->filter_match(event);
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-08 14:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 14:52 [PATCH v1 1/2] arm64: perf: Correct per-thread mode if the event is not supported Leo Yan
2021-06-08 14:52 ` Leo Yan
2021-06-08 14:52 ` Leo Yan [this message]
2021-06-08 14:52   ` [PATCH v1 2/2] arm64: perf: Report error if PMU fails to support current CPU Leo Yan
2021-06-08 15:21   ` Mark Rutland
2021-06-08 15:21     ` Mark Rutland
2021-06-08 15:34 ` [PATCH v1 1/2] arm64: perf: Correct per-thread mode if the event is not supported Mark Rutland
2021-06-08 15:34   ` Mark Rutland

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=20210608145228.36595-2-leo.yan@linaro.org \
    --to=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.