public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: acme@kernel.org
Cc: aditya.b1@linux.ibm.com, adrian.hunter@intel.com,
	ajones@ventanamicro.com,  ak@linux.intel.com, alex@ghiti.fr,
	alexander.shishkin@linux.intel.com,  anup@brainfault.org,
	aou@eecs.berkeley.edu, ashelat@redhat.com,
	 atrajeev@linux.ibm.com, blakejones@google.com,
	ctshao@google.com,  dapeng1.mi@linux.intel.com,
	dvyukov@google.com, howardchu95@gmail.com,  irogers@google.com,
	james.clark@linaro.org, john.g.garry@oracle.com,
	 jolsa@kernel.org, leo.yan@linux.dev,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	 linux-riscv@lists.infradead.org, mingo@redhat.com,
	namhyung@kernel.org,  palmer@dabbelt.com, peterz@infradead.org,
	pjw@kernel.org,  shimin.guo@skydio.com, swapnil.sapkal@amd.com,
	thomas.falcon@intel.com,  will@kernel.org, ysk@kzalloc.com,
	zhouquan@iscas.ac.cn
Subject: [PATCH v3 0/5] perf Cross platform KVM support
Date: Tue,  3 Feb 2026 10:26:35 -0800	[thread overview]
Message-ID: <20260203182640.3911987-1-irogers@google.com> (raw)
In-Reply-To: <aYIOMWb2sijXzSDm@x1>

The existing perf kvm code is using the arch directory, which means a
data file can only be processed on the same machine type that it was
recorded. Switch to using the ELF machine of the session at runtime to
set up the KVM support, making it cross-architectural. So that the ELF
machine number is available early in initialization add it to the perf
data file header.

v3: Fix NO_LIBTRACEEVENT=1 build, kvm-stat-loongarch.c for old elf.h
    files and 32-bit build of kvm-stat-s390.c as reported by
    Arnaldo. Drop the first kvm stat live test patch that Arnaldo
    reported as merged.

v2: Wire up the perf data header to have the e_machine and allow early
    initialization of the KVM operations based upon it.
    https://lore.kernel.org/lkml/20260131200224.1296136-1-irogers@google.com/#t

v1: https://lore.kernel.org/lkml/20260128074106.788156-1-irogers@google.com/

Ian Rogers (5):
  perf kvm stat: Remove use of the arch directory
  perf kvm: Wire up e_machine
  perf session: Add e_flags to the e_machine helper
  perf header: Add e_machine/e_flags to the header
  perf thread: Don't require machine to compute the e_machine

 tools/perf/Makefile.config                    |   4 -
 tools/perf/arch/arm64/Makefile                |   1 -
 tools/perf/arch/arm64/util/Build              |   1 -
 tools/perf/arch/loongarch/Makefile            |   1 -
 tools/perf/arch/loongarch/util/Build          |   1 -
 tools/perf/arch/powerpc/Makefile              |   1 -
 tools/perf/arch/powerpc/util/Build            |   1 -
 tools/perf/arch/riscv/Makefile                |   1 -
 tools/perf/arch/riscv/util/Build              |   2 -
 tools/perf/arch/s390/Makefile                 |   1 -
 tools/perf/arch/s390/util/Build               |   1 -
 tools/perf/arch/x86/Makefile                  |   1 -
 tools/perf/arch/x86/util/Build                |   1 -
 tools/perf/builtin-kvm.c                      |  73 +++---
 tools/perf/builtin-report.c                   |   4 +-
 tools/perf/builtin-script.c                   |   6 +-
 tools/perf/util/Build                         |   3 +-
 tools/perf/util/env.h                         |   3 +
 tools/perf/util/evsel.c                       |   6 +-
 tools/perf/util/evsel.h                       |   1 +
 tools/perf/util/header.c                      |  33 +++
 tools/perf/util/header.h                      |   1 +
 tools/perf/util/kvm-stat-arch/Build           |   6 +
 .../kvm-stat-arch}/arm64_exception_types.h    |   0
 .../kvm-stat-arch}/book3s_hcalls.h            |   0
 .../kvm-stat-arch}/book3s_hv_exits.h          |   0
 .../kvm-stat-arch/kvm-stat-arm64.c}           |  43 ++--
 .../kvm-stat-arch/kvm-stat-loongarch.c}       |  49 ++--
 .../kvm-stat-arch/kvm-stat-powerpc.c}         |  61 ++---
 .../kvm-stat-arch/kvm-stat-riscv.c}           |  42 ++--
 .../kvm-stat-arch/kvm-stat-s390.c}            |  40 ++--
 .../kvm-stat-arch/kvm-stat-x86.c}             |  44 ++--
 .../kvm-stat-arch}/riscv_trap_types.h         |   2 +-
 tools/perf/util/kvm-stat.c                    | 215 +++++++++++++++++-
 tools/perf/util/kvm-stat.h                    |  79 +++++--
 .../scripting-engines/trace-event-python.c    |   8 +-
 tools/perf/util/session.c                     |  62 ++++-
 tools/perf/util/session.h                     |   2 +-
 tools/perf/util/thread.c                      |   5 +
 39 files changed, 590 insertions(+), 215 deletions(-)
 create mode 100644 tools/perf/util/kvm-stat-arch/Build
 rename tools/perf/{arch/arm64/util => util/kvm-stat-arch}/arm64_exception_types.h (100%)
 rename tools/perf/{arch/powerpc/util => util/kvm-stat-arch}/book3s_hcalls.h (100%)
 rename tools/perf/{arch/powerpc/util => util/kvm-stat-arch}/book3s_hv_exits.h (100%)
 rename tools/perf/{arch/arm64/util/kvm-stat.c => util/kvm-stat-arch/kvm-stat-arm64.c} (62%)
 rename tools/perf/{arch/loongarch/util/kvm-stat.c => util/kvm-stat-arch/kvm-stat-loongarch.c} (77%)
 rename tools/perf/{arch/powerpc/util/kvm-stat.c => util/kvm-stat-arch/kvm-stat-powerpc.c} (78%)
 rename tools/perf/{arch/riscv/util/kvm-stat.c => util/kvm-stat-arch/kvm-stat-riscv.c} (57%)
 rename tools/perf/{arch/s390/util/kvm-stat.c => util/kvm-stat-arch/kvm-stat-s390.c} (77%)
 rename tools/perf/{arch/x86/util/kvm-stat.c => util/kvm-stat-arch/kvm-stat-x86.c} (88%)
 rename tools/perf/{arch/riscv/util => util/kvm-stat-arch}/riscv_trap_types.h (96%)

-- 
2.53.0.rc2.204.g2597b5adb4-goog



  reply	other threads:[~2026-02-03 18:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-31 20:02 [PATCH v2 0/6] perf Cross platform KVM support Ian Rogers
2026-01-31 20:02 ` [PATCH v2 1/6] perf test kvm: Add stat live testing Ian Rogers
2026-01-31 20:02 ` [PATCH v2 2/6] perf kvm stat: Remove use of the arch directory Ian Rogers
2026-02-01 17:04   ` Leo Yan
2026-02-02  1:55     ` Ian Rogers
2026-01-31 20:02 ` [PATCH v2 3/6] perf kvm: Wire up e_machine Ian Rogers
2026-01-31 20:02 ` [PATCH v2 4/6] perf session: Add e_flags to the e_machine helper Ian Rogers
2026-01-31 20:02 ` [PATCH v2 5/6] perf header: Add e_machine/e_flags to the header Ian Rogers
2026-01-31 20:02 ` [PATCH v2 6/6] perf thread: Don't require machine to compute the e_machine Ian Rogers
2026-02-03 14:42 ` [PATCH v2 0/6] perf Cross platform KVM support Arnaldo Carvalho de Melo
2026-02-03 14:57   ` Arnaldo Carvalho de Melo
2026-02-03 15:03     ` Arnaldo Carvalho de Melo
2026-02-03 18:26       ` Ian Rogers [this message]
2026-02-03 18:26         ` [PATCH v3 1/5] perf kvm stat: Remove use of the arch directory Ian Rogers
2026-03-24  6:07           ` patchwork-bot+linux-riscv
2026-02-03 18:26         ` [PATCH v3 2/5] perf kvm: Wire up e_machine Ian Rogers
2026-02-03 18:26         ` [PATCH v3 3/5] perf session: Add e_flags to the e_machine helper Ian Rogers
2026-02-03 18:26         ` [PATCH v3 4/5] perf header: Add e_machine/e_flags to the header Ian Rogers
2026-02-03 18:26         ` [PATCH v3 5/5] perf thread: Don't require machine to compute the e_machine Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260203182640.3911987-1-irogers@google.com \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=aditya.b1@linux.ibm.com \
    --cc=adrian.hunter@intel.com \
    --cc=ajones@ventanamicro.com \
    --cc=ak@linux.intel.com \
    --cc=alex@ghiti.fr \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=ashelat@redhat.com \
    --cc=atrajeev@linux.ibm.com \
    --cc=blakejones@google.com \
    --cc=ctshao@google.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=dvyukov@google.com \
    --cc=howardchu95@gmail.com \
    --cc=james.clark@linaro.org \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=peterz@infradead.org \
    --cc=pjw@kernel.org \
    --cc=shimin.guo@skydio.com \
    --cc=swapnil.sapkal@amd.com \
    --cc=thomas.falcon@intel.com \
    --cc=will@kernel.org \
    --cc=ysk@kzalloc.com \
    --cc=zhouquan@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox