Skip to contentSkip to conversation

perf arm-spe: Only warn once for each unsupported address packet

PATCH Applied Rob Herring 3 participants 3 messages Jan 27, 2023 – Feb 2, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf arm-spe: Only warn once for each unsupported address packet

Unknown address packet indexes are not an error as the Arm architecture can (and has with SPEv1.2) define new ones and implementation defined ones are also allowed. The error message for every occurrence of the packet is needlessly noisy as well. Change the message to print just once for each unknown index.

---
 tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/util/arm-spe-decoder/arm-spe-decoder.c +5 -1
index 091987dd3966..40dcedfd75cd 100644
@@ -68,7 +68,11 @@ static u64 arm_spe_calc_ip(int index, u64 payload)
 		/* Clean highest byte */
 		payload = SPE_ADDR_PKT_ADDR_GET_BYTES_0_6(payload);
 	} else {
-		pr_err("unsupported address packet index: 0x%x\n", index);
+		static u32 seen_idx = 0;
+		if (!(seen_idx & BIT(index))) {
+			seen_idx |= BIT(index);
+			pr_warning("ignoring unsupported address packet index: 0x%x\n", index);
+		}
 	}
 
 	return payload;
Signature · 1 line
2.39.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Rob Herring

Unknown address packet indexes are not an error as the Arm architecture can (and has with SPEv1.2) define new ones and implementation defined ones are also allowed. The error message for every occurrence of the packet is needlessly noisy as well. Change the message to print just once for each unknown index.

Quoted 24 lines
---
 tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/util/arm-spe-decoder/arm-spe-decoder.c +5 -1
index 091987dd3966..40dcedfd75cd 100644
@@ -68,7 +68,11 @@ static u64 arm_spe_calc_ip(int index, u64 payload)
 		/* Clean highest byte */
 		payload = SPE_ADDR_PKT_ADDR_GET_BYTES_0_6(payload);
 	} else {
-		pr_err("unsupported address packet index: 0x%x\n", index);
+		static u32 seen_idx = 0;
+		if (!(seen_idx & BIT(index))) {
+			seen_idx |= BIT(index);
+			pr_warning("ignoring unsupported address packet index: 0x%x\n", index);
+		}
 	}
 
 	return payload;
Signature · 1 line
2.39.0
maintainer Applied
#2 lore raw

Em Mon, Jan 30, 2023 at 10:13:52AM +0800, Leo Yan escreveu:

Quoted 10 lines · Rob Herring
Quoted 7 lines

Unknown address packet indexes are not an error as the Arm architecture can (and has with SPEv1.2) define new ones and implementation defined ones are also allowed. The error message for every occurrence of the packet is needlessly noisy as well. Change the message to print just once for each unknown index.

Thanks, applied.

- Arnaldo

Quoted 24 lines
Quoted 24 lines
---
 tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/util/arm-spe-decoder/arm-spe-decoder.c +5 -1
index 091987dd3966..40dcedfd75cd 100644
@@ -68,7 +68,11 @@ static u64 arm_spe_calc_ip(int index, u64 payload)
 		/* Clean highest byte */
 		payload = SPE_ADDR_PKT_ADDR_GET_BYTES_0_6(payload);
 	} else {
-		pr_err("unsupported address packet index: 0x%x\n", index);
+		static u32 seen_idx = 0;
+		if (!(seen_idx & BIT(index))) {
+			seen_idx |= BIT(index);
+			pr_warning("ignoring unsupported address packet index: 0x%x\n", index);
+		}
 	}
 
 	return payload;
Signature · 1 line
2.39.0
Signature · 1 line
- Arnaldo