diff mbox series

[RFC,15/21] trace: add linux-user plugin support

Message ID 20181005154910.3099-16-alex.bennee@linaro.org
State New
Headers show
Series Trace updates and plugin RFC | expand

Commit Message

Alex Bennée Oct. 5, 2018, 3:49 p.m. UTC
From: Aaron Lindsay <aclindsa@gmail.com>


Signed-off-by: Aaron Lindsay <aclindsa@gmail.com>

[AJB: ifdeffery]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 linux-user/main.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.17.1

Comments

Richard Henderson Oct. 15, 2018, 5:13 p.m. UTC | #1
On 10/5/18 8:49 AM, Alex Bennée wrote:
> From: Aaron Lindsay <aclindsa@gmail.com>

> 

> Signed-off-by: Aaron Lindsay <aclindsa@gmail.com>

> [AJB: ifdeffery]

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  linux-user/main.c | 15 +++++++++++++++

>  1 file changed, 15 insertions(+)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

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;