aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/perf-iostat.sh
diff options
context:
space:
mode:
authorAlexander Antonov <alexander.antonov@linux.intel.com>2021-04-19 12:41:46 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-04-20 08:40:20 -0300
commitf9ed693e8bc0e7de9eb766a3c7178590e8bb6cd5 (patch)
tree492dd71987ce6a737929aaa04457d40808470c6d /tools/perf/perf-iostat.sh
parentperf stat: Helper functions for PCIe root ports list in iostat mode (diff)
downloadlinux-dev-f9ed693e8bc0e7de9eb766a3c7178590e8bb6cd5.tar.xz
linux-dev-f9ed693e8bc0e7de9eb766a3c7178590e8bb6cd5.zip
perf stat: Enable iostat mode for x86 platforms
This functionality is based on recently introduced sysfs attributes for Intel® Xeon® Scalable processor family (code name Skylake-SP): Commit bb42b3d39781d7fc ("perf/x86/intel/uncore: Expose an Uncore unit to IIO PMON mapping") Mode is intended to provide four I/O performance metrics in MB per each PCIe root port: - Inbound Read: I/O devices below root port read from the host memory - Inbound Write: I/O devices below root port write to the host memory - Outbound Read: CPU reads from I/O devices below root port - Outbound Write: CPU writes to I/O devices below root port Each metric requiries only one uncore event which increments at every 4B transfer in corresponding direction. The formulas to compute metrics are generic: #EventCount * 4B / (1024 * 1024) Acked-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Alexander Antonov <alexander.antonov@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey V Bayduraev <alexey.v.bayduraev@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20210419094147.15909-4-alexander.antonov@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/perf-iostat.sh')
-rw-r--r--tools/perf/perf-iostat.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/perf-iostat.sh b/tools/perf/perf-iostat.sh
new file mode 100644
index 000000000000..e562f252d56f
--- /dev/null
+++ b/tools/perf/perf-iostat.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# perf iostat
+# Alexander Antonov <alexander.antonov@linux.intel.com>
+
+if [[ "$1" == "list" ]] || [[ "$1" =~ ([a-f0-9A-F]{1,}):([a-f0-9A-F]{1,2})(,)? ]]; then
+ DELIMITER="="
+else
+ DELIMITER=" "
+fi
+
+perf stat --iostat$DELIMITER$*