1
0
Fork 0
Commit Graph

3 Commits (d207ea8e74ff45be0838afa12bdd2492fa9dc8bc)

Author SHA1 Message Date
Thomas Richter b96e6615cd perf auxtrace: Support for perf report -D for s390
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: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Hendrik 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-08-03 10:34:18 -03:00
Thomas Richter 5d9946c3e5 perf record: Fix s390 undefined record__auxtrace_init() return value
Command 'perf record' calls:

  cmd_report()
    record__auxtrace_init()
       auxtrace_record__init()

On s390 function auxtrace_record__init() returns random return value due
to missing initialization.

This sometime causes 'perf record' to exit immediately without error
message and creating a perf.data file.

Fix this by setting error the return code to zero before returning from
platform specific functions which may not set the error code in call
cases.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Link: http://lkml.kernel.org/r/20180423142940.21143-1-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-04-23 12:05:02 -03:00
Pu Hou a3f22d505f s390/perf: add callback to perf to enable using AUX buffer
Perf tool need implement a callback to enable using AUX buffer. Perf
will do another mmap() to trigger the setup of AUX buffer in kernel
if there is such callback. The default size of the AUX buffer is set
properly according to the sampling frequency to avoid overflow. It
could also be manually set by -m option of perf.

The interface of perf is not changed. Diagnostic mode sampling
could be started by `perf record -e rBD000` like before.

Signed-off-by: Pu Hou <bjhoupu@linux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2017-11-16 15:06:08 +01:00