All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/8] testing and misc updates
@ 2021-06-07 14:32 Alex Bennée
  2021-06-07 14:32 ` [PULL 1/8] tests/tcg: add a multiarch signals test to stress test signal delivery Alex Bennée
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:32 UTC (permalink / raw)
  To: peter.maydell; +Cc: Alex Bennée, qemu-devel

The following changes since commit 6f398e533f5e259b4f937f4aa9de970f7201d166:

  Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210604' into staging (2021-06-05 11:25:52 +0100)

are available in the Git repository at:

  https://github.com/stsquad/qemu.git tags/pull-testing-updates-070621-2

for you to fetch changes up to 72205289a0799c6d0a73107198098b830dbea2f9:

  scripts/checkpatch.pl: process .c.inc and .h.inc files as C source (2021-06-07 14:49:30 +0100)

----------------------------------------------------------------
A few testing and configure updates:

  - add the multiarch signals stress test
  - fix display of multi-word compiler stanzas in meson
  - fix quoting of multi-word compiler stazas in configure.sh
  - tag some acceptance tests as TCG only
  - make checkpatch test work harder to find clean diffs
  - split gprof/gconv job to avoid timeouts
  - fix centos8 VM build by adding --source-path
  - make checkpatch aware of .h.inc and .c.inc paths

----------------------------------------------------------------
Alex Bennée (6):
      tests/tcg: add a multiarch signals test to stress test signal delivery
      meson.build: fix cosmetics of compiler display
      tests/tcg/configure.sh: tweak quoting of target_compiler
      tests/acceptance: tag various arm tests as TCG only
      gitlab: work harder to avoid false positives in checkpatch
      tests/vm: expose --source-path to scripts to find extra files

Matheus Ferst (1):
      scripts/checkpatch.pl: process .c.inc and .h.inc files as C source

Philippe Mathieu-Daudé (1):
      gitlab-ci: Split gprof-gcov job

 meson.build                            |   8 +-
 tests/tcg/multiarch/signals.c          | 149 +++++++++++++++++++++++++++++++++
 .gitlab-ci.d/buildtest.yml             |  17 +++-
 .gitlab-ci.d/static_checks.yml         |   6 +-
 scripts/checkpatch.pl                  |   4 +-
 tests/acceptance/boot_linux_console.py |  18 ++++
 tests/tcg/configure.sh                 |   6 +-
 tests/tcg/multiarch/Makefile.target    |   2 +
 tests/vm/Makefile.include              |   1 +
 tests/vm/basevm.py                     |   4 +
 tests/vm/centos.aarch64                |   2 +-
 11 files changed, 203 insertions(+), 14 deletions(-)
 create mode 100644 tests/tcg/multiarch/signals.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 1/8] tests/tcg: add a multiarch signals test to stress test signal delivery
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
@ 2021-06-07 14:32 ` Alex Bennée
  2021-06-07 14:32 ` [PULL 2/8] meson.build: fix cosmetics of compiler display Alex Bennée
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:32 UTC (permalink / raw)
  To: peter.maydell; +Cc: Richard Henderson, Alex Bennée, qemu-devel

This adds a simple signal test that combines the POSIX timer_create
with signal delivery across multiple threads. The aim is to provide a
bit more of a stress test to flush out signal handling issues for
easily than the occasional random crash we sometimes see in linux-test
or threadcount.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210527160319.19834-2-alex.bennee@linaro.org>

diff --git a/tests/tcg/multiarch/signals.c b/tests/tcg/multiarch/signals.c
new file mode 100644
index 0000000000..998c8fdefd
--- /dev/null
+++ b/tests/tcg/multiarch/signals.c
@@ -0,0 +1,149 @@
+/*
+ * linux-user signal handling tests.
+ *
+ * Copyright (c) 2021 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <pthread.h>
+#include <string.h>
+#include <signal.h>
+#include <time.h>
+#include <sys/time.h>
+
+static void error1(const char *filename, int line, const char *fmt, ...)
+{
+    va_list ap;
+    va_start(ap, fmt);
+    fprintf(stderr, "%s:%d: ", filename, line);
+    vfprintf(stderr, fmt, ap);
+    fprintf(stderr, "\n");
+    va_end(ap);
+    exit(1);
+}
+
+static int __chk_error(const char *filename, int line, int ret)
+{
+    if (ret < 0) {
+        error1(filename, line, "%m (ret=%d, errno=%d/%s)",
+               ret, errno, strerror(errno));
+    }
+    return ret;
+}
+
+#define error(fmt, ...) error1(__FILE__, __LINE__, fmt, ## __VA_ARGS__)
+
+#define chk_error(ret) __chk_error(__FILE__, __LINE__, (ret))
+
+/*
+ * Thread handling
+ */
+typedef struct ThreadJob ThreadJob;
+
+struct ThreadJob {
+    int number;
+    int sleep;
+    int count;
+};
+
+static pthread_t *threads;
+static int max_threads = 10;
+__thread int signal_count;
+int total_signal_count;
+
+static void *background_thread_func(void *arg)
+{
+    ThreadJob *job = (ThreadJob *) arg;
+
+    printf("thread%d: started\n", job->number);
+    while (total_signal_count < job->count) {
+        usleep(job->sleep);
+    }
+    printf("thread%d: saw %d alarms from %d\n", job->number,
+           signal_count, total_signal_count);
+    return NULL;
+}
+
+static void spawn_threads(void)
+{
+    int i;
+    threads = calloc(sizeof(pthread_t), max_threads);
+
+    for (i = 0; i < max_threads; i++) {
+        ThreadJob *job = calloc(sizeof(ThreadJob), 1);
+        job->number = i;
+        job->sleep = i * 1000;
+        job->count = i * 100;
+        pthread_create(threads + i, NULL, background_thread_func, job);
+    }
+}
+
+static void close_threads(void)
+{
+    int i;
+    for (i = 0; i < max_threads; i++) {
+        pthread_join(threads[i], NULL);
+    }
+    free(threads);
+    threads = NULL;
+}
+
+static void sig_alarm(int sig, siginfo_t *info, void *puc)
+{
+    if (sig != SIGRTMIN) {
+        error("unexpected signal");
+    }
+    signal_count++;
+    __atomic_fetch_add(&total_signal_count, 1, __ATOMIC_SEQ_CST);
+}
+
+static void test_signals(void)
+{
+    struct sigaction act;
+    struct itimerspec it;
+    timer_t tid;
+    struct sigevent sev;
+
+    /* Set up SIG handler */
+    act.sa_sigaction = sig_alarm;
+    sigemptyset(&act.sa_mask);
+    act.sa_flags = SA_SIGINFO;
+    chk_error(sigaction(SIGRTMIN, &act, NULL));
+
+    /* Create POSIX timer */
+    sev.sigev_notify = SIGEV_SIGNAL;
+    sev.sigev_signo = SIGRTMIN;
+    sev.sigev_value.sival_ptr = &tid;
+    chk_error(timer_create(CLOCK_REALTIME, &sev, &tid));
+
+    it.it_interval.tv_sec = 0;
+    it.it_interval.tv_nsec = 1000000;
+    it.it_value.tv_sec = 0;
+    it.it_value.tv_nsec = 1000000;
+    chk_error(timer_settime(tid, 0, &it, NULL));
+
+    spawn_threads();
+
+    do {
+        usleep(1000);
+    } while (total_signal_count < 2000);
+
+    printf("shutting down after: %d signals\n", total_signal_count);
+
+    close_threads();
+
+    chk_error(timer_delete(tid));
+}
+
+int main(int argc, char **argv)
+{
+    test_signals();
+    return 0;
+}
diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target
index a3a751723d..3f283eabe6 100644
--- a/tests/tcg/multiarch/Makefile.target
+++ b/tests/tcg/multiarch/Makefile.target
@@ -30,6 +30,8 @@ testthread: LDFLAGS+=-lpthread
 
 threadcount: LDFLAGS+=-lpthread
 
+signals: LDFLAGS+=-lrt -lpthread
+
 # We define the runner for test-mmap after the individual
 # architectures have defined their supported pages sizes. If no
 # additional page sizes are defined we only run the default test.
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 2/8] meson.build: fix cosmetics of compiler display
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
  2021-06-07 14:32 ` [PULL 1/8] tests/tcg: add a multiarch signals test to stress test signal delivery Alex Bennée
@ 2021-06-07 14:32 ` Alex Bennée
  2021-06-07 14:32 ` [PULL 3/8] tests/tcg/configure.sh: tweak quoting of target_compiler Alex Bennée
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:32 UTC (permalink / raw)
  To: peter.maydell
  Cc: Philippe Mathieu-Daudé,
	Thomas Huth, Richard Henderson, Alex Bennée, qemu-devel

If you specify something like --cc="ccache gcc" on your configure line
the summary output misses the rest of the cmd_array. Do some string
joining to make it complete.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210527160319.19834-3-alex.bennee@linaro.org>

diff --git a/meson.build b/meson.build
index 626cf932c1..d2a9ce91f5 100644
--- a/meson.build
+++ b/meson.build
@@ -2537,15 +2537,15 @@ summary(summary_info, bool_yn: true, section: 'Configurable features')
 summary_info = {}
 summary_info += {'host CPU':          cpu}
 summary_info += {'host endianness':   build_machine.endian()}
-summary_info += {'C compiler':        meson.get_compiler('c').cmd_array()[0]}
-summary_info += {'Host C compiler':   meson.get_compiler('c', native: true).cmd_array()[0]}
+summary_info += {'C compiler':        ' '.join(meson.get_compiler('c').cmd_array())}
+summary_info += {'Host C compiler':   ' '.join(meson.get_compiler('c', native: true).cmd_array())}
 if link_language == 'cpp'
-  summary_info += {'C++ compiler':      meson.get_compiler('cpp').cmd_array()[0]}
+  summary_info += {'C++ compiler':    ' '.join(meson.get_compiler('cpp').cmd_array())}
 else
   summary_info += {'C++ compiler':      false}
 endif
 if targetos == 'darwin'
-  summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
+  summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
 endif
 if targetos == 'windows'
   if 'WIN_SDK' in config_host
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 3/8] tests/tcg/configure.sh: tweak quoting of target_compiler
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
  2021-06-07 14:32 ` [PULL 1/8] tests/tcg: add a multiarch signals test to stress test signal delivery Alex Bennée
  2021-06-07 14:32 ` [PULL 2/8] meson.build: fix cosmetics of compiler display Alex Bennée
@ 2021-06-07 14:32 ` Alex Bennée
  2021-06-07 14:32 ` [PULL 4/8] tests/acceptance: tag various arm tests as TCG only Alex Bennée
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:32 UTC (permalink / raw)
  To: peter.maydell; +Cc: Thomas Huth, Alex Bennée, qemu-devel

If you configure the host compiler with a multi-command stanza like:

  --cc="ccache gcc"

then the configure.sh machinery falls over with confusion. Work around
this by ensuring we correctly quote so where we need a complete
evaluation we get it. Of course the has() check needs single variable
so we need to unquote that. This does mean it essentially checks that
just the ccache command exits but if we got past that step we still
check the compiler actually does something.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Message-Id: <20210527160319.19834-4-alex.bennee@linaro.org>

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index ed6492ce59..aa7c24328a 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -222,10 +222,10 @@ for target in $target_list; do
 
   got_cross_cc=no
 
-  if eval test "x\${cross_cc_$arch}" != xyes; then
-      eval "target_compiler=\${cross_cc_$arch}"
+  if eval test "x\"\${cross_cc_$arch}\"" != xyes; then
+      eval "target_compiler=\"\${cross_cc_$arch}\""
 
-      if has "$target_compiler"; then
+      if has $target_compiler; then
           if test "$supress_clang" = yes &&
                   $target_compiler --version | grep -qi "clang"; then
               got_cross_cc=no
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 4/8] tests/acceptance: tag various arm tests as TCG only
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
                   ` (2 preceding siblings ...)
  2021-06-07 14:32 ` [PULL 3/8] tests/tcg/configure.sh: tweak quoting of target_compiler Alex Bennée
@ 2021-06-07 14:32 ` Alex Bennée
  2021-06-07 14:33 ` [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch Alex Bennée
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:32 UTC (permalink / raw)
  To: peter.maydell
  Cc: Alex Bennée, qemu-devel, Wainer dos Santos Moschetta,
	Willian Rampazzo, Cleber Rosa, Philippe Mathieu-Daudé

We should never be trying to run most of these models under a KVM
environment.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210527160319.19834-7-alex.bennee@linaro.org>

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 276a53f146..cded547d1d 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -333,6 +333,7 @@ def test_aarch64_virt(self):
         """
         :avocado: tags=arch:aarch64
         :avocado: tags=machine:virt
+        :avocado: tags=accel:tcg
         """
         kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                       '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
@@ -343,7 +344,9 @@ def test_aarch64_virt(self):
         self.vm.set_console()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
                                'console=ttyAMA0')
+        self.require_accelerator("tcg")
         self.vm.add_args('-cpu', 'cortex-a53',
+                         '-accel', 'tcg',
                          '-kernel', kernel_path,
                          '-append', kernel_command_line)
         self.vm.launch()
@@ -356,6 +359,7 @@ def test_aarch64_xlnx_versal_virt(self):
         :avocado: tags=machine:xlnx-versal-virt
         :avocado: tags=device:pl011
         :avocado: tags=device:arm_gicv3
+        :avocado: tags=accel:tcg
         """
         images_url = ('http://ports.ubuntu.com/ubuntu-ports/dists/'
                       'bionic-updates/main/installer-arm64/'
@@ -370,6 +374,7 @@ def test_aarch64_xlnx_versal_virt(self):
 
         self.vm.set_console()
         self.vm.add_args('-m', '2G',
+                         '-accel', 'tcg',
                          '-kernel', kernel_path,
                          '-initrd', initrd_path)
         self.vm.launch()
@@ -379,6 +384,7 @@ def test_arm_virt(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:virt
+        :avocado: tags=accel:tcg
         """
         kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                       '/linux/releases/29/Everything/armhfp/os/images/pxeboot'
@@ -401,6 +407,7 @@ def test_arm_emcraft_sf2(self):
         :avocado: tags=machine:emcraft-sf2
         :avocado: tags=endian:little
         :avocado: tags=u-boot
+        :avocado: tags=accel:tcg
         """
         uboot_url = ('https://raw.githubusercontent.com/'
                      'Subbaraya-Sundeep/qemu-test-binaries/'
@@ -429,6 +436,8 @@ def test_arm_emcraft_sf2(self):
 
     def do_test_arm_raspi2(self, uart_id):
         """
+        :avocado: tags=accel:tcg
+
         The kernel can be rebuilt using the kernel source referenced
         and following the instructions on the on:
         https://www.raspberrypi.org/documentation/linux/kernel/building.md
@@ -464,6 +473,7 @@ def test_arm_raspi2_uart0(self):
         :avocado: tags=arch:arm
         :avocado: tags=machine:raspi2
         :avocado: tags=device:pl011
+        :avocado: tags=accel:tcg
         """
         self.do_test_arm_raspi2(0)
 
@@ -471,6 +481,7 @@ def test_arm_exynos4210_initrd(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:smdkc210
+        :avocado: tags=accel:tcg
         """
         deb_url = ('https://snapshot.debian.org/archive/debian/'
                    '20190928T224601Z/pool/main/l/linux/'
@@ -511,6 +522,7 @@ def test_arm_cubieboard_initrd(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:cubieboard
+        :avocado: tags=accel:tcg
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
                    'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
@@ -551,6 +563,7 @@ def test_arm_cubieboard_sata(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:cubieboard
+        :avocado: tags=accel:tcg
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
                    'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
@@ -595,6 +608,7 @@ def test_arm_quanta_gsj(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:quanta-gsj
+        :avocado: tags=accel:tcg
         """
         # 25 MiB compressed, 32 MiB uncompressed.
         image_url = (
@@ -642,6 +656,7 @@ def test_arm_quanta_gsj_initrd(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:quanta-gsj
+        :avocado: tags=accel:tcg
         """
         initrd_url = (
                 'https://github.com/hskinnemoen/openbmc/releases/download/'
@@ -678,6 +693,7 @@ def test_arm_orangepi(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=accel:tcg
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
                    'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
@@ -702,6 +718,7 @@ def test_arm_orangepi(self):
     def test_arm_orangepi_initrd(self):
         """
         :avocado: tags=arch:arm
+        :avocado: tags=accel:tcg
         :avocado: tags=machine:orangepi-pc
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
@@ -744,6 +761,7 @@ def test_arm_orangepi_initrd(self):
     def test_arm_orangepi_sd(self):
         """
         :avocado: tags=arch:arm
+        :avocado: tags=accel:tcg
         :avocado: tags=machine:orangepi-pc
         :avocado: tags=device:sd
         """
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
                   ` (3 preceding siblings ...)
  2021-06-07 14:32 ` [PULL 4/8] tests/acceptance: tag various arm tests as TCG only Alex Bennée
@ 2021-06-07 14:33 ` Alex Bennée
  2021-06-07 14:50   ` Daniel P. Berrangé
  2021-06-07 14:33 ` [PULL 6/8] gitlab-ci: Split gprof-gcov job Alex Bennée
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:33 UTC (permalink / raw)
  To: peter.maydell
  Cc: Thomas Huth, Alex Bennée, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Philippe Mathieu-Daudé

This copies the behaviour of patchew's configuration to make the diff
algorithm generate a minimal diff.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20210602153247.27651-1-alex.bennee@linaro.org>

diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml
index 8e30872164..7e685c6a65 100644
--- a/.gitlab-ci.d/static_checks.yml
+++ b/.gitlab-ci.d/static_checks.yml
@@ -3,7 +3,11 @@ check-patch:
   image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
   needs:
     job: amd64-centos8-container
-  script: .gitlab-ci.d/check-patch.py
+  script:
+    - git config --local diff.renamelimit 0
+    - git config --local diff.renames True
+    - git config --local diff.algorithm histogram
+    - .gitlab-ci.d/check-patch.py
   variables:
     GIT_DEPTH: 1000
   rules:
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 6/8] gitlab-ci: Split gprof-gcov job
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
                   ` (4 preceding siblings ...)
  2021-06-07 14:33 ` [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch Alex Bennée
@ 2021-06-07 14:33 ` Alex Bennée
  2021-06-07 14:33 ` [PULL 7/8] tests/vm: expose --source-path to scripts to find extra files Alex Bennée
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:33 UTC (permalink / raw)
  To: peter.maydell
  Cc: Thomas Huth, qemu-devel, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Alex Bennée

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

This job is hitting the 70min limit, so split it in 2 tasks.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210525082556.4011380-7-f4bug@amsat.org>

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index b72c57e4df..d9b834c848 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -558,16 +558,27 @@ check-deprecated:
   allow_failure: true
 
 # gprof/gcov are GCC features
-gprof-gcov:
+build-gprof-gcov:
   extends: .native_build_job_template
   needs:
     job: amd64-ubuntu2004-container
   variables:
     IMAGE: ubuntu2004
     CONFIGURE_ARGS: --enable-gprof --enable-gcov
-    MAKE_CHECK_ARGS: check
     TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
-  timeout: 70m
+  artifacts:
+    expire_in: 1 days
+    paths:
+      - build
+
+check-gprof-gcov:
+  extends: .native_test_job_template
+  needs:
+    - job: build-gprof-gcov
+      artifacts: true
+  variables:
+    IMAGE: ubuntu2004
+    MAKE_CHECK_ARGS: check
   after_script:
     - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
 
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 7/8] tests/vm: expose --source-path to scripts to find extra files
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
                   ` (5 preceding siblings ...)
  2021-06-07 14:33 ` [PULL 6/8] gitlab-ci: Split gprof-gcov job Alex Bennée
@ 2021-06-07 14:33 ` Alex Bennée
  2021-06-07 14:33 ` [PULL 8/8] scripts/checkpatch.pl: process .c.inc and .h.inc files as C source Alex Bennée
  2021-06-07 16:17 ` [PULL 0/8] testing and misc updates Peter Maydell
  8 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:33 UTC (permalink / raw)
  To: peter.maydell
  Cc: Thomas Huth, qemu-devel, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Alex Bennée

Currently the centos8 image expects to run an in-src build to find the
kick starter file. Fix this.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210602103527.32021-1-alex.bennee@linaro.org>

diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index e94d95ec54..f3a3a1c751 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -84,6 +84,7 @@ $(IMAGES_DIR)/%.img:	$(SRC_PATH)/tests/vm/% \
 		$(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \
 		$(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \
 		$(if $(LOG_CONSOLE),--log-console) \
+		--source-path $(SRC_PATH) \
 		--image "$@" \
 		--force \
 		--build-image $@, \
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 0f2e436ed3..254e11c932 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -96,6 +96,7 @@ def __init__(self, args, config=None):
         self._genisoimage = args.genisoimage
         self._build_path = args.build_path
         self._efi_aarch64 = args.efi_aarch64
+        self._source_path = args.source_path
         # Allow input config to override defaults.
         self._config = DEFAULT_CONFIG.copy()
         if config != None:
@@ -591,6 +592,9 @@ def get_default_jobs():
     parser.add_argument("--build-path", default=None,
                         help="Path of build directory, "\
                         "for using build tree QEMU binary. ")
+    parser.add_argument("--source-path", default=None,
+                        help="Path of source directory, "\
+                        "for finding additional files. ")
     parser.add_argument("--interactive", "-I", action="store_true",
                         help="Interactively run command")
     parser.add_argument("--snapshot", "-s", action="store_true",
diff --git a/tests/vm/centos.aarch64 b/tests/vm/centos.aarch64
index e687b93e52..81c3004c3c 100755
--- a/tests/vm/centos.aarch64
+++ b/tests/vm/centos.aarch64
@@ -64,7 +64,7 @@ class CentosAarch64VM(basevm.BaseVM):
     def create_kickstart(self):
         """Generate the kickstart file used to generate the centos image."""
         # Start with the template for the kickstart.
-        ks_file = "../tests/vm/centos-8-aarch64.ks"
+        ks_file = self._source_path + "/tests/vm/centos-8-aarch64.ks"
         subprocess.check_call("cp {} ./ks.cfg".format(ks_file), shell=True)
         # Append the ssh keys to the kickstart file
         # as the post processing phase of installation.
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PULL 8/8] scripts/checkpatch.pl: process .c.inc and .h.inc files as C source
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
                   ` (6 preceding siblings ...)
  2021-06-07 14:33 ` [PULL 7/8] tests/vm: expose --source-path to scripts to find extra files Alex Bennée
@ 2021-06-07 14:33 ` Alex Bennée
  2021-06-07 16:17 ` [PULL 0/8] testing and misc updates Peter Maydell
  8 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 14:33 UTC (permalink / raw)
  To: peter.maydell; +Cc: Alex Bennée, Luis Pires, Matheus Ferst, qemu-devel

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Change the regex used to determine whether a file should be processed as
C source to include .c.inc and .h.inc extensions.

Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Message-Id: <20210520195142.941261-1-matheus.ferst@eldorado.org.br>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3d185cceac..bbcd25ae05 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -12,7 +12,7 @@ use Term::ANSIColor qw(:constants);
 my $P = $0;
 $P =~ s@.*/@@g;
 
-our $SrcFile    = qr{\.(?:h|c|cpp|s|S|pl|py|sh)$};
+our $SrcFile    = qr{\.(?:(h|c)(\.inc)?|cpp|s|S|pl|py|sh)$};
 
 my $V = '0.31';
 
@@ -1671,7 +1671,7 @@ sub process {
 		}
 
 # check we are in a valid C source file if not then ignore this hunk
-		next if ($realfile !~ /\.(h|c|cpp)$/);
+		next if ($realfile !~ /\.((h|c)(\.inc)?|cpp)$/);
 
 # Block comment styles
 
-- 
2.20.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch
  2021-06-07 14:33 ` [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch Alex Bennée
@ 2021-06-07 14:50   ` Daniel P. Berrangé
  2021-06-07 16:14     ` Alex Bennée
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel P. Berrangé @ 2021-06-07 14:50 UTC (permalink / raw)
  To: Alex Bennée
  Cc: peter.maydell, Thomas Huth, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Philippe Mathieu-Daudé

On Mon, Jun 07, 2021 at 03:33:00PM +0100, Alex Bennée wrote:
> This copies the behaviour of patchew's configuration to make the diff
> algorithm generate a minimal diff.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> Message-Id: <20210602153247.27651-1-alex.bennee@linaro.org>
> 
> diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml
> index 8e30872164..7e685c6a65 100644
> --- a/.gitlab-ci.d/static_checks.yml
> +++ b/.gitlab-ci.d/static_checks.yml
> @@ -3,7 +3,11 @@ check-patch:
>    image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
>    needs:
>      job: amd64-centos8-container
> -  script: .gitlab-ci.d/check-patch.py
> +  script:
> +    - git config --local diff.renamelimit 0
> +    - git config --local diff.renames True
> +    - git config --local diff.algorithm histogram
> +    - .gitlab-ci.d/check-patch.py

No objection to merging this patch as is, but I wonder if we ought to
make scripts/checkpatch.pl set these options explicitly when it runs
git, eg

   git -c diff.renamelimit=0 -c diff.renames=True ...etc show

so that everyone who runs checkpatch.pl benefits from the improvement.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch
  2021-06-07 14:50   ` Daniel P. Berrangé
@ 2021-06-07 16:14     ` Alex Bennée
  2021-06-07 16:19       ` Daniel P. Berrangé
  0 siblings, 1 reply; 13+ messages in thread
From: Alex Bennée @ 2021-06-07 16:14 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: peter.maydell, Thomas Huth, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Philippe Mathieu-Daudé


Daniel P. Berrangé <berrange@redhat.com> writes:

> On Mon, Jun 07, 2021 at 03:33:00PM +0100, Alex Bennée wrote:
>> This copies the behaviour of patchew's configuration to make the diff
>> algorithm generate a minimal diff.
>> 
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
>> Message-Id: <20210602153247.27651-1-alex.bennee@linaro.org>
>> 
>> diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml
>> index 8e30872164..7e685c6a65 100644
>> --- a/.gitlab-ci.d/static_checks.yml
>> +++ b/.gitlab-ci.d/static_checks.yml
>> @@ -3,7 +3,11 @@ check-patch:
>>    image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
>>    needs:
>>      job: amd64-centos8-container
>> -  script: .gitlab-ci.d/check-patch.py
>> +  script:
>> +    - git config --local diff.renamelimit 0
>> +    - git config --local diff.renames True
>> +    - git config --local diff.algorithm histogram
>> +    - .gitlab-ci.d/check-patch.py
>
> No objection to merging this patch as is, but I wonder if we ought to
> make scripts/checkpatch.pl set these options explicitly when it runs
> git, eg
>
>    git -c diff.renamelimit=0 -c diff.renames=True ...etc show
>
> so that everyone who runs checkpatch.pl benefits from the improvement.

Sure - I've generally held off messing with checkpatch directly because
of the general desire to keep it in-sync with upstream. Maybe that's
becoming less of a concern as time goes on?

[AJB says that with a totally straight face despite another patch in
this PR doing exactly that...]

>
> Regards,
> Daniel


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PULL 0/8] testing and misc updates
  2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
                   ` (7 preceding siblings ...)
  2021-06-07 14:33 ` [PULL 8/8] scripts/checkpatch.pl: process .c.inc and .h.inc files as C source Alex Bennée
@ 2021-06-07 16:17 ` Peter Maydell
  8 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2021-06-07 16:17 UTC (permalink / raw)
  To: Alex Bennée; +Cc: QEMU Developers

On Mon, 7 Jun 2021 at 15:33, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> The following changes since commit 6f398e533f5e259b4f937f4aa9de970f7201d166:
>
>   Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210604' into staging (2021-06-05 11:25:52 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/stsquad/qemu.git tags/pull-testing-updates-070621-2
>
> for you to fetch changes up to 72205289a0799c6d0a73107198098b830dbea2f9:
>
>   scripts/checkpatch.pl: process .c.inc and .h.inc files as C source (2021-06-07 14:49:30 +0100)
>
> ----------------------------------------------------------------
> A few testing and configure updates:
>
>   - add the multiarch signals stress test
>   - fix display of multi-word compiler stanzas in meson
>   - fix quoting of multi-word compiler stazas in configure.sh
>   - tag some acceptance tests as TCG only
>   - make checkpatch test work harder to find clean diffs
>   - split gprof/gconv job to avoid timeouts
>   - fix centos8 VM build by adding --source-path
>   - make checkpatch aware of .h.inc and .c.inc paths
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch
  2021-06-07 16:14     ` Alex Bennée
@ 2021-06-07 16:19       ` Daniel P. Berrangé
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel P. Berrangé @ 2021-06-07 16:19 UTC (permalink / raw)
  To: Alex Bennée
  Cc: peter.maydell, Thomas Huth, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Philippe Mathieu-Daudé

On Mon, Jun 07, 2021 at 05:14:35PM +0100, Alex Bennée wrote:
> 
> Daniel P. Berrangé <berrange@redhat.com> writes:
> 
> > On Mon, Jun 07, 2021 at 03:33:00PM +0100, Alex Bennée wrote:
> >> This copies the behaviour of patchew's configuration to make the diff
> >> algorithm generate a minimal diff.
> >> 
> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> >> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> >> Message-Id: <20210602153247.27651-1-alex.bennee@linaro.org>
> >> 
> >> diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml
> >> index 8e30872164..7e685c6a65 100644
> >> --- a/.gitlab-ci.d/static_checks.yml
> >> +++ b/.gitlab-ci.d/static_checks.yml
> >> @@ -3,7 +3,11 @@ check-patch:
> >>    image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
> >>    needs:
> >>      job: amd64-centos8-container
> >> -  script: .gitlab-ci.d/check-patch.py
> >> +  script:
> >> +    - git config --local diff.renamelimit 0
> >> +    - git config --local diff.renames True
> >> +    - git config --local diff.algorithm histogram
> >> +    - .gitlab-ci.d/check-patch.py
> >
> > No objection to merging this patch as is, but I wonder if we ought to
> > make scripts/checkpatch.pl set these options explicitly when it runs
> > git, eg
> >
> >    git -c diff.renamelimit=0 -c diff.renames=True ...etc show
> >
> > so that everyone who runs checkpatch.pl benefits from the improvement.
> 
> Sure - I've generally held off messing with checkpatch directly because
> of the general desire to keep it in-sync with upstream. Maybe that's
> becoming less of a concern as time goes on?

The automatic extraction of patches from git is a feature that's
custom to QEMU in checkpatch, as I implemented that a few years
back :-)


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-06-07 16:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 14:32 [PULL 0/8] testing and misc updates Alex Bennée
2021-06-07 14:32 ` [PULL 1/8] tests/tcg: add a multiarch signals test to stress test signal delivery Alex Bennée
2021-06-07 14:32 ` [PULL 2/8] meson.build: fix cosmetics of compiler display Alex Bennée
2021-06-07 14:32 ` [PULL 3/8] tests/tcg/configure.sh: tweak quoting of target_compiler Alex Bennée
2021-06-07 14:32 ` [PULL 4/8] tests/acceptance: tag various arm tests as TCG only Alex Bennée
2021-06-07 14:33 ` [PULL 5/8] gitlab: work harder to avoid false positives in checkpatch Alex Bennée
2021-06-07 14:50   ` Daniel P. Berrangé
2021-06-07 16:14     ` Alex Bennée
2021-06-07 16:19       ` Daniel P. Berrangé
2021-06-07 14:33 ` [PULL 6/8] gitlab-ci: Split gprof-gcov job Alex Bennée
2021-06-07 14:33 ` [PULL 7/8] tests/vm: expose --source-path to scripts to find extra files Alex Bennée
2021-06-07 14:33 ` [PULL 8/8] scripts/checkpatch.pl: process .c.inc and .h.inc files as C source Alex Bennée
2021-06-07 16:17 ` [PULL 0/8] testing and misc updates Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.