* [PATCH] perf kvm: Fix arm64 VM-exit duration accounting
@ 2026-10-31 12:01 lirongqing
2026-11-04 11:17 ` Leo Yan
0 siblings, 1 reply; 3+ messages in thread
From: lirongqing @ 2026-10-31 12:01 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, James Clark, Li RongQing,
Sergey Senozhatsky, Leo Yan, linux-perf-users, linux-kernel
From: Li RongQing <lirongqing@baidu.com>
Use kvm_exit as the start event and the following kvm_entry as the
end event for arm64 VM-exit statistics. Keep decoding ret and esr_ec
from the exit sample.
Before this change, arm64 measured guest runtime as VM-exit time.
Fixes: 1218838d68f5 ("perf kvm: Add kvm-stat for arm64")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
tools/perf/util/kvm-stat-arch/kvm-stat-arm64.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/perf/util/kvm-stat-arch/kvm-stat-arm64.c b/tools/perf/util/kvm-stat-arch/kvm-stat-arm64.c
index 018b0db..ff853ef 100644
--- a/tools/perf/util/kvm-stat-arch/kvm-stat-arm64.c
+++ b/tools/perf/util/kvm-stat-arch/kvm-stat-arm64.c
@@ -36,13 +36,7 @@ static void event_get_key(struct perf_sample *sample,
}
static bool event_begin(struct perf_sample *sample,
- struct event_key *key __maybe_unused)
-{
- return evsel__name_is(sample->evsel, kvm_entry_trace(EM_AARCH64));
-}
-
-static bool event_end(struct perf_sample *sample,
- struct event_key *key)
+ struct event_key *key)
{
if (evsel__name_is(sample->evsel, kvm_exit_trace(EM_AARCH64))) {
event_get_key(sample, key);
@@ -51,6 +45,12 @@ static bool event_end(struct perf_sample *sample,
return false;
}
+static bool event_end(struct perf_sample *sample,
+ struct event_key *key __maybe_unused)
+{
+ return evsel__name_is(sample->evsel, kvm_entry_trace(EM_AARCH64));
+}
+
static const struct kvm_events_ops exit_events = {
.is_begin_event = event_begin,
.is_end_event = event_end,
--
2.9.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf kvm: Fix arm64 VM-exit duration accounting
2026-10-31 12:01 [PATCH] perf kvm: Fix arm64 VM-exit duration accounting lirongqing
@ 2026-11-04 11:17 ` Leo Yan
2026-11-04 21:19 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Leo Yan @ 2026-11-04 11:17 UTC (permalink / raw)
To: lirongqing
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, James Clark, Sergey Senozhatsky,
Leo Yan, linux-perf-users, linux-kernel
On Sat, Oct 31, 2026 at 08:01:23PM +0800, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> Use kvm_exit as the start event and the following kvm_entry as the
> end event for arm64 VM-exit statistics. Keep decoding ret and esr_ec
> from the exit sample.
>
> Before this change, arm64 measured guest runtime as VM-exit time.
>
> Fixes: 1218838d68f5 ("perf kvm: Add kvm-stat for arm64")
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
Thanks for the fix!
Reviewed-by: Leo Yan <leo.yan@arm.com>
Since arm64 requires the exit reason, we cannot directly use the common
exit_event_begin()/exit_event_end() callbacks as other archs do.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf kvm: Fix arm64 VM-exit duration accounting
2026-11-04 11:17 ` Leo Yan
@ 2026-11-04 21:19 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-11-04 21:19 UTC (permalink / raw)
To: Leo Yan
Cc: lirongqing, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Ian Rogers,
Adrian Hunter, James Clark, Sergey Senozhatsky, Leo Yan,
linux-perf-users, linux-kernel
On Wed, Nov 04, 2026 at 11:17:51AM +0000, Leo Yan wrote:
> On Sat, Oct 31, 2026 at 08:01:23PM +0800, lirongqing wrote:
> > From: Li RongQing <lirongqing@baidu.com>
> >
> > Use kvm_exit as the start event and the following kvm_entry as the
> > end event for arm64 VM-exit statistics. Keep decoding ret and esr_ec
> > from the exit sample.
> >
> > Before this change, arm64 measured guest runtime as VM-exit time.
> >
> > Fixes: 1218838d68f5 ("perf kvm: Add kvm-stat for arm64")
> > Signed-off-by: Li RongQing <lirongqing@baidu.com>
>
> Thanks for the fix!
>
> Reviewed-by: Leo Yan <leo.yan@arm.com>
>
> Since arm64 requires the exit reason, we cannot directly use the common
> exit_event_begin()/exit_event_end() callbacks as other archs do.
Thanks, applied for v7.4.
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-04 21:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-31 12:01 [PATCH] perf kvm: Fix arm64 VM-exit duration accounting lirongqing
2026-11-04 11:17 ` Leo Yan
2026-11-04 21:19 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®