Commit ae4b28ac 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 Wed 12 Oct 2016 09:43:03 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 missing execution mode of guest events
  trace: introduce a formal group name for trace events
  trace: pass trace-events to tracetool as a positional param
  trace: push reading of events up a level to tracetool main
  trace: rename _read_events to read_events
  trace: get rid of generated-events.h/generated-events.c
  trace: dynamically allocate event IDs at runtime
  trace: dynamically allocate trace_dstate in CPUState
  trace: provide mechanism for registering trace events
  trace: don't abort qemu if ftrace can't be initialized
  trace: emit name <-> ID mapping in simpletrace header
  trace: remove the TraceEventID and TraceEventVCPUID enums
  trace: give each trace event a named TraceEvent struct
  trace: break circular dependency in event-internal.h
  trace: remove duplicate control.h includes in generated-tracers.h
  trace: remove global 'uint16 dstate[]' array
  trace: remove some now unused functions
  trace: convert code to use event iterators
  trace: add trace event iterator APIs
  trace: move colo trace events to net/ sub-directory

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 6b39b063 f5e2b3be
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -56,9 +56,6 @@ GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
GENERATED_HEADERS += qmp-introspect.h
GENERATED_SOURCES += qmp-introspect.c

GENERATED_HEADERS += trace/generated-events.h
GENERATED_SOURCES += trace/generated-events.c

GENERATED_HEADERS += trace/generated-tracers.h
ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
GENERATED_HEADERS += trace/generated-tracers-dtrace.h
+3 −3
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ $(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all
		--binary=$(bindir)/$(QEMU_PROG) \
		--target-name=$(TARGET_NAME) \
		--target-type=$(TARGET_TYPE) \
		< $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed")
		$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed")

$(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all
	$(call quiet-command,$(TRACETOOL) \
@@ -64,14 +64,14 @@ $(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all
		--binary=$(realpath .)/$(QEMU_PROG) \
		--target-name=$(TARGET_NAME) \
		--target-type=$(TARGET_TYPE) \
		< $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp")
		$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp")

$(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all
	$(call quiet-command,$(TRACETOOL) \
		--format=simpletrace-stap \
		--backends=$(TRACE_BACKENDS) \
		--probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
		< $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
		$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")

else
stap:
+1 −0
Original line number Diff line number Diff line
@@ -740,6 +740,7 @@ int main(int argc, char **argv)
    if (argc <= 1)
        usage();

    module_call_init(MODULE_INIT_TRACE);
    qemu_init_cpu_list();
    module_call_init(MODULE_INIT_QOM);

+2 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ typedef enum {
    MODULE_INIT_OPTS,
    MODULE_INIT_QAPI,
    MODULE_INIT_QOM,
    MODULE_INIT_TRACE,
    MODULE_INIT_MAX
} module_init_type;

@@ -51,6 +52,7 @@ typedef enum {
#define opts_init(function) module_init(function, MODULE_INIT_OPTS)
#define qapi_init(function) module_init(function, MODULE_INIT_QAPI)
#define type_init(function) module_init(function, MODULE_INIT_QOM)
#define trace_init(function) module_init(function, MODULE_INIT_TRACE)

#define block_module_load_one(lib) module_load_one("block-", lib)

+6 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@
#include "qemu/bitmap.h"
#include "qemu/queue.h"
#include "qemu/thread.h"
#include "trace/generated-events.h"

typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size,
                                     void *opaque);
@@ -345,8 +344,12 @@ struct CPUState {
    struct KVMState *kvm_state;
    struct kvm_run *kvm_run;

    /* Used for events with 'vcpu' and *without* the 'disabled' properties */
    DECLARE_BITMAP(trace_dstate, TRACE_VCPU_EVENT_COUNT);
    /*
     * Used for events with 'vcpu' and *without* the 'disabled' properties.
     * Dynamically allocated based on bitmap requried to hold up to
     * trace_get_vcpu_event_count() entries.
     */
    unsigned long *trace_dstate;

    /* TODO Move common fields from CPUArchState here. */
    int cpu_index; /* used by alpha TCG */
Loading