Commit 0c1b58f2 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging



# gpg: Signature made Mon 18 Jul 2016 22:59:55 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  trace: Add QAPI/QMP interfaces to query and control per-vCPU tracing state
  trace: Allow event name pattern in "info trace-events"
  trace: Conditionally trace events based on their per-vCPU state
  trace: Add per-vCPU tracing states for events with the 'vcpu' property
  trace: Cosmetic changes on fast-path tracing
  disas: Remove unused macro '_'
  trace: Identify events with the 'vcpu' property
  trace: [bsd-user] Commandline arguments to control tracing
  trace: [linux-user] Commandline arguments to control tracing

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 08b558f0 77e2b172
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

#include "qapi/error.h"
#include "qemu.h"
#include "qemu/config-file.h"
#include "qemu/path.h"
#include "qemu/help_option.h"
/* For tb_lock */
@@ -30,6 +31,8 @@
#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;
@@ -687,6 +690,8 @@ static void usage(void)
           "-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"
@@ -735,6 +740,7 @@ int main(int argc, char **argv)
    int gdbstub_port = 0;
    char **target_environ, **wrk;
    envlist_t *envlist = NULL;
    char *trace_file = NULL;
    bsd_type = target_openbsd;

    if (argc <= 1)
@@ -754,6 +760,8 @@ int main(int argc, char **argv)

    cpu_model = NULL;

    qemu_add_opts(&qemu_trace_opts);

    optind = 1;
    for (;;) {
        if (optind >= argc)
@@ -840,8 +848,10 @@ int main(int argc, char **argv)
            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();
        }
    }
@@ -865,6 +875,11 @@ int main(int argc, char **argv)
    }
    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));

@@ -1116,6 +1131,7 @@ int main(int argc, char **argv)
        gdbserver_start (gdbstub_port);
        gdb_handlesig(cpu, 0);
    }
    trace_init_vcpu_events();
    cpu_loop(env);
    /* never exits */
    return 0;
+3 −3
Original line number Diff line number Diff line
@@ -521,7 +521,7 @@ static unsigned
insert_bdisp(unsigned insn, int value, const char **errmsg)
{
  if (errmsg != (const char **)NULL && (value & 3))
    *errmsg = _("branch operand unaligned");
    *errmsg = "branch operand unaligned";
  return insn | ((value / 4) & 0x1FFFFF);
}

@@ -539,7 +539,7 @@ static unsigned
insert_jhint(unsigned insn, int value, const char **errmsg)
{
  if (errmsg != (const char **)NULL && (value & 3))
    *errmsg = _("jump hint unaligned");
    *errmsg = "jump hint unaligned";
  return insn | ((value / 4) & 0x3FFF);
}

@@ -556,7 +556,7 @@ static unsigned
insert_ev6hwjhint(unsigned insn, int value, const char **errmsg)
{
  if (errmsg != (const char **)NULL && (value & 3))
    *errmsg = _("jump hint unaligned");
    *errmsg = "jump hint unaligned";
  return insn | ((value / 4) & 0x1FFF);
}

+1 −1
Original line number Diff line number Diff line
@@ -1817,7 +1817,7 @@ print_insn_coprocessor (bfd_vma pc, struct disassemble_info *info, long given,
			  func (stream, "e");
			  break;
			default:
			  func (stream, _("<illegal precision>"));
			  func (stream, "<illegal precision>");
			  break;
			}
		      break;
+1 −1
Original line number Diff line number Diff line
@@ -3406,7 +3406,7 @@ static const struct dis386 three_byte_table[][256] = {
  }
};

#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
#define INTERNAL_DISASSEMBLER_ERROR "<internal disassembler error>"

static void
ckprefix (void)
+2 −2
Original line number Diff line number Diff line
@@ -1676,7 +1676,7 @@ print_insn_arg (const char *d,
	  (*info->fprintf_func) (info->stream, "%%sfc");
	else
	  /* xgettext:c-format */
	  (*info->fprintf_func) (info->stream, _("<function code %d>"), fc);
	  (*info->fprintf_func) (info->stream, "<function code %d>", fc);
      }
      break;

@@ -1827,7 +1827,7 @@ match_insn_m68k (bfd_vma memaddr,
	{
	  info->fprintf_func (info->stream,
			      /* xgettext:c-format */
			      _("<internal error in opcode table: %s %s>\n"),
			      "<internal error in opcode table: %s %s>\n",
			      best->name,  best->args);
	  info->fprintf_func = save_printer;
	  info->print_address_func = save_print_address;
Loading