Skip to contentSkip to conversation

perf report: Add s390 raw data interpretation for PAI counters

PATCH Superseded Thomas Richter 2 participants 3 messages Nov 9, 2023 – Nov 10, 2023 perf events

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf report: Add s390 raw data interpretation for PAI counters

commit 1bf54f32f525 ("s390/pai: Add support for cryptography counters") added support for Processor Activity Instrumentation Facility (PAI) counters. These counters values are added as raw data with the perf sample during perf record.
Now add support to display these counters in perf report command. The counter number, its assigned name and value is now printed in addition to the hexadecimal output.

Version 2 fixed the lookup of the pmu only when evsel->pmu is NULL.

Output before:

 # perf report -D

6 514766399626050 0x7b058 [0x48]: PERF_RECORD_SAMPLE(IP, 0x1):

				303977/303977: 0 period: 1 addr: 0

... thread: paitest:303977
...... dso: <not found>

0x7b0a0@/root/perf.data.paicrypto [0x48]: event: 9 .
. ... raw event: size 72 bytes

 . 0000:  00 00 00 09 00 01 00 48 00 00 00 00 00 00 00 00  .......H........
 . 0010:  00 04 a3 69 00 04 a3 69 00 01 d4 2d 76 de a0 bb  ...i...i...-v...
 . 0020:  00 00 00 00 00 01 5c 53 00 00 00 06 00 00 00 00  ......\S........
 . 0030:  00 00 00 00 00 00 00 01 00 00 00 0c 00 07 00 00  ................
 . 0040:  00 00 00 53 96 af 00 00                          ...S....

Output after:

 # perf report -D

6 514766399626050 0x7b058 [0x48]: PERF_RECORD_SAMPLE(IP, 0x1):

				303977/303977: 0 period: 1 addr: 0

... thread: paitest:303977
...... dso: <not found>

0x7b0a0@/root/perf.data.paicrypto [0x48]: event: 9 .
. ... raw event: size 72 bytes

 . 0000:  00 00 00 09 00 01 00 48 00 00 00 00 00 00 00 00  .......H........
 . 0010:  00 04 a3 69 00 04 a3 69 00 01 d4 2d 76 de a0 bb  ...i...i...-v...
 . 0020:  00 00 00 00 00 01 5c 53 00 00 00 06 00 00 00 00  ......\S........
 . 0030:  00 00 00 00 00 00 00 01 00 00 00 0c 00 07 00 00  ................
 . 0040:  00 00 00 53 96 af 00 00                          ...S....
        Counter:007 km_aes_128 Value:0x00000000005396af     <--- new
---
 tools/perf/util/s390-cpumcf-kernel.h |   2 +
 tools/perf/util/s390-sample-raw.c    | 103 ++++++++++++++++++++++++---
 2 files changed, 97 insertions(+), 8 deletions(-)
tools/perf/util/s390-cpumcf-kernel.h +2 -0
index f55ca07f3ca1..74b36644e384 100644
@@ -12,6 +12,8 @@
 #define	S390_CPUMCF_DIAG_DEF	0xfeef	/* Counter diagnostic entry ID */
 #define	PERF_EVENT_CPUM_CF_DIAG	0xBC000	/* Event: Counter sets */
 #define PERF_EVENT_CPUM_SF_DIAG	0xBD000 /* Event: Combined-sampling */
+#define PERF_EVENT_PAI_CRYPTO_ALL	0x1000 /* Event: CRYPTO_ALL */
+#define PERF_EVENT_PAI_NNPA_ALL	0x1800 /* Event: NNPA_ALL */
 
 struct cf_ctrset_entry {	/* CPU-M CF counter set entry (8 byte) */
 	unsigned int def:16;	/* 0-15  Data Entry Format */
tools/perf/util/s390-sample-raw.c +95 -8

128 lines not on this page · raw message

Signature · 1 line
2.41.0
#1 lore raw

Em Thu, Nov 09, 2023 at 01:41:05PM +0100, Thomas Richter escreveu:

Quoted 7 lines

commit 1bf54f32f525 ("s390/pai: Add support for cryptography counters") added support for Processor Activity Instrumentation Facility (PAI) counters. These counters values are added as raw data with the perf sample during perf record.
Now add support to display these counters in perf report command. The counter number, its assigned name and value is now printed in addition to the hexadecimal output.

Can someone with access to a machine where these counters are available try this patch to provide a Tested-by or Reviewed-by tag?

- Arnaldo

#2 lore raw
Quoted 9 lines · Arnaldo Carvalho de Melo

Em Thu, Nov 09, 2023 at 01:41:05PM +0100, Thomas Richter escreveu:

Quoted 7 lines

commit 1bf54f32f525 ("s390/pai: Add support for cryptography counters") added support for Processor Activity Instrumentation Facility (PAI) counters. These counters values are added as raw data with the perf sample during perf record.
Now add support to display these counters in perf report command. The counter number, its assigned name and value is now printed in addition to the hexadecimal output.

Quoted 4 lines

Can someone with access to a machine where these counters are available try this patch to provide a Tested-by or Reviewed-by tag?

- Arnaldo

Sure I just sent v3 with Acked-by and Tested-by.

Signature · 5 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294