[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 15/21] trace: add linux-user plugin support
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [RFC PATCH 15/21] trace: add linux-user plugin support |
Date: |
Fri, 5 Oct 2018 16:49:04 +0100 |
From: Aaron Lindsay <address@hidden>
Signed-off-by: Aaron Lindsay <address@hidden>
[AJB: ifdeffery]
Signed-off-by: Alex Bennée <address@hidden>
---
linux-user/main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index a68674d0de..9fbb827fe0 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -38,6 +38,7 @@
#include "trace/control.h"
#include "target_elf.h"
#include "cpu_loop-common.h"
+#include "qemu/plugins.h"
char *exec_path;
@@ -393,6 +394,13 @@ static void handle_arg_trace(const char *arg)
trace_file = trace_opt_parse(arg);
}
+#ifdef CONFIG_TRACE_PLUGIN
+static void handle_arg_plugin(const char *arg)
+{
+ qemu_plugin_parse_cmd_args(arg);
+}
+#endif
+
struct qemu_argument {
const char *argv;
const char *env;
@@ -444,6 +452,10 @@ static const struct qemu_argument arg_table[] = {
"", "Seed for pseudo-random number generator"},
{"trace", "QEMU_TRACE", true, handle_arg_trace,
"", "[[enable=]<pattern>][,events=<file>][,file=<file>]"},
+#ifdef CONFIG_TRACE_PLUGIN
+ {"plugin", "QEMU_PLUGIN", true, handle_arg_plugin,
+ "", "file=<plugin_so>[,args=<args>]"},
+#endif
{"version", "QEMU_VERSION", false, handle_arg_version,
"", "display version information and exit"},
{NULL, NULL, false, NULL, NULL, NULL}
@@ -830,6 +842,9 @@ int main(int argc, char **argv, char **envp)
}
gdb_handlesig(cpu, 0);
}
+
+ qemu_plugins_init();
+
cpu_loop(env);
/* never exits */
return 0;
--
2.17.1
- [Qemu-devel] [RFC PATCH 07/21] accel/tcg/cputlb: convert tlb_flush debugging into trace events, (continued)
- [Qemu-devel] [RFC PATCH 03/21] linux-user: add -dfilter progtext shortcut, Alex Bennée, 2018/10/05
- [Qemu-devel] [RFC PATCH 06/21] trace: show trace point counts in the monitor, Alex Bennée, 2018/10/05
- [Qemu-devel] [RFC PATCH 15/21] trace: add linux-user plugin support,
Alex Bennée <=
- [Qemu-devel] [RFC PATCH 19/21] plugins: add an example hotblocks plugin, Alex Bennée, 2018/10/05
- [Qemu-devel] [RFC PATCH 21/21] plugin: add tlbflush stats plugin, Alex Bennée, 2018/10/05
- [Qemu-devel] [RFC PATCH 20/21] plugins: add hotness summary to hotblocks, Alex Bennée, 2018/10/05
- [Qemu-devel] [RFC PATCH 17/21] hmp: expose status of plugins to the monitor, Alex Bennée, 2018/10/05