linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] perf stat: Introduce iiostat mode to provide I/O performance metrics
@ 2020-12-23 13:03 Alexander Antonov
  2020-12-23 13:03 ` [PATCH v2 1/6] perf stat: Add AGGR_IIO_STACK mode Alexander Antonov
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Alexander Antonov @ 2020-12-23 13:03 UTC (permalink / raw)
  To: acme
  Cc: linux-kernel, jolsa, ak, alexander.shishkin, mark.rutland,
	namhyung, irogers, mingo, peterz, alexander.antonov

The previous version can be found at:
v1: https://lkml.kernel.org/r/20201210090340.14358-1-alexander.antonov@linux.intel.com

Changes in this revision are:
v1 -> v2:
  1. Using 'perf iiostat' subcommand instead of 'perf stat --iiostat':
    - Added perf-iiostat.sh script to use short command
    - Updated manual pages to get help for 'perf iiostat'
    - Added 'perf-iiostat' to perf's gitignore file

Mode is intended to provide four I/O performance metrics in MB per each
IIO stack:
 - Inbound Read:   I/O devices below IIO stack read from the host memory
 - Inbound Write:  I/O devices below IIO stack write to the host memory
 - Outbound Read:  CPU reads from I/O devices below IIO stack
 - Outbound Write: CPU writes to I/O devices below IIO stack

Each metric requiries only one IIO event which increments at every 4B
transfer in corresponding direction. The formulas to compute metrics
are generic:
    #EventCount * 4B / (1024 * 1024)

Note: iiostat introduces new perf data aggregation mode - per I/O stack
hence -e and -M options are not supported.

Usage examples:

1. List all IIO stacks (example for 2-S platform):
   $ perf iiostat show
   S0-uncore_iio_0<0000:00>
   S1-uncore_iio_0<0000:80>
   S0-uncore_iio_1<0000:17>
   S1-uncore_iio_1<0000:85>
   S0-uncore_iio_2<0000:3a>
   S1-uncore_iio_2<0000:ae>
   S0-uncore_iio_3<0000:5d>
   S1-uncore_iio_3<0000:d7>

2. Collect metrics for all I/O stacks:
   $ perf iiostat -- dd if=/dev/zero of=/dev/nvme0n1 bs=1M oflag=direct
   357708+0 records in
   357707+0 records out
   375083606016 bytes (375 GB, 349 GiB) copied, 215.974 s, 1.7 GB/s

    Performance counter stats for 'system wide':

      port             Inbound Read(MB)    Inbound Write(MB)    Outbound Read(MB)   Outbound Write(MB) 
   0000:00                    1                    0                    2                    3 
   0000:80                    0                    0                    0                    0 
   0000:17               352552                   43                    0                   21 
   0000:85                    0                    0                    0                    0 
   0000:3a                    3                    0                    0                    0 
   0000:ae                    0                    0                    0                    0 
   0000:5d                    0                    0                    0                    0 
   0000:d7                    0                    0                    0                    0

3. Collect metrics for comma separated list of I/O stacks:
   $ perf iiostat 0000:17,0:3a -- dd if=/dev/zero of=/dev/nvme0n1 bs=1M oflag=direct
   357708+0 records in
   357707+0 records out
   375083606016 bytes (375 GB, 349 GiB) copied, 197.08 s, 1.9 GB/s

    Performance counter stats for 'system wide':

      port             Inbound Read(MB)    Inbound Write(MB)    Outbound Read(MB)   Outbound Write(MB) 
   0000:17               358559                   44                    0                   22 
   0000:3a                    3                    2                    0                    0 

        197.081983474 seconds time elapsed


Alexander Antonov (6):
  perf stat: Add AGGR_IIO_STACK mode
  perf evsel: Introduce an observed performance device
  perf stat: Basic support for iiostat in perf
  perf stat: Helper functions for IIO stacks list in iiostat mode
  perf stat: Enable iiostat mode for x86 platforms
  perf: Update .gitignore file

 tools/perf/.gitignore                         |   1 +
 tools/perf/Documentation/perf-iiostat.txt     |  89 ++++
 tools/perf/Makefile.perf                      |   5 +-
 tools/perf/arch/x86/util/Build                |   1 +
 tools/perf/arch/x86/util/iiostat.c            | 462 ++++++++++++++++++
 tools/perf/builtin-stat.c                     |  40 +-
 tools/perf/command-list.txt                   |   1 +
 tools/perf/perf-iiostat.sh                    |  12 +
 tools/perf/util/evsel.h                       |   1 +
 tools/perf/util/iiostat.h                     |  33 ++
 .../scripting-engines/trace-event-python.c    |   2 +-
 tools/perf/util/stat-display.c                |  51 +-
 tools/perf/util/stat-shadow.c                 |  11 +-
 tools/perf/util/stat.c                        |   3 +-
 tools/perf/util/stat.h                        |   2 +
 15 files changed, 704 insertions(+), 10 deletions(-)
 create mode 100644 tools/perf/Documentation/perf-iiostat.txt
 create mode 100644 tools/perf/arch/x86/util/iiostat.c
 create mode 100644 tools/perf/perf-iiostat.sh
 create mode 100644 tools/perf/util/iiostat.h


base-commit: 644bf4b0f7acde641d3db200b4db66977e96c3bd
-- 
2.19.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-01-15 14:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 13:03 [PATCH v2 0/6] perf stat: Introduce iiostat mode to provide I/O performance metrics Alexander Antonov
2020-12-23 13:03 ` [PATCH v2 1/6] perf stat: Add AGGR_IIO_STACK mode Alexander Antonov
2020-12-23 13:03 ` [PATCH v2 2/6] perf evsel: Introduce an observed performance device Alexander Antonov
2021-01-06  8:44   ` Namhyung Kim
2021-01-13 11:13     ` Alexander Antonov
2020-12-23 13:03 ` [PATCH v2 3/6] perf stat: Basic support for iiostat in perf Alexander Antonov
2021-01-06  8:56   ` Namhyung Kim
2021-01-13 11:34     ` Alexander Antonov
2021-01-14  3:34       ` Namhyung Kim
2021-01-14 16:30         ` Alexander Antonov
2020-12-23 13:03 ` [PATCH v2 4/6] perf stat: Helper functions for IIO stacks list in iiostat mode Alexander Antonov
2020-12-23 13:03 ` [PATCH v2 5/6] perf stat: Enable iiostat mode for x86 platforms Alexander Antonov
2021-01-06  9:02   ` Namhyung Kim
2021-01-13 12:08     ` Alexander Antonov
2021-01-14  3:39       ` Namhyung Kim
2021-01-14 16:41         ` Alexander Antonov
2021-01-15  7:33           ` Namhyung Kim
2021-01-15 14:34             ` Alexander Antonov
2020-12-23 13:03 ` [PATCH v2 6/6] perf: Update .gitignore file Alexander Antonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).