• Thomas Richter's avatar
    perf auxtrace: Support for perf report -D for s390 · b96e6615
    Thomas Richter authored
    Add initial support for s390 auxiliary traces using the CPU-Measurement
    Sampling Facility.
    
    Support and ignore PERF_REPORT_AUXTRACE_INFO records in the perf data
    file. Later patches will show the contents of the auxiliary traces.
    
    Setup the auxtrace queues and data structures for s390.  A raw dump of
    the perf.data file now does not show an error when an auxtrace event is
    encountered.
    
    Output before:
    
      [root@s35lp76 perf]# ./perf report -D -i perf.data.auxtrace
      0x128 [0x10]: failed to process type: 70
      Error:
      failed to process sample
    
      0x128 [0x10]: event: 70
      .
      . ... raw event: size 16 bytes
      .  0000:  00 00 00 46 00 00 00 10 00 00 00 00 00 00 00 00  ...F............
    
      0x128 [0x10]: PERF_RECORD_AUXTRACE_INFO type: 0
      [root@s35lp76 perf]#
    
    Output after:
    
       # ./perf report -D -i perf.data.auxtrace |fgrep PERF_RECORD_AUXTRACE
      0 0 0x128 [0x10]: PERF_RECORD_AUXTRACE_INFO type: 5
      0 0 0x25a66 [0x30]: PERF_RECORD_AUXTRACE size: 0x40000
    	   offset: 0  ref: 0  idx: 4  tid: -1  cpu: 4
      ....
    
    Additional notes about the underlying hardware and software
    implementation, provided by Hendrik Brueckner (see Link: below).
    
    =============================================================================
    
    The CPU-Measurement Facility (CPU-MF) provides a set of functions to obtain
    performance information on the mainframe.  Basically, it was introduced
    with System z10 years ago for the z/Architecture, that means, 64-bit.
    For Linux, there are two facilities of interest, counter facility and sampling
    facility.  The counter facility provides hardware counters for instructions,
    cycles, crypto-activities, and many more.
    
    The sampling facility is a hardware sampler that when started will write
    samples at a particular interval into a sampling buffer.  At some point,
    for example, if a sample block is full, it generates an interrupt to collect
    samples (while the sampler continues to run).
    
    Few years ago, I started to provide the a perf PMU to use the counter
    and sampling facilities.  Recently, the device driver was updated to also
    "export" the sampling buffer into the AUX area.  Thomas now completed the
    related perf work to interpret and process these AUX data.
    
    If people are more interested in the sampling facility, they can have a
    look into:
    
    - The Load-Program-Parameter and the CPU-Measurement Facilities, SA23-2260-05
      http://www-01.ibm.com/support/docview.wss?uid=isg26fcd1cc32246f4c8852574ce0044734a
    
    and to learn how-to use it for Linux on Z, have look at chapter 54,
    "Using the CPU-measurement facilities" in the:
    
    - Device Drivers, Features, and Commands, SC33-8411-34
      http://public.dhe.ibm.com/software/dw/linux390/docu/l416dd34.pdf
    
    =============================================================================
    Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
    Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
    Link: http://lkml.kernel.org/r/20180803100758.GA28475@linux.ibm.com
    Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Link: http://lkml.kernel.org/r/20180802074622.13641-2-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    b96e6615
auxtrace.c 2.89 KB