• Thomas Richter's avatar
    perf report: Fix PAI counter names for s390 virtual machines · b74bc5a6
    Thomas Richter authored
    s390 introduced the Processor Activity Instrumentation (PAI) counter
    facility on LPAR and virtual machines z/VM for models 3931 and 3932.
    
    These counters are stored as raw data in the perf.data file and are
    displayed with:
    
     # perf report -i /tmp//perfout-635468 -D | grep Counter
    	Counter:007 <unknown> Value:0x00000000000186a0
    	Counter:032 <unknown> Value:0x0000000000000001
    	Counter:032 <unknown> Value:0x0000000000000001
    	Counter:032 <unknown> Value:0x0000000000000001
     #
    
    However on z/VM virtual machines, the counter names are not retrieved
    from the PMU and are shown as '<unknown>'.  This is caused by the CPU
    string saved in the mapfile.csv for this machine:
    
       ^IBM.393[12].*3\.7.[[:xdigit:]]+$,3,cf_z16,core
    
    This string contains the CPU Measurement facility first and second
    version number and authorization level (3\.7.[[:xdigit:]]+).  These
    numbers do not apply to the PAI counter facility.  In fact they can be
    omitted.
    
    Shorten the CPU identification string for this machine to manufacturer
    and model. This is sufficient for all PMU devices.
    
    Output after:
    
     # perf report -i /tmp//perfout-635468 -D | grep Counter
    	Counter:007 km_aes_128 Value:0x00000000000186a0
    	Counter:032 kma_gcm_aes_256 Value:0x0000000000000001
    	Counter:032 kma_gcm_aes_256 Value:0x0000000000000001
    	Counter:032 kma_gcm_aes_256 Value:0x0000000000000001
     #
    
    Fixes: b539deaf ("perf report: Add s390 raw data interpretation for PAI counters")
    Reviewed-by: default avatarIan Rogers <irogers@google.com>
    Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
    Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Sven Schnelle <svens@linux.ibm.com>
    Cc: Thomas Richter <tmricht@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Link: https://lore.kernel.org/r/20240404064806.1362876-1-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    b74bc5a6
mapfile.csv 396 Bytes