[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 41/54] linux-user: support -plugin option
From: |
Alex Bennée |
Subject: |
[PATCH v6 41/54] linux-user: support -plugin option |
Date: |
Thu, 17 Oct 2019 14:16:02 +0100 |
From: Lluís Vilanova <address@hidden>
Signed-off-by: Lluís Vilanova <address@hidden>
[ cota: s/instrument/plugin ]
Signed-off-by: Emilio G. Cota <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
---
linux-user/main.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index 560d053f72..6ff7851e86 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -34,6 +34,7 @@
#include "qemu/error-report.h"
#include "qemu/help_option.h"
#include "qemu/module.h"
+#include "qemu/plugin.h"
#include "cpu.h"
#include "exec/exec-all.h"
#include "tcg.h"
@@ -398,6 +399,15 @@ static void handle_arg_abi_call0(const char *arg)
}
#endif
+static QemuPluginList plugins = QTAILQ_HEAD_INITIALIZER(plugins);
+
+#ifdef CONFIG_PLUGIN
+static void handle_arg_plugin(const char *arg)
+{
+ qemu_plugin_opt_parse(arg, &plugins);
+}
+#endif
+
struct qemu_argument {
const char *argv;
const char *env;
@@ -449,6 +459,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_PLUGIN
+ {"plugin", "QEMU_PLUGIN", true, handle_arg_plugin,
+ "", "[file=]<file>[,arg=<string>]"},
+#endif
{"version", "QEMU_VERSION", false, handle_arg_version,
"", "display version information and exit"},
#if defined(TARGET_XTENSA)
@@ -643,6 +657,7 @@ int main(int argc, char **argv, char **envp)
cpu_model = NULL;
qemu_add_opts(&qemu_trace_opts);
+ qemu_plugin_add_opts();
optind = parse_args(argc, argv);
@@ -650,6 +665,9 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
trace_init_file(trace_file);
+ if (qemu_plugin_load_list(&plugins)) {
+ exit(1);
+ }
/* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs));
--
2.20.1
- [PATCH v6 20/54] cpu: hook plugin vcpu events, (continued)
- [PATCH v6 20/54] cpu: hook plugin vcpu events, Alex Bennée, 2019/10/17
- [PATCH v6 44/54] tests/tcg: set QEMU_OPTS for all cris runs, Alex Bennée, 2019/10/17
- [PATCH v6 22/54] translator: add translator_ld{ub,sw,uw,l,q}, Alex Bennée, 2019/10/17
- [PATCH v6 32/54] target/xtensa: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 30/54] target/riscv: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 40/54] vl: support -plugin option, Alex Bennée, 2019/10/17
- [PATCH v6 51/54] accel/stubs: reduce headers from tcg-stub, Alex Bennée, 2019/10/17
- [PATCH v6 52/54] include/exec: wrap cpu_ldst.h in CONFIG_TCG, Alex Bennée, 2019/10/17
- [PATCH v6 31/54] target/sparc: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 53/54] .travis.yml: add --enable-plugins tests, Alex Bennée, 2019/10/17
- [PATCH v6 41/54] linux-user: support -plugin option,
Alex Bennée <=
- [PATCH v6 43/54] tests/tcg/Makefile.target: fix path to config-host.mak, Alex Bennée, 2019/10/17
- [PATCH v6 16/54] plugins: implement helpers for resolving hwaddr, Alex Bennée, 2019/10/17
- [PATCH v6 17/54] translate-all: notify plugin code of tb_flush, Alex Bennée, 2019/10/17
- [PATCH v6 28/54] target/m68k: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 27/54] target/hppa: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 38/54] plugin: add qemu_plugin_insn_disas helper, Alex Bennée, 2019/10/17
- [PATCH v6 45/54] tests/tcg: move "virtual" tests to EXTRA_TESTS, Alex Bennée, 2019/10/17
- [PATCH v6 35/54] configure: add --enable-plugins, Alex Bennée, 2019/10/17
- [PATCH v6 49/54] tests/plugin: add instruction execution breakdown, Alex Bennée, 2019/10/17
- Re: [PATCH for 4.2 v6 00/54] Support for TCG plugins, no-reply, 2019/10/17