Re: [RFT PATCH v2 3/7] perf-x86: iostat: Move iostat arch-specific implementation to util

From: Ian Rogers

Date: Thu May 07 2026 - 11:38:25 EST


On Wed, May 6, 2026 at 11:37 PM Yushan Wang <wangyushan12@xxxxxxxxxx> wrote:
>
> To support cross-platform iostat capabilities, like record/report on
> different platforms, architecture-specific implementation of iostat
> should be moved out of arch directory to get built. Build scripts are
> changed accordingly.
>
> Signed-off-by: Yushan Wang <wangyushan12@xxxxxxxxxx>
> ---
> tools/perf/arch/x86/util/Build | 1 -
> tools/perf/util/Build | 1 +
> tools/perf/{arch/x86/util/iostat.c => util/x86-iostat.c} | 0
> 3 files changed, 1 insertion(+), 1 deletion(-)
> rename tools/perf/{arch/x86/util/iostat.c => util/x86-iostat.c} (100%)

To avoid cluttering up tools/perf/util, would it make sense to create
a "tools/perf/util/iostat-arch" directory similar to annotate-arch,
dwarf-regs-arch, kvm-stat-arch and perf-regs-arch?

Thanks,
Ian

> diff --git a/tools/perf/arch/x86/util/Build b/tools/perf/arch/x86/util/Build
> index b94c91984c66..358541beaa0f 100644
> --- a/tools/perf/arch/x86/util/Build
> +++ b/tools/perf/arch/x86/util/Build
> @@ -7,7 +7,6 @@ perf-util-y += event.o
> perf-util-y += evlist.o
> perf-util-y += mem-events.o
> perf-util-y += evsel.o
> -perf-util-y += iostat.o
>
> perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
>
> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> index 70cc91d00804..c7e5ada3800d 100644
> --- a/tools/perf/util/Build
> +++ b/tools/perf/util/Build
> @@ -127,6 +127,7 @@ perf-util-y += thread-stack.o
> perf-util-y += spark.o
> perf-util-y += topdown.o
> perf-util-y += iostat.o
> +perf-util-y += x86-iostat.o
> perf-util-y += stream.o
> perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o
> perf-util-y += kvm-stat-arch/
> diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/util/x86-iostat.c
> similarity index 100%
> rename from tools/perf/arch/x86/util/iostat.c
> rename to tools/perf/util/x86-iostat.c
> --
> 2.33.0
>