perf record: Provide detailed information on s390 CPU
When perf record ... is setup to record data, the s390 cpu information
was a fixed string "IBM/S390".
Replace this string with one containing more information about the
machine. The information included in the cpuid is a comma separated
list:
manufacturer,type,model-capacity,model[,version,authorization]
with
- manufacturer: up to 16 byte name of the manufacturer (IBM).
- type: a four digit number refering to the machine
generation.
- model-capacitiy: up to 16 characters describing number
of cpus etc.
- model: up to 16 characters describing model.
- version: the CPU-MF counter facility version number,
available on LPARs only, omitted on z/VM guests.
- authorization: the CPU-MF counter facility authorization level,
available on LPARs only, omitted on z/VM guests.
Before:
[root@s8360047 perf]# ./perf record -- sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.001 MB perf.data (4 samples) ]
[root@s8360047 perf]# ./perf report --header | fgrep cpuid
# cpuid : IBM/S390
[root@s8360047 perf]#
After:
[root@s35lp76 perf]# ./perf report --header|fgrep cpuid
# cpuid : IBM,3906,704,M03,3.5,002f
[root@s35lp76 perf]#
Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Link: http://lkml.kernel.org/r/20180213151419.80737-1-tmricht@linux.vnet.ibm.com
[ Use scnprintf instead of strncat to fix build errors on gcc GNU C99 5.4.0
20160609 -march=zEC12 -m64 -mzarch -ggdb3 -O6 -std=gnu99 -fPIC -fno-omit-frame-pointer -funwind-tables -fstack-protector-all ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>