From: Leo Yan <leo.yan@linaro.org>
To: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
John Garry <john.garry@huawei.com>,
James Clark <james.clark@arm.com>,
Mike Leach <mike.leach@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org
Cc: Leo Yan <leo.yan@linaro.org>
Subject: [PATCH v1 0/3] KVM: arm64: Support tracing virtual CPU ID
Date: Sat, 5 Nov 2022 07:23:08 +0000 [thread overview]
Message-ID: <20221105072311.8214-1-leo.yan@linaro.org> (raw)
Before there have some efforts and discussion for supprot tracing
virtual CPU ID in Arm64 KVM, see [1][2].
The issue was blocked with a main concern that we cannot change the
existed trace events to avoid ABI breakage. So the question is how
we add new trace events with tracing virtual CPU ID and also need to
keep backward compatibility.
This patch set is to restart the work, it's inspired by Qais Yousef's
work for adding scheduler tracepoints [3].
The first patch changes to register tracepoint callbacks, this can allow
us to support multiple trace events with a single call site, it's a
preparation to add new trace events.
The second patch is to add two new trace events kvm_entry_v2 and
kvm_exit_v2, and these two trace events contain the field "vcpu_id" for
virtual CPU ID.
For more complete view, the third patch is the change in perf tool.
It dynamically detects trace nodes under sysfs and decide to use the
version 2's trace events or rollback to use original events.
This patch set has been tested with mainline kernel on Arm64 Ampere
Altra platform.
Note: I used checkpatch.pl to validate patches format and observed it
reports error for second patch for adding trace events; since the trace
event definition uses its own coding style, I just keep as it is.
[1] https://lore.kernel.org/lkml/1560330526-15468-2-git-send-email-yuzenghui@huawei.com/
[2] https://lore.kernel.org/lkml/20200917003645.689665-1-sergey.senozhatsky@gmail.com/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/kernel/sched/core.c?id=a056a5bed7fa67706574b00cf1122c38596b2be1
Leo Yan (3):
KVM: arm64: Dynamically register callback for tracepoints
KVM: arm64: Add trace events with field 'vcpu_id'
perf arm64: Support virtual CPU ID for kvm-stat
arch/arm64/kvm/Makefile | 2 +-
arch/arm64/kvm/arm.c | 4 +-
arch/arm64/kvm/trace.c | 35 +++++++++++++++++
arch/arm64/kvm/trace_arm.h | 53 ++++++++++++++++++++++++++
tools/perf/arch/arm64/util/kvm-stat.c | 54 ++++++++++++++++++++++++---
5 files changed, 140 insertions(+), 8 deletions(-)
create mode 100644 arch/arm64/kvm/trace.c
--
2.34.1
next reply other threads:[~2022-11-05 7:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-05 7:23 Leo Yan [this message]
2022-11-05 7:23 ` [PATCH v1 1/3] KVM: arm64: Dynamically register callback for tracepoints Leo Yan
2022-11-05 7:23 ` [PATCH v1 2/3] KVM: arm64: Add trace events with field 'vcpu_id' Leo Yan
2022-11-05 7:23 ` [PATCH v1 3/3] perf arm64: Support virtual CPU ID for kvm-stat Leo Yan
2022-11-05 13:28 ` Marc Zyngier
2022-11-07 14:47 ` Leo Yan
2022-11-07 15:39 ` Marc Zyngier
2022-11-08 11:49 ` Leo Yan
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=20221105072311.8214-1-leo.yan@linaro.org \
--to=leo.yan@linaro.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexandru.elisei@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.clark@arm.com \
--cc=james.morse@arm.com \
--cc=john.garry@huawei.com \
--cc=jolsa@kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=mike.leach@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=peterz@infradead.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).