linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning
@ 2023-03-08  9:48 James Clark
  2023-03-08  9:48 ` [PATCH 2/2] perf cs-etm: Avoid printing warning in cs_etm_is_ete() check James Clark
  2023-03-08 11:46 ` [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning Leo Yan
  0 siblings, 2 replies; 5+ messages in thread
From: James Clark @ 2023-03-08  9:48 UTC (permalink / raw)
  To: linux-perf-users, acme
  Cc: linux-kernel, al.grant, James Clark, Mathieu Poirier,
	Suzuki K Poulose, Mike Leach, Leo Yan, John Garry, Will Deacon,
	Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Ian Rogers, coresight, linux-arm-kernel

This is printed as a warning but it is normal behavior that users
shouldn't be expected to do anything about. Reduce the warning level to
debug3 so it's only seen in verbose mode to avoid confusion.

Signed-off-by: James Clark <james.clark@arm.com>
---
 tools/perf/arch/arm/util/cs-etm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 7f71c8a237ff..59b50dd70330 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -694,8 +694,8 @@ static void cs_etm_save_etmv4_header(__u64 data[], struct auxtrace_record *itr,
 		data[CS_ETMV4_TS_SOURCE] = (__u64) cs_etm_get_ro_signed(cs_etm_pmu, cpu,
 				metadata_etmv4_ro[CS_ETMV4_TS_SOURCE]);
 	else {
-		pr_warning("[%03d] pmu file 'ts_source' not found. Fallback to safe value (-1)\n",
-			   cpu);
+		pr_debug3("[%03d] pmu file 'ts_source' not found. Fallback to safe value (-1)\n",
+			  cpu);
 		data[CS_ETMV4_TS_SOURCE] = (__u64) -1;
 	}
 }
@@ -729,8 +729,8 @@ static void cs_etm_save_ete_header(__u64 data[], struct auxtrace_record *itr, in
 		data[CS_ETE_TS_SOURCE] = (__u64) cs_etm_get_ro_signed(cs_etm_pmu, cpu,
 				metadata_ete_ro[CS_ETE_TS_SOURCE]);
 	else {
-		pr_warning("[%03d] pmu file 'ts_source' not found. Fallback to safe value (-1)\n",
-			   cpu);
+		pr_debug3("[%03d] pmu file 'ts_source' not found. Fallback to safe value (-1)\n",
+			  cpu);
 		data[CS_ETE_TS_SOURCE] = (__u64) -1;
 	}
 }
-- 
2.34.1


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

* [PATCH 2/2] perf cs-etm: Avoid printing warning in cs_etm_is_ete() check
  2023-03-08  9:48 [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning James Clark
@ 2023-03-08  9:48 ` James Clark
  2023-03-08 11:48   ` Leo Yan
  2023-03-08 11:46 ` [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning Leo Yan
  1 sibling, 1 reply; 5+ messages in thread
From: James Clark @ 2023-03-08  9:48 UTC (permalink / raw)
  To: linux-perf-users, acme
  Cc: linux-kernel, al.grant, James Clark, Mathieu Poirier,
	Suzuki K Poulose, Mike Leach, Leo Yan, John Garry, Will Deacon,
	Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Ian Rogers, coresight, linux-arm-kernel

When checking for the presence of ETE, a register is read that may not
be present on older kernels or if ETE isn't available. cs_etm_get_ro()
will print a warning if it doesn't exist, so check for the existence
first before accessing it.

Signed-off-by: James Clark <james.clark@arm.com>
---
 tools/perf/arch/arm/util/cs-etm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 59b50dd70330..86b61ad74f90 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -659,8 +659,12 @@ static bool cs_etm_is_ete(struct auxtrace_record *itr, int cpu)
 {
 	struct cs_etm_recording *ptr = container_of(itr, struct cs_etm_recording, itr);
 	struct perf_pmu *cs_etm_pmu = ptr->cs_etm_pmu;
-	int trcdevarch = cs_etm_get_ro(cs_etm_pmu, cpu, metadata_ete_ro[CS_ETE_TRCDEVARCH]);
+	int trcdevarch;
 
+	if (!cs_etm_pmu_path_exists(cs_etm_pmu, cpu, metadata_ete_ro[CS_ETE_TRCDEVARCH]))
+		return false;
+
+	trcdevarch = cs_etm_get_ro(cs_etm_pmu, cpu, metadata_ete_ro[CS_ETE_TRCDEVARCH]);
 	/*
 	 * ETE if ARCHVER is 5 (ARCHVER is 4 for ETM) and ARCHPART is 0xA13.
 	 * See ETM_DEVARCH_ETE_ARCH in coresight-etm4x.h
-- 
2.34.1


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

* Re: [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning
  2023-03-08  9:48 [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning James Clark
  2023-03-08  9:48 ` [PATCH 2/2] perf cs-etm: Avoid printing warning in cs_etm_is_ete() check James Clark
@ 2023-03-08 11:46 ` Leo Yan
  2023-03-13 19:10   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Yan @ 2023-03-08 11:46 UTC (permalink / raw)
  To: James Clark
  Cc: linux-perf-users, acme, linux-kernel, al.grant, Mathieu Poirier,
	Suzuki K Poulose, Mike Leach, John Garry, Will Deacon,
	Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Ian Rogers, coresight, linux-arm-kernel

On Wed, Mar 08, 2023 at 09:48:42AM +0000, James Clark wrote:
> This is printed as a warning but it is normal behavior that users
> shouldn't be expected to do anything about. Reduce the warning level to
> debug3 so it's only seen in verbose mode to avoid confusion.
> 
> Signed-off-by: James Clark <james.clark@arm.com>

Reviewed-by: Leo Yan <leo.yan@linaro.org

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

* Re: [PATCH 2/2] perf cs-etm: Avoid printing warning in cs_etm_is_ete() check
  2023-03-08  9:48 ` [PATCH 2/2] perf cs-etm: Avoid printing warning in cs_etm_is_ete() check James Clark
@ 2023-03-08 11:48   ` Leo Yan
  0 siblings, 0 replies; 5+ messages in thread
From: Leo Yan @ 2023-03-08 11:48 UTC (permalink / raw)
  To: James Clark
  Cc: linux-perf-users, acme, linux-kernel, al.grant, Mathieu Poirier,
	Suzuki K Poulose, Mike Leach, John Garry, Will Deacon,
	Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Ian Rogers, coresight, linux-arm-kernel

On Wed, Mar 08, 2023 at 09:48:43AM +0000, James Clark wrote:
> When checking for the presence of ETE, a register is read that may not
> be present on older kernels or if ETE isn't available. cs_etm_get_ro()
> will print a warning if it doesn't exist, so check for the existence
> first before accessing it.
> 
> Signed-off-by: James Clark <james.clark@arm.com>

Reviewed-by: Leo Yan <leo.yan@linaro.org>

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

* Re: [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning
  2023-03-08 11:46 ` [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning Leo Yan
@ 2023-03-13 19:10   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-03-13 19:10 UTC (permalink / raw)
  To: Leo Yan
  Cc: James Clark, linux-perf-users, linux-kernel, al.grant,
	Mathieu Poirier, Suzuki K Poulose, Mike Leach, John Garry,
	Will Deacon, Peter Zijlstra, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Ian Rogers,
	coresight, linux-arm-kernel

Em Wed, Mar 08, 2023 at 07:46:44PM +0800, Leo Yan escreveu:
> On Wed, Mar 08, 2023 at 09:48:42AM +0000, James Clark wrote:
> > This is printed as a warning but it is normal behavior that users
> > shouldn't be expected to do anything about. Reduce the warning level to
> > debug3 so it's only seen in verbose mode to avoid confusion.
> > 
> > Signed-off-by: James Clark <james.clark@arm.com>
> 
> Reviewed-by: Leo Yan <leo.yan@linaro.org

Thanks, applied both patches.

- Arnaldo


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

end of thread, other threads:[~2023-03-13 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08  9:48 [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning James Clark
2023-03-08  9:48 ` [PATCH 2/2] perf cs-etm: Avoid printing warning in cs_etm_is_ete() check James Clark
2023-03-08 11:48   ` Leo Yan
2023-03-08 11:46 ` [PATCH 1/2] perf cs-etm: Reduce verbosity of ts_source warning Leo Yan
2023-03-13 19:10   ` Arnaldo Carvalho de Melo

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