Commit af7ec403 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 Fri 21 Apr 2017 10:52:18 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:
  simpletrace: document Analyzer method signatures
  trace: Put all trace.o into libqemuutil.a
  configure: eliminate Python dependency for --help

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 09fc586d 659370f7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ dtc/%:
	mkdir -p $@

$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(chardev-obj-y) \
	$(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) $(trace-obj-y)
	$(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))

ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
# Only keep -O and -g cflags
@@ -366,11 +366,11 @@ Makefile: $(version-obj-y)
# Build libraries

libqemustub.a: $(stub-obj-y)
libqemuutil.a: $(util-obj-y)
libqemuutil.a: $(util-obj-y) $(trace-obj-y)

######################################################################

COMMON_LDADDS = $(trace-obj-y) libqemuutil.a libqemustub.a
COMMON_LDADDS = libqemuutil.a libqemustub.a

qemu-img.o: qemu-img-cmds.h

+2 −3
Original line number Diff line number Diff line
@@ -188,8 +188,7 @@ dummy := $(call unnest-vars,.., \
               qom-obj-y \
               io-obj-y \
               common-obj-y \
               common-obj-m \
               trace-obj-y)
               common-obj-m)
target-obj-y := $(target-obj-y-save)
all-obj-y += $(common-obj-y)
all-obj-y += $(target-obj-y)
@@ -201,7 +200,7 @@ all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)

$(QEMU_PROG_BUILD): config-devices.mak

COMMON_LDADDS = $(trace-obj-y) ../libqemuutil.a ../libqemustub.a
COMMON_LDADDS = ../libqemuutil.a ../libqemustub.a

# build either PROG or PROGW
$(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS)
+19 −16
Original line number Diff line number Diff line
@@ -1191,21 +1191,6 @@ for opt do
  esac
done

if ! has $python; then
  error_exit "Python not found. Use --python=/path/to/python"
fi

# Note that if the Python conditional here evaluates True we will exit
# with status 1 which is a shell 'false' value.
if ! $python -c 'import sys; sys.exit(sys.version_info < (2,6) or sys.version_info >= (3,))'; then
  error_exit "Cannot use '$python', Python 2.6 or later is required." \
      "Note that Python 3 or later is not yet supported." \
      "Use --python=/path/to/python to specify a supported Python."
fi

# Suppress writing compiled files
python="$python -B"

case "$cpu" in
    ppc)
           CPU_CFLAGS="-m32"
@@ -1280,6 +1265,9 @@ for config in $mak_wilds; do
    default_target_list="${default_target_list} $(basename "$config" .mak)"
done

# Enumerate public trace backends for --help output
trace_backend_list=$(echo $(grep -le '^PUBLIC = True$' scripts/tracetool/backend/*.py | sed -e 's/^.*\/\(.*\)\.py$/\1/'))

if test x"$show_help" = x"yes" ; then
cat << EOF

@@ -1333,7 +1321,7 @@ Advanced options (experts only):
                           set block driver read-only whitelist
                           (affects only QEMU, not qemu-img)
  --enable-trace-backends=B Set trace backend
                           Available backends: $($python $source_path/scripts/tracetool.py --list-backends)
                           Available backends: $trace_backend_list
  --with-trace-file=NAME   Full PATH,NAME of file to store traces
                           Default:trace-<pid>
  --disable-slirp          disable SLIRP userspace network connectivity
@@ -1433,6 +1421,21 @@ EOF
exit 0
fi

if ! has $python; then
  error_exit "Python not found. Use --python=/path/to/python"
fi

# Note that if the Python conditional here evaluates True we will exit
# with status 1 which is a shell 'false' value.
if ! $python -c 'import sys; sys.exit(sys.version_info < (2,6) or sys.version_info >= (3,))'; then
  error_exit "Cannot use '$python', Python 2.6 or later is required." \
      "Note that Python 3 or later is not yet supported." \
      "Use --python=/path/to/python to specify a supported Python."
fi

# Suppress writing compiled files
python="$python -B"

# Now we have handled --enable-tcg-interpreter and know we're not just
# printing the help message, bail out if the host CPU isn't supported.
if test "$ARCH" = "unknown"; then
+22 −1
Original line number Diff line number Diff line
@@ -116,7 +116,28 @@ class Analyzer(object):
    is invoked.

    If a method matching a trace event name exists, it is invoked to process
    that trace record.  Otherwise the catchall() method is invoked."""
    that trace record.  Otherwise the catchall() method is invoked.

    Example:
    The following method handles the runstate_set(int new_state) trace event::

      def runstate_set(self, new_state):
          ...

    The method can also take a timestamp argument before the trace event
    arguments::

      def runstate_set(self, timestamp, new_state):
          ...

    Timestamps have the uint64_t type and are in nanoseconds.

    The pid can be included in addition to the timestamp and is useful when
    dealing with traces from multiple processes::

      def runstate_set(self, timestamp, pid, new_state):
          ...
    """

    def begin(self):
        """Called at the start of the trace."""
+1 −1
Original line number Diff line number Diff line
@@ -519,7 +519,7 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tests


# Deps that are common to various different sets of tests below
test-util-obj-y = $(trace-obj-y) libqemuutil.a libqemustub.a
test-util-obj-y = libqemuutil.a libqemustub.a
test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
	tests/test-qapi-event.o tests/test-qmp-introspect.o \