[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH RESEND 22/42] accel/split: Add few trace events in cpu_thread
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH RESEND 22/42] accel/split: Add few trace events in cpu_thread_routine handler |
Date: |
Fri, 20 Jun 2025 19:27:30 +0200 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
meson.build | 1 +
accel/split/trace.h | 2 ++
accel/split/split-accel-ops.c | 7 +++++++
accel/split/trace-events | 9 +++++++++
4 files changed, 19 insertions(+)
create mode 100644 accel/split/trace.h
create mode 100644 accel/split/trace-events
diff --git a/meson.build b/meson.build
index 5004678a26b..06c32e0e958 100644
--- a/meson.build
+++ b/meson.build
@@ -3635,6 +3635,7 @@ if have_system
trace_events_subdirs += [
'accel/hvf',
'accel/kvm',
+ 'accel/split',
'audio',
'backends',
'backends/tpm',
diff --git a/accel/split/trace.h b/accel/split/trace.h
new file mode 100644
index 00000000000..46b45388930
--- /dev/null
+++ b/accel/split/trace.h
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include "trace/trace-accel_split.h"
diff --git a/accel/split/split-accel-ops.c b/accel/split/split-accel-ops.c
index 1766834d537..399bf71a9ec 100644
--- a/accel/split/split-accel-ops.c
+++ b/accel/split/split-accel-ops.c
@@ -17,6 +17,7 @@
#include "system/hw_accel.h"
#include "system/tcg.h"
#include "split-accel.h"
+#include "trace.h"
#include "accel/accel-internal.h"
#include "accel/tcg/tcg-accel-ops-mttcg.h"
@@ -64,13 +65,18 @@ static void *split_cpu_thread_routine(void *arg)
if (cpu_can_run(cpu)) {
if (acs->use_hw) {
r = hwops->exec_vcpu_thread(cpu);
+ trace_accel_split_exec_vcpu_thread_hw(r);
} else {
r = swops->exec_vcpu_thread(cpu);
+ trace_accel_split_exec_vcpu_thread_sw(r);
}
switch (r) {
case 0:
if (acs->use_hw) {
acs->use_hw = cpu_acceleratable(cpu);
+ if (!acs->use_hw) {
+ trace_accel_split_sw_emulate();
+ }
}
break;
case EXCP_INTERRUPT:
@@ -95,6 +101,7 @@ static void *split_cpu_thread_routine(void *arg)
break;
case EXCP_HWACCEL:
assert(!acs->use_hw);
+ trace_accel_split_hw_accelerate();
acs->use_hw = true;
break;
default:
diff --git a/accel/split/trace-events b/accel/split/trace-events
new file mode 100644
index 00000000000..c0b9fd97d1d
--- /dev/null
+++ b/accel/split/trace-events
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# See docs/devel/tracing.rst for syntax documentation.
+
+# split-accel-ops.c
+accel_split_exec_vcpu_thread_sw(int retval) "sw: rv:0x%x"
+accel_split_exec_vcpu_thread_hw(int retval) "hw: rv:0x%x"
+accel_split_hw_accelerate(void) ""
+accel_split_sw_emulate(void) ""
--
2.49.0
- [RFC PATCH RESEND 00/42] accel/split/arm: Run EL2 using TCG and EL1/EL0 in hardware with HVF, Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 03/42] accel/split: Implement cpus_are_resettable(), Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 22/42] accel/split: Add few trace events in cpu_thread_routine handler,
Philippe Mathieu-Daudé <=
- [RFC PATCH RESEND 30/42] accel/split: Implement remove_all_breakpoints(), Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 32/42] accel/split: Implement insert_breakpoint(), Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 38/42] accel/tcg: Introduce TCGCPUOps::rebuild_tb_hflags handler, Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 02/42] accel/split: Define SplitAccelState, Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 06/42] accel/split: Empty setup_post(), Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 15/42] accel/split: Implement synchronize_pre_resume(), Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 20/42] accel/split: Implement cpu_common_realize(), Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 18/42] accel/split: Implement synchronize_pre_loadvm(), Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 36/42] target/arm: Have ERET switch to hw accel for EL0/EL1, Philippe Mathieu-Daudé, 2025/06/20
- [RFC PATCH RESEND 39/42] target/arm: Implement TCGCPUOps::rebuild_tb_hflags(), Philippe Mathieu-Daudé, 2025/06/20