#include "qapi/error.h"
#include "qemu.h"
+#include "qemu/config-file.h"
#include "qemu/path.h"
#include "qemu/help_option.h"
/* For tb_lock */
#include "qemu/timer.h"
#include "qemu/envlist.h"
#include "exec/log.h"
+#include "trace/control.h"
+#include "glib-compat.h"
int singlestep;
unsigned long mmap_min_addr;
"-p pagesize set the host page size to 'pagesize'\n"
"-singlestep always run in singlestep mode\n"
"-strace log system calls\n"
+ "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
+ " specify tracing options\n"
"\n"
"Environment variables:\n"
"QEMU_STRACE Print system calls and arguments similar to the\n"
int gdbstub_port = 0;
char **target_environ, **wrk;
envlist_t *envlist = NULL;
+ char *trace_file = NULL;
bsd_type = target_openbsd;
if (argc <= 1)
cpu_model = NULL;
+ qemu_add_opts(&qemu_trace_opts);
+
optind = 1;
- for(;;) {
+ for (;;) {
if (optind >= argc)
break;
r = argv[optind];
singlestep = 1;
} else if (!strcmp(r, "strace")) {
do_strace = 1;
- } else
- {
+ } else if (!strcmp(r, "trace")) {
+ g_free(trace_file);
+ trace_file = trace_opt_parse(optarg);
+ } else {
usage();
}
}
}
filename = argv[optind];
+ if (!trace_init_backends()) {
+ exit(1);
+ }
+ trace_init_file(trace_file);
+
/* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs));