From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Markus Armbruster" <armbru@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Dr. David Alan Gilbert" <dave@treblig.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Eric Blake" <eblake@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Cameron Esfahani" <dirty@apple.com>,
"Mads Ynddal" <mads@ynddal.dk>,
"Phil Dennis-Jordan" <phil@philjordan.eu>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Roman Bolshakov" <rbolshakov@ddn.com>
Subject: [PATCH-for-10.1 v5 5/7] accel/tcg: Propagate AccelState to tcg_dump_stats()
Date: Tue, 15 Jul 2025 12:40:13 +0200 [thread overview]
Message-ID: <20250715104015.72663-6-philmd@linaro.org> (raw)
In-Reply-To: <20250715104015.72663-1-philmd@linaro.org>
Next commit will register tcg_dump_stats() as AccelClass::get_stats
handler. Since we want this handler to be called with the correct
accelerator state, propagate it along.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/internal-common.h | 2 +-
accel/tcg/monitor.c | 3 ++-
accel/tcg/tcg-stats.c | 7 +++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h
index 77a3a0684a5..847ae3914f5 100644
--- a/accel/tcg/internal-common.h
+++ b/accel/tcg/internal-common.h
@@ -139,6 +139,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr);
-void tcg_dump_stats(GString *buf);
+void tcg_dump_stats(AccelState *accel, GString *buf);
#endif
diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
index adb9de5a1c6..97626da2f1f 100644
--- a/accel/tcg/monitor.c
+++ b/accel/tcg/monitor.c
@@ -7,6 +7,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/accel.h"
#include "qapi/error.h"
#include "qapi/type-helpers.h"
#include "qapi/qapi-commands-machine.h"
@@ -23,7 +24,7 @@ HumanReadableText *qmp_x_query_jit(Error **errp)
return NULL;
}
- tcg_dump_stats(buf);
+ tcg_dump_stats(current_accel(), buf);
return human_readable_text_from_str(buf);
}
diff --git a/accel/tcg/tcg-stats.c b/accel/tcg/tcg-stats.c
index eb6e20ae985..02795570b5c 100644
--- a/accel/tcg/tcg-stats.c
+++ b/accel/tcg/tcg-stats.c
@@ -37,9 +37,8 @@ static void dump_drift_info(GString *buf)
}
}
-static void dump_accel_info(GString *buf)
+static void dump_accel_info(AccelState *accel, GString *buf)
{
- AccelState *accel = current_accel();
bool one_insn_per_tb = object_property_get_bool(OBJECT(accel),
"one-insn-per-tb",
&error_fatal);
@@ -207,9 +206,9 @@ static void dump_exec_info(GString *buf)
tcg_dump_flush_info(buf);
}
-void tcg_dump_stats(GString *buf)
+void tcg_dump_stats(AccelState *accel, GString *buf)
{
- dump_accel_info(buf);
+ dump_accel_info(accel, buf);
dump_exec_info(buf);
dump_drift_info(buf);
}
--
2.49.0
next prev parent reply other threads:[~2025-07-15 10:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 10:40 [PATCH-for-10.1 v5 0/7] accel/system: Add 'info accel' on human monitor Philippe Mathieu-Daudé
2025-07-15 10:40 ` [PATCH-for-10.1 v5 1/7] Revert "accel/tcg: Unregister the RCU before exiting RR thread" Philippe Mathieu-Daudé
2025-07-15 11:19 ` Manos Pitsidianakis
2025-07-15 12:38 ` Richard Henderson
2025-07-15 10:40 ` [PATCH-for-10.1 v5 2/7] accel/tcg: Extract statistic related code to tcg-stats.c Philippe Mathieu-Daudé
2025-07-15 12:44 ` Richard Henderson
2025-07-15 13:18 ` Richard Henderson
2025-07-15 10:40 ` [PATCH-for-10.1 v5 3/7] accel/system: Introduce @x-accel-stats QMP command Philippe Mathieu-Daudé
2025-07-15 10:40 ` [PATCH-for-10.1 v5 4/7] accel/system: Add 'info accel' on human monitor Philippe Mathieu-Daudé
2025-07-15 10:40 ` Philippe Mathieu-Daudé [this message]
2025-07-15 11:19 ` [PATCH-for-10.1 v5 5/7] accel/tcg: Propagate AccelState to tcg_dump_stats() Manos Pitsidianakis
2025-07-15 13:20 ` Richard Henderson
2025-07-15 10:40 ` [PATCH-for-10.1 v5 6/7] accel/tcg: Implement get_[vcpu]_stats() Philippe Mathieu-Daudé
2025-07-15 10:42 ` Philippe Mathieu-Daudé
2025-07-15 12:48 ` Richard Henderson
2025-07-15 13:06 ` Philippe Mathieu-Daudé
2025-07-15 13:18 ` Richard Henderson
2025-07-15 13:26 ` Philippe Mathieu-Daudé
2025-07-15 10:40 ` [PATCH-for-10.1 v5 7/7] accel/hvf: Implement get_vcpu_stats() Philippe Mathieu-Daudé
2025-07-15 10:57 ` Mads Ynddal
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=20250715104015.72663-6-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=dirty@apple.com \
--cc=eblake@redhat.com \
--cc=mads@ynddal.dk \
--cc=manos.pitsidianakis@linaro.org \
--cc=pbonzini@redhat.com \
--cc=phil@philjordan.eu \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rbolshakov@ddn.com \
--cc=richard.henderson@linaro.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).