[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 18/21] linux-user: allow dumping of plugin statu
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [RFC PATCH 18/21] linux-user: allow dumping of plugin status at end of run |
Date: |
Fri, 5 Oct 2018 16:49:07 +0100 |
As we don't have a monitor in linux-user mode we need some way of
exporting our data to the world. We introduce a new -d option (plugin)
which turns on the existing LOG_TRACE flag which qemu_plugin_status()
will dump output to before we finally exit.
Signed-off-by: Alex Bennée <address@hidden>
---
linux-user/exit.c | 12 ++++++++++++
util/log.c | 2 ++
2 files changed, 14 insertions(+)
diff --git a/linux-user/exit.c b/linux-user/exit.c
index 14e94e28fa..2f9e016207 100644
--- a/linux-user/exit.c
+++ b/linux-user/exit.c
@@ -17,12 +17,23 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "qemu/plugins.h"
#include "qemu.h"
#ifdef CONFIG_GCOV
extern void __gcov_dump(void);
#endif
+static void plugin_report(void)
+{
+#ifdef CONFIG_TRACE_PLUGIN
+ GString *plugin_report = qemu_plugin_status("");
+ qemu_log_mask(LOG_TRACE, "%s", plugin_report->str);
+ g_string_free(plugin_report, true);
+#endif
+}
+
+
void preexit_cleanup(CPUArchState *env, int code)
{
#ifdef TARGET_GPROF
@@ -31,5 +42,6 @@ void preexit_cleanup(CPUArchState *env, int code)
#ifdef CONFIG_GCOV
__gcov_dump();
#endif
+ plugin_report();
gdb_exit(env, code);
}
diff --git a/util/log.c b/util/log.c
index 5759bf571f..d4423277e0 100644
--- a/util/log.c
+++ b/util/log.c
@@ -288,6 +288,8 @@ const QEMULogItem qemu_log_items[] = {
{ CPU_LOG_TB_NOCHAIN, "nochain",
"do not chain compiled TBs so that \"exec\" and \"cpu\" show\n"
"complete traces" },
+ { LOG_TRACE, "plugin",
+ "show summary plugin information at end of run." },
{ 0, NULL, NULL },
};
--
2.17.1
- Re: [Qemu-devel] [RFC PATCH 08/21] accel/tcg/cputlb: convert remaining tlb_debug() to trace events, (continued)
[Qemu-devel] [RFC PATCH 04/21] trace: enable the exec_tb trace events, Alex Bennée, 2018/10/05
[Qemu-devel] [RFC PATCH 01/21] util/log: allow -dfilter to stack, Alex Bennée, 2018/10/05
[Qemu-devel] [RFC PATCH 05/21] trace: keep a count of trace-point hits, Alex Bennée, 2018/10/05
[Qemu-devel] [RFC PATCH 18/21] linux-user: allow dumping of plugin status at end of run,
Alex Bennée <=
[Qemu-devel] [RFC PATCH 10/21] qom/cpu: add a cpu_exit trace event, Alex Bennée, 2018/10/05
[Qemu-devel] [RFC PATCH 12/21] configure: expose a plugin to the trace-backends, Alex Bennée, 2018/10/05
[Qemu-devel] [RFC PATCH 13/21] tracetool: generate plugin snippets, Alex Bennée, 2018/10/05
[Qemu-devel] [RFC PATCH 09/21] trace: suppress log output of trace points, Alex Bennée, 2018/10/05
[Qemu-devel] [RFC PATCH 02/21] util/log: add qemu_dfilter_append_range(), Alex Bennée, 2018/10/05