aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-02-11 13:11:49 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-02-11 13:11:49 +0000
commitda36afa2d8dc9c778292ff172083caba9558b4fa (patch)
tree73a39175a68ecbf7404c785050d24261c9e08d3e /tests
parent0a301624c2f4ced3331ffd5bce85b4274fe132af (diff)
parent514f9f8eb64bfd5d6c15024db93f83bd81998de5 (diff)
downloadqemu-da36afa2d8dc9c778292ff172083caba9558b4fa.zip
qemu-da36afa2d8dc9c778292ff172083caba9558b4fa.tar.gz
qemu-da36afa2d8dc9c778292ff172083caba9558b4fa.tar.bz2
Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-plugins-090222-1' into staging
Testing and plugin updates: - include vhost tests in qtest - clean-up gcov ephemera in clean/.gitignore - lcitool and docker updates - mention .editorconfig in devel notes - switch Centos8 to Centos Stream 8 - remove TCG tracing support - add coverage plugin using drcov format - expand abilities of libinsn.so plugin - use correct logging for i386 int cases - move reset of plugin data to start of block - deprecate ppc6432abi - fix TARGET_ABI_FMT_ptr for softmmu builds # gpg: Signature made Wed 09 Feb 2022 14:13:14 GMT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-testing-and-plugins-090222-1: (28 commits) include/exec: fix softmmu version of TARGET_ABI_FMT_lx linux-user: Remove the deprecated ppc64abi32 target plugins: move reset of plugin data to tb_start target/i386: use CPU_LOG_INT for IRQ servicing tests/plugins: add instruction matching to libinsn.so tests/plugin: allow libinsn.so per-CPU counts contrib/plugins: add a drcov plugin plugins: add helper functions for coverage plugins tracing: excise the tcg related from tracetool tracing: remove the trace-tcg includes from the build tracing: remove TCG memory access tracing docs: remove references to TCG tracing tests/tcg/sh4: disable another unreliable test tests: Update CentOS 8 container to CentOS Stream 8 tests/lcitool: Allow lcitool-refresh in out-of-tree builds, too gitlab: fall back to commit hash in qemu-setup filename docs/devel: mention our .editorconfig tests/lcitool: Install libibumad to cover RDMA on Debian based distros tests: Manually remove libxml2 on MSYS2 runners tests/lcitool: Refresh submodule and remove libxml2 ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.include4
-rw-r--r--tests/docker/dockerfiles/alpine.docker4
-rw-r--r--tests/docker/dockerfiles/centos8.docker6
-rw-r--r--tests/docker/dockerfiles/debian-ppc64el-cross.docker2
-rw-r--r--tests/docker/dockerfiles/fedora.docker4
-rw-r--r--tests/docker/dockerfiles/opensuse-leap.docker3
-rw-r--r--tests/docker/dockerfiles/ubuntu1804.docker4
-rw-r--r--tests/docker/dockerfiles/ubuntu2004.docker4
-rw-r--r--tests/lcitool/Makefile.include2
m---------tests/lcitool/libvirt-ci0
-rw-r--r--tests/lcitool/projects/qemu.yml2
-rwxr-xr-xtests/lcitool/refresh4
-rw-r--r--tests/plugin/insn.c126
-rw-r--r--tests/qtest/vhost-user-test.c21
-rwxr-xr-xtests/tcg/configure.sh2
-rw-r--r--tests/tcg/sh4/Makefile.target4
16 files changed, 147 insertions, 45 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 9157a57..646c8b1 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -34,10 +34,6 @@ endif
ifneq ($(wildcard config-host.mak),)
export SRC_PATH
-# Get the list of all supported sysemu targets
-SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
- $(wildcard $(SRC_PATH)/configs/*-softmmu.mak)))
-
SPEED = quick
# Build up our target list from the filtered list of ninja targets
diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker
index eb2251c..591af43 100644
--- a/tests/docker/dockerfiles/alpine.docker
+++ b/tests/docker/dockerfiles/alpine.docker
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTO-GENERATED
#
-# $ lcitool dockerfile alpine-edge qemu
+# $ lcitool dockerfile --layers all alpine-edge qemu
#
# https://gitlab.com/libvirt/libvirt-ci
@@ -56,7 +56,6 @@ RUN apk update && \
libtasn1-dev \
liburing-dev \
libusb-dev \
- libxml2-dev \
linux-pam-dev \
llvm11 \
lttng-ust-dev \
@@ -109,6 +108,7 @@ RUN apk update && \
zlib-dev \
zlib-static \
zstd-dev && \
+ apk list | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index cbb909d..3ede55d 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -1,10 +1,10 @@
# THIS FILE WAS AUTO-GENERATED
#
-# $ lcitool dockerfile centos-8 qemu
+# $ lcitool dockerfile --layers all centos-stream-8 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/centos:8
+FROM quay.io/centos/centos:stream8
RUN dnf update -y && \
dnf install 'dnf-command(config-manager)' -y && \
@@ -69,10 +69,8 @@ RUN dnf update -y && \
libssh-devel \
libtasn1-devel \
libubsan \
- libudev-devel \
liburing-devel \
libusbx-devel \
- libxml2-devel \
libzstd-devel \
llvm \
lttng-ust-devel \
diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
index 1146a06..5de12b0 100644
--- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
@@ -16,7 +16,7 @@ RUN apt update && \
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=powerpc64le-linux-gnu-
-ENV DEF_TARGET_LIST ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
+ENV DEF_TARGET_LIST ppc64-softmmu,ppc64-linux-user
# Install extra libraries to increase code coverage
RUN apt update && \
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 60207f3..1d01cd9 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTO-GENERATED
#
-# $ lcitool dockerfile fedora-35 qemu
+# $ lcitool dockerfile --layers all fedora-35 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
@@ -77,10 +77,8 @@ exec "$@"' > /usr/bin/nosync && \
libssh-devel \
libtasn1-devel \
libubsan \
- libudev-devel \
liburing-devel \
libusbx-devel \
- libxml2-devel \
libzstd-devel \
llvm \
lttng-ust-devel \
diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker
index f57d8cf..1b78d83 100644
--- a/tests/docker/dockerfiles/opensuse-leap.docker
+++ b/tests/docker/dockerfiles/opensuse-leap.docker
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTO-GENERATED
#
-# $ lcitool dockerfile opensuse-leap-152 qemu
+# $ lcitool dockerfile --layers all opensuse-leap-152 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
@@ -71,7 +71,6 @@ RUN zypper update -y && \
libudev-devel \
liburing-devel \
libusb-1_0-devel \
- libxml2-devel \
libzstd-devel \
llvm \
lttng-ust-devel \
diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker
index 0ffa3c4..699f2df 100644
--- a/tests/docker/dockerfiles/ubuntu1804.docker
+++ b/tests/docker/dockerfiles/ubuntu1804.docker
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTO-GENERATED
#
-# $ lcitool dockerfile ubuntu-1804 qemu
+# $ lcitool dockerfile --layers all ubuntu-1804 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
@@ -52,6 +52,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libglib2.0-dev \
libgnutls28-dev \
libgtk-3-dev \
+ libibumad-dev \
libibverbs-dev \
libiscsi-dev \
libjemalloc-dev \
@@ -89,7 +90,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libvirglrenderer-dev \
libvte-2.91-dev \
libxen-dev \
- libxml2-dev \
libzstd-dev \
llvm \
locales \
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index 4e562df..8751312 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTO-GENERATED
#
-# $ lcitool dockerfile ubuntu-2004 qemu
+# $ lcitool dockerfile --layers all ubuntu-2004 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
@@ -53,6 +53,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libglusterfs-dev \
libgnutls28-dev \
libgtk-3-dev \
+ libibumad-dev \
libibverbs-dev \
libiscsi-dev \
libjemalloc-dev \
@@ -91,7 +92,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libvirglrenderer-dev \
libvte-2.91-dev \
libxen-dev \
- libxml2-dev \
libzstd-dev \
llvm \
locales \
diff --git a/tests/lcitool/Makefile.include b/tests/lcitool/Makefile.include
index cff7c0b..6b215ad 100644
--- a/tests/lcitool/Makefile.include
+++ b/tests/lcitool/Makefile.include
@@ -13,5 +13,5 @@ lcitool:
lcitool-help: lcitool
lcitool-refresh:
- $(call quiet-command, git submodule update --init $(SRC_PATH)/tests/lcitool/libvirt-ci)
+ $(call quiet-command, cd $(SRC_PATH) && git submodule update --init tests/lcitool/libvirt-ci)
$(call quiet-command, $(LCITOOL_REFRESH))
diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci
-Subproject 29cec2153b9a4dbb2e66f1cbc9866a4eff519cf
+Subproject 6dd9b6fab1fe081b16bc975485d7a02c81ba5fb
diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml
index ed5ab14..958868a 100644
--- a/tests/lcitool/projects/qemu.yml
+++ b/tests/lcitool/projects/qemu.yml
@@ -43,6 +43,7 @@ packages:
- libfdt
- libffi
- libgcrypt
+ - libibumad
- libibverbs
- libiscsi
- libjemalloc
@@ -63,7 +64,6 @@ packages:
- liburing
- libusbx
- libvdeplug
- - libxml2
- libzstd
- llvm
- lttng-ust
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 033120e..4ab90a3 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -62,7 +62,7 @@ def generate_dockerfile(host, target, cross=None, trailer=None):
def generate_cirrus(target, trailer=None):
filename = Path(src_dir, ".gitlab-ci.d", "cirrus", target + ".vars")
- cmd = [lcitool_path, "variables", target, "qemu"]
+ cmd = lcitool_cmd + ["variables", target, "qemu"]
generate(filename, cmd, trailer)
ubuntu1804_skipssh = [
@@ -77,7 +77,7 @@ ubuntu2004_tsanhack = [
]
try:
- generate_dockerfile("centos8", "centos-8")
+ generate_dockerfile("centos8", "centos-stream-8")
generate_dockerfile("fedora", "fedora-35")
generate_dockerfile("ubuntu1804", "ubuntu-1804",
trailer="".join(ubuntu1804_skipssh))
diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c
index d229fdc..cd5ea5d4 100644
--- a/tests/plugin/insn.c
+++ b/tests/plugin/insn.c
@@ -16,22 +16,80 @@
QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
-static uint64_t insn_count;
+#define MAX_CPUS 8 /* lets not go nuts */
+
+typedef struct {
+ uint64_t last_pc;
+ uint64_t insn_count;
+} InstructionCount;
+
+static InstructionCount counts[MAX_CPUS];
+static uint64_t inline_insn_count;
+
static bool do_inline;
static bool do_size;
static GArray *sizes;
+typedef struct {
+ char *match_string;
+ uint64_t hits[MAX_CPUS];
+ uint64_t last_hit[MAX_CPUS];
+ uint64_t total_delta[MAX_CPUS];
+ GPtrArray *history[MAX_CPUS];
+} Match;
+
+static GArray *matches;
+
+typedef struct {
+ Match *match;
+ uint64_t vaddr;
+ uint64_t hits;
+ char *disas;
+} Instruction;
+
static void vcpu_insn_exec_before(unsigned int cpu_index, void *udata)
{
- static uint64_t last_pc;
+ unsigned int i = cpu_index % MAX_CPUS;
+ InstructionCount *c = &counts[i];
uint64_t this_pc = GPOINTER_TO_UINT(udata);
- if (this_pc == last_pc) {
+ if (this_pc == c->last_pc) {
g_autofree gchar *out = g_strdup_printf("detected repeat execution @ 0x%"
PRIx64 "\n", this_pc);
qemu_plugin_outs(out);
}
- last_pc = this_pc;
- insn_count++;
+ c->last_pc = this_pc;
+ c->insn_count++;
+}
+
+static void vcpu_insn_matched_exec_before(unsigned int cpu_index, void *udata)
+{
+ unsigned int i = cpu_index % MAX_CPUS;
+ Instruction *insn = (Instruction *) udata;
+ Match *match = insn->match;
+ g_autoptr(GString) ts = g_string_new("");
+
+ insn->hits++;
+ g_string_append_printf(ts, "0x%" PRIx64 ", '%s', %"PRId64 " hits",
+ insn->vaddr, insn->disas, insn->hits);
+
+ uint64_t icount = counts[i].insn_count;
+ uint64_t delta = icount - match->last_hit[i];
+
+ match->hits[i]++;
+ match->total_delta[i] += delta;
+
+ g_string_append_printf(ts,
+ ", %"PRId64" match hits, "
+ "Δ+%"PRId64 " since last match,"
+ " %"PRId64 " avg insns/match\n",
+ match->hits[i], delta,
+ match->total_delta[i] / match->hits[i]);
+
+ match->last_hit[i] = icount;
+
+ qemu_plugin_outs(ts->str);
+
+ g_ptr_array_add(match->history[i], insn);
}
static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
@@ -44,7 +102,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
if (do_inline) {
qemu_plugin_register_vcpu_insn_exec_inline(
- insn, QEMU_PLUGIN_INLINE_ADD_U64, &insn_count, 1);
+ insn, QEMU_PLUGIN_INLINE_ADD_U64, &inline_insn_count, 1);
} else {
uint64_t vaddr = qemu_plugin_insn_vaddr(insn);
qemu_plugin_register_vcpu_insn_exec_cb(
@@ -60,15 +118,38 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
unsigned long *cnt = &g_array_index(sizes, unsigned long, sz);
(*cnt)++;
}
+
+ /*
+ * If we are tracking certain instructions we will need more
+ * information about the instruction which we also need to
+ * save if there is a hit.
+ */
+ if (matches) {
+ char *insn_disas = qemu_plugin_insn_disas(insn);
+ int j;
+ for (j = 0; j < matches->len; j++) {
+ Match *m = &g_array_index(matches, Match, j);
+ if (g_str_has_prefix(insn_disas, m->match_string)) {
+ Instruction *rec = g_new0(Instruction, 1);
+ rec->disas = g_strdup(insn_disas);
+ rec->vaddr = qemu_plugin_insn_vaddr(insn);
+ rec->match = m;
+ qemu_plugin_register_vcpu_insn_exec_cb(
+ insn, vcpu_insn_matched_exec_before,
+ QEMU_PLUGIN_CB_NO_REGS, rec);
+ }
+ }
+ g_free(insn_disas);
+ }
}
}
static void plugin_exit(qemu_plugin_id_t id, void *p)
{
g_autoptr(GString) out = g_string_new(NULL);
+ int i;
if (do_size) {
- int i;
for (i = 0; i <= sizes->len; i++) {
unsigned long *cnt = &g_array_index(sizes, unsigned long, i);
if (*cnt) {
@@ -76,12 +157,39 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
"len %d bytes: %ld insns\n", i, *cnt);
}
}
+ } else if (do_inline) {
+ g_string_append_printf(out, "insns: %" PRIu64 "\n", inline_insn_count);
} else {
- g_string_append_printf(out, "insns: %" PRIu64 "\n", insn_count);
+ uint64_t total_insns = 0;
+ for (i = 0; i < MAX_CPUS; i++) {
+ InstructionCount *c = &counts[i];
+ if (c->insn_count) {
+ g_string_append_printf(out, "cpu %d insns: %" PRIu64 "\n",
+ i, c->insn_count);
+ total_insns += c->insn_count;
+ }
+ }
+ g_string_append_printf(out, "total insns: %" PRIu64 "\n",
+ total_insns);
}
qemu_plugin_outs(out->str);
}
+
+/* Add a match to the array of matches */
+static void parse_match(char *match)
+{
+ Match new_match = { .match_string = match };
+ int i;
+ for (i = 0; i < MAX_CPUS; i++) {
+ new_match.history[i] = g_ptr_array_new();
+ }
+ if (!matches) {
+ matches = g_array_new(false, true, sizeof(Match));
+ }
+ g_array_append_val(matches, new_match);
+}
+
QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
const qemu_info_t *info,
int argc, char **argv)
@@ -99,6 +207,8 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
fprintf(stderr, "boolean argument parsing failed: %s\n", opt);
return -1;
}
+ } else if (g_strcmp0(tokens[0], "match") == 0) {
+ parse_match(tokens[1]);
} else {
fprintf(stderr, "option parsing failed: %s\n", opt);
return -1;
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index 3d6337f..2a4568c 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -995,20 +995,17 @@ static void register_vhost_user_test(void)
"virtio-net",
test_migrate, &opts);
- /* keeps failing on build-system since Aug 15 2017 */
- if (getenv("QTEST_VHOST_USER_FIXME")) {
- opts.before = vhost_user_test_setup_reconnect;
- qos_add_test("vhost-user/reconnect", "virtio-net",
- test_reconnect, &opts);
+ opts.before = vhost_user_test_setup_reconnect;
+ qos_add_test("vhost-user/reconnect", "virtio-net",
+ test_reconnect, &opts);
- opts.before = vhost_user_test_setup_connect_fail;
- qos_add_test("vhost-user/connect-fail", "virtio-net",
- test_vhost_user_started, &opts);
+ opts.before = vhost_user_test_setup_connect_fail;
+ qos_add_test("vhost-user/connect-fail", "virtio-net",
+ test_vhost_user_started, &opts);
- opts.before = vhost_user_test_setup_flags_mismatch;
- qos_add_test("vhost-user/flags-mismatch", "virtio-net",
- test_vhost_user_started, &opts);
- }
+ opts.before = vhost_user_test_setup_flags_mismatch;
+ qos_add_test("vhost-user/flags-mismatch", "virtio-net",
+ test_vhost_user_started, &opts);
opts.before = vhost_user_test_setup_multiqueue;
opts.edge.extra_device_opts = "mq=on";
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 309335a..763e9b6 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -167,7 +167,7 @@ for target in $target_list; do
container_image=debian-nios2-cross
container_cross_cc=nios2-linux-gnu-gcc
;;
- ppc-*|ppc64abi32-*)
+ ppc-*)
container_hosts=x86_64
container_image=debian-powerpc-test-cross
container_cross_cc=powerpc-linux-gnu-gcc-10
diff --git a/tests/tcg/sh4/Makefile.target b/tests/tcg/sh4/Makefile.target
index 0e96aef..620ccc2 100644
--- a/tests/tcg/sh4/Makefile.target
+++ b/tests/tcg/sh4/Makefile.target
@@ -18,3 +18,7 @@ run-linux-test: linux-test
$(call skip-test, $<, "BROKEN")
run-plugin-linux-test-with-%:
$(call skip-test, $<, "BROKEN")
+
+# This test is currently unreliable: https://gitlab.com/qemu-project/qemu/-/issues/856
+run-plugin-threadcount-with-%:
+ $(call skip-test, $<, "BROKEN")