[RFT PATCH v2 0/7] perf tool: Support iostat for multiple platform
From: Yushan Wang
Date: Thu May 07 2026 - 02:41:02 EST
Currently, platform-specific iostat code for PMUs is implemented as a
common iostat callback interface and invoked based on what is being
built. This approach limits support for iostat across different types of
PMUs.
Support of HiSilicon PCIe PMU iostat was raised at [1], which uses the
similar approach.
To extend support of iostat across platforms, change common iostat
interface to framework to allow perf to probe PMU capabilities during
runtime and route iostat request to the correct PMU-specific functions.
Then HiSilicon PCIe PMU iostat is supported with the new framework.
Request For Test:
Refactors has been made to x86 iostat to adapt the iostat framework, the
probe function that checks if there's any PMU's name contains
'uncore_iio' may not work properly, tests of that would be appreciated.
[1] https://lore.kernel.org/all/20240208032518.25830-1-yangyicong@xxxxxxxxxx/
Changes:
RFT v2:
- Replace typedefs with plain function pointer declaration.
- Replace _Bool with bool with the help of stdbool.h.
- Moved architecture-specific iostat implementation code to utils
directory per Ian.
- Dropped PMU wildcard matching variation, and changed pmu_name to
pmu_name_wildcard for wildcard PMU name matching.
- Changed PMU name pattern of x86 iostat to "uncore_iio".
- Minor refactors to iostat framework.
Link: https://lore.kernel.org/all/20260126123514.3238425-1-wangyushan12@xxxxxxxxxx
Shiju Jose (2):
perf-iostat: Extend iostat interface to support different iostat PMUs
perf-iostat: Make x86 iostat compatible with new iostat framework
Yicong Yang (1):
perf-iostat: Enable iostat mode for HiSilicon PCIe PMU
Yushan Wang (4):
perf stat: Check color's length instead of the pointer
perf stat: Save unnecessary print_metric() call
perf-x86: iostat: Move iostat arch-specific implementation to util
perf-x86: iostat: Change iostat_prefix() to static
tools/perf/arch/x86/util/Build | 1 -
tools/perf/builtin-script.c | 2 +-
tools/perf/util/Build | 2 +
tools/perf/util/hisi-iostat.c | 478 ++++++++++++++++++
tools/perf/util/iostat.c | 89 +++-
tools/perf/util/iostat.h | 40 +-
tools/perf/util/stat-display.c | 4 +-
tools/perf/util/stat-shadow.c | 4 +-
.../x86/util/iostat.c => util/x86-iostat.c} | 100 ++--
9 files changed, 650 insertions(+), 70 deletions(-)
create mode 100644 tools/perf/util/hisi-iostat.c
rename tools/perf/{arch/x86/util/iostat.c => util/x86-iostat.c} (85%)
--
2.33.0