All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf kvm: Fix arm64 VM-exit duration accounting
@ 2026-10-31 12:01 lirongqing
  2026-10-31 12:05 ` sashiko-bot
  2026-11-04 11:17 ` Leo Yan
  0 siblings, 2 replies; 4+ 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 related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-04 21:19 UTC | newest]

Thread overview: 4+ 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-10-31 12:05 ` sashiko-bot
2026-11-04 11:17 ` Leo Yan
2026-11-04 21:19   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.