qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH  v1 0/6] testing/next (gitdm, acceptance, docker, gitlab)
@ 2020-10-21 16:31 Alex Bennée
  2020-10-21 16:31 ` [PATCH v1 1/6] Adding ani's email as an individual contributor Alex Bennée
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Alex Bennée @ 2020-10-21 16:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

Hi,

This is the current state of my testing/next branch although it also
contains a few gitdm updates as well. I'm not proud of the reverse
debugging hack but at least it works more times than not now.

Currently requiring review:

 - tests/acceptance: pick a random gdb port for reverse debugging
 - contrib/gitdm: Add more individual contributors (6 acks, 1 sobs)

Alex Bennée (2):
  contrib/gitdm: Add more individual contributors
  tests/acceptance: pick a random gdb port for reverse debugging

Ani Sinha (1):
  Adding ani's email as an individual contributor

Daniel P. Berrangé (2):
  gitlab: skip checkpatch.pl checks if no commit delta on branch
  scripts: fix error from checkpatch.pl when no commits are found

Thomas Huth (1):
  tests/docker/dockerfiles/centos: Use SDL2 instead of SDL1

 .gitlab-ci.d/check-patch.py             | 8 ++++++++
 contrib/gitdm/group-map-individuals     | 6 ++++++
 scripts/checkpatch.pl                   | 2 +-
 tests/acceptance/reverse_debugging.py   | 6 ++++--
 tests/docker/dockerfiles/centos7.docker | 2 +-
 tests/docker/dockerfiles/centos8.docker | 2 +-
 6 files changed, 21 insertions(+), 5 deletions(-)

-- 
2.20.1



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

* [PATCH  v1 1/6] Adding ani's email as an individual contributor
  2020-10-21 16:31 [PATCH v1 0/6] testing/next (gitdm, acceptance, docker, gitlab) Alex Bennée
@ 2020-10-21 16:31 ` Alex Bennée
  2020-10-21 16:31 ` [PATCH v1 2/6] contrib/gitdm: Add more individual contributors Alex Bennée
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Alex Bennée @ 2020-10-21 16:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ani Sinha, Alex Bennée, Philippe Mathieu-Daudé

From: Ani Sinha <ani@anisinha.ca>

Ani is an individual contributor into qemu project. Adding my email into the
correct file to reflect so.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201007161940.1478-1-ani@anisinha.ca>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 contrib/gitdm/group-map-individuals | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/gitdm/group-map-individuals b/contrib/gitdm/group-map-individuals
index 641169fa63..d135f4b143 100644
--- a/contrib/gitdm/group-map-individuals
+++ b/contrib/gitdm/group-map-individuals
@@ -23,3 +23,4 @@ vr_qemu@t-online.de
 nieklinnenbank@gmail.com
 devnexen@gmail.com
 pauldzim@gmail.com
+ani@anisinha.ca
-- 
2.20.1



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

* [PATCH  v1 2/6] contrib/gitdm: Add more individual contributors
  2020-10-21 16:31 [PATCH v1 0/6] testing/next (gitdm, acceptance, docker, gitlab) Alex Bennée
  2020-10-21 16:31 ` [PATCH v1 1/6] Adding ani's email as an individual contributor Alex Bennée
@ 2020-10-21 16:31 ` Alex Bennée
  2020-10-21 17:16   ` Philippe Mathieu-Daudé
  2020-10-21 16:31 ` [PATCH v1 3/6] tests/docker/dockerfiles/centos: Use SDL2 instead of SDL1 Alex Bennée
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Alex Bennée @ 2020-10-21 16:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, James Hogan, Subbaraya Sundeep, Michael Rolnik,
	Alex Bennée, Artyom Tarasenko

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: <20201004182506.2038515-1-f4bug@amsat.org>
Acked-by: Subbaraya Sundeep <sundeep.lkml@gmail.com>
Acked-by: Michael Rolnik <mrolnik@gmail.com>
Acked-by: Subbaraya Sundeep <sundeep.lkml@gmail.com>
Acked-by: Thomas Huth <huth@tuxfamily.org>
Acked-by: James Hogan <jhogan@kernel.org>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
---
 contrib/gitdm/group-map-individuals | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/gitdm/group-map-individuals b/contrib/gitdm/group-map-individuals
index d135f4b143..36bbb77c39 100644
--- a/contrib/gitdm/group-map-individuals
+++ b/contrib/gitdm/group-map-individuals
@@ -24,3 +24,8 @@ nieklinnenbank@gmail.com
 devnexen@gmail.com
 pauldzim@gmail.com
 ani@anisinha.ca
+sundeep.lkml@gmail.com
+mrolnik@gmail.com
+huth@tuxfamily.org
+jhogan@kernel.org
+atar4qemu@gmail.com
-- 
2.20.1



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

* [PATCH v1 3/6] tests/docker/dockerfiles/centos: Use SDL2 instead of SDL1
  2020-10-21 16:31 [PATCH v1 0/6] testing/next (gitdm, acceptance, docker, gitlab) Alex Bennée
  2020-10-21 16:31 ` [PATCH v1 1/6] Adding ani's email as an individual contributor Alex Bennée
  2020-10-21 16:31 ` [PATCH v1 2/6] contrib/gitdm: Add more individual contributors Alex Bennée
@ 2020-10-21 16:31 ` Alex Bennée
  2020-10-21 17:17   ` Philippe Mathieu-Daudé
  2020-10-21 16:31 ` [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch Alex Bennée
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Alex Bennée @ 2020-10-21 16:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Alex Bennée, Thomas Huth,
	Daniel P . Berrangé, Philippe Mathieu-Daudé

From: Thomas Huth <thuth@redhat.com>

We do not support SDL1 in QEMU anymore. Use SDL2 instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20201021072308.9224-1-thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/dockerfiles/centos7.docker | 2 +-
 tests/docker/dockerfiles/centos8.docker | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/docker/dockerfiles/centos7.docker b/tests/docker/dockerfiles/centos7.docker
index 8b273725ee..6f11af1989 100644
--- a/tests/docker/dockerfiles/centos7.docker
+++ b/tests/docker/dockerfiles/centos7.docker
@@ -31,7 +31,7 @@ ENV PACKAGES \
     perl-Test-Harness \
     pixman-devel \
     python3 \
-    SDL-devel \
+    SDL2-devel \
     spice-glib-devel \
     spice-server-devel \
     tar \
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index 585dfad9be..f86931f955 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -2,7 +2,7 @@ FROM centos:8.1.1911
 
 RUN dnf -y update
 ENV PACKAGES \
-    SDL-devel \
+    SDL2-devel \
     bzip2 \
     bzip2-devel \
     dbus-daemon \
-- 
2.20.1



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

* [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch
  2020-10-21 16:31 [PATCH v1 0/6] testing/next (gitdm, acceptance, docker, gitlab) Alex Bennée
                   ` (2 preceding siblings ...)
  2020-10-21 16:31 ` [PATCH v1 3/6] tests/docker/dockerfiles/centos: Use SDL2 instead of SDL1 Alex Bennée
@ 2020-10-21 16:31 ` Alex Bennée
  2020-10-22  4:54   ` Thomas Huth
  2020-10-22 11:08   ` Philippe Mathieu-Daudé
  2020-10-21 16:31 ` [PATCH v1 5/6] scripts: fix error from checkpatch.pl when no commits are found Alex Bennée
  2020-10-21 16:31 ` [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging Alex Bennée
  5 siblings, 2 replies; 16+ messages in thread
From: Alex Bennée @ 2020-10-21 16:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Thomas Huth, Daniel P. Berrangé,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé

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

If the current branch is synced to the current upstream git master,
there are no commits that need checking. This causes checkpatch.pl
to print an error that it found no commits. We need to avoid calling
checkpatch.pl in this case.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20201019143537.283094-2-berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 .gitlab-ci.d/check-patch.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.gitlab-ci.d/check-patch.py b/.gitlab-ci.d/check-patch.py
index 5a14a25b13..0ff30ee077 100755
--- a/.gitlab-ci.d/check-patch.py
+++ b/.gitlab-ci.d/check-patch.py
@@ -33,8 +33,16 @@ ancestor = subprocess.check_output(["git", "merge-base",
 
 ancestor = ancestor.strip()
 
+log = subprocess.check_output(["git", "log", "--format=%H %s",
+                               ancestor + "..."],
+                              universal_newlines=True)
+
 subprocess.check_call(["git", "remote", "rm", "check-patch"])
 
+if log == "":
+    print("\nNo commits since %s, skipping checks\n" % ancestor)
+    sys.exit(0)
+
 errors = False
 
 print("\nChecking all commits since %s...\n" % ancestor)
-- 
2.20.1



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

* [PATCH v1 5/6] scripts: fix error from checkpatch.pl when no commits are found
  2020-10-21 16:31 [PATCH v1 0/6] testing/next (gitdm, acceptance, docker, gitlab) Alex Bennée
                   ` (3 preceding siblings ...)
  2020-10-21 16:31 ` [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch Alex Bennée
@ 2020-10-21 16:31 ` Alex Bennée
  2020-10-21 16:31 ` [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging Alex Bennée
  5 siblings, 0 replies; 16+ messages in thread
From: Alex Bennée @ 2020-10-21 16:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Daniel P. Berrangé

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

The error message was supposed to mention the input revision list start
point, not the branch flag.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20201019143537.283094-3-berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 6ed34970f9..88c858f67c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -392,7 +392,7 @@ if ($chk_branch) {
 
 	close $HASH;
 
-	die "$P: no revisions returned for revlist '$chk_branch'\n"
+	die "$P: no revisions returned for revlist '$ARGV[0]'\n"
 	    unless @patches;
 
 	my $i = 1;
-- 
2.20.1



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

* [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging
  2020-10-21 16:31 [PATCH v1 0/6] testing/next (gitdm, acceptance, docker, gitlab) Alex Bennée
                   ` (4 preceding siblings ...)
  2020-10-21 16:31 ` [PATCH v1 5/6] scripts: fix error from checkpatch.pl when no commits are found Alex Bennée
@ 2020-10-21 16:31 ` Alex Bennée
  2020-10-22  5:20   ` Thomas Huth
                     ` (2 more replies)
  5 siblings, 3 replies; 16+ messages in thread
From: Alex Bennée @ 2020-10-21 16:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Wainer dos Santos Moschetta, Pavel Dovgalyuk,
	Cleber Rosa, Paolo Bonzini, Philippe Mathieu-Daudé

Currently the test randomly fails if you are using a shared machine
due to contention on the well known port 1234. We can ameliorate this
a bit by picking a random non-ephemeral port although it doesn't
totally avoid the problem. While we could use a totally unique socket
address for debugging it's impossible to probe for gdb support of the
feature which makes this a sub-optimal but less fiddly option.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/acceptance/reverse_debugging.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/acceptance/reverse_debugging.py b/tests/acceptance/reverse_debugging.py
index b72fdf6cdc..f2e8245471 100644
--- a/tests/acceptance/reverse_debugging.py
+++ b/tests/acceptance/reverse_debugging.py
@@ -16,6 +16,7 @@ from avocado.utils import gdb
 from avocado.utils import process
 from avocado.utils.path import find_command
 from boot_linux_console import LinuxKernelTest
+from random import randrange
 
 class ReverseDebugging(LinuxKernelTest):
     """
@@ -43,7 +44,8 @@ class ReverseDebugging(LinuxKernelTest):
         else:
             logger.info('replaying the execution...')
             mode = 'replay'
-            vm.add_args('-s', '-S')
+            self.port = randrange(2048, 49152)
+            vm.add_args('-gdb', 'tcp::%d' % (self.port), '-S')
         vm.add_args('-icount', 'shift=%s,rr=%s,rrfile=%s,rrsnapshot=init' %
                     (shift, mode, replay_path),
                     '-net', 'none')
@@ -122,7 +124,7 @@ class ReverseDebugging(LinuxKernelTest):
         # replay and run debug commands
         vm = self.run_vm(False, shift, args, replay_path, image_path)
         logger.info('connecting to gdbstub')
-        g = gdb.GDBRemote('127.0.0.1', 1234, False, False)
+        g = gdb.GDBRemote('127.0.0.1', self.port, False, False)
         g.connect()
         r = g.cmd(b'qSupported')
         if b'qXfer:features:read+' in r:
-- 
2.20.1



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

* Re: [PATCH v1 2/6] contrib/gitdm: Add more individual contributors
  2020-10-21 16:31 ` [PATCH v1 2/6] contrib/gitdm: Add more individual contributors Alex Bennée
@ 2020-10-21 17:16   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-21 17:16 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: Thomas Huth, James Hogan, Michael Rolnik, Artyom Tarasenko,
	Subbaraya Sundeep

On 10/21/20 6:31 PM, Alex Bennée wrote:

Thanks for collecting :)

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-id: <20201004182506.2038515-1-f4bug@amsat.org>
> Acked-by: Subbaraya Sundeep <sundeep.lkml@gmail.com>
> Acked-by: Michael Rolnik <mrolnik@gmail.com>
> Acked-by: Subbaraya Sundeep <sundeep.lkml@gmail.com>

^ dup

I prepared this complementary patch for James Hogan:

-- >8 --
diff --git a/contrib/gitdm/domain-map b/contrib/gitdm/domain-map
index 0074da618f5..4ebfcc396c2 100644
--- a/contrib/gitdm/domain-map
+++ b/contrib/gitdm/domain-map
@@ -30,6 +30,7 @@ sifive.com      SiFive
  suse.com        SUSE
  suse.de         SUSE
  virtuozzo.com   Virtuozzo
+jhogan@kernel.org Wave Computing < 2017-10-15
  wdc.com         Western Digital
  xilinx.com      Xilinx
  yadro.com       YADRO
---

but since he already Acked this one:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> Acked-by: Thomas Huth <huth@tuxfamily.org>
> Acked-by: James Hogan <jhogan@kernel.org>
> Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
> ---
>   contrib/gitdm/group-map-individuals | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/contrib/gitdm/group-map-individuals b/contrib/gitdm/group-map-individuals
> index d135f4b143..36bbb77c39 100644
> --- a/contrib/gitdm/group-map-individuals
> +++ b/contrib/gitdm/group-map-individuals
> @@ -24,3 +24,8 @@ nieklinnenbank@gmail.com
>   devnexen@gmail.com
>   pauldzim@gmail.com
>   ani@anisinha.ca
> +sundeep.lkml@gmail.com
> +mrolnik@gmail.com
> +huth@tuxfamily.org
> +jhogan@kernel.org
> +atar4qemu@gmail.com
> 



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

* Re: [PATCH v1 3/6] tests/docker/dockerfiles/centos: Use SDL2 instead of SDL1
  2020-10-21 16:31 ` [PATCH v1 3/6] tests/docker/dockerfiles/centos: Use SDL2 instead of SDL1 Alex Bennée
@ 2020-10-21 17:17   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-21 17:17 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: Fam Zheng, Thomas Huth, Daniel P . Berrangé

On 10/21/20 6:31 PM, Alex Bennée wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> We do not support SDL1 in QEMU anymore. Use SDL2 instead.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Message-Id: <20201021072308.9224-1-thuth@redhat.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   tests/docker/dockerfiles/centos7.docker | 2 +-
>   tests/docker/dockerfiles/centos8.docker | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch
  2020-10-21 16:31 ` [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch Alex Bennée
@ 2020-10-22  4:54   ` Thomas Huth
  2020-10-22 11:08   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 16+ messages in thread
From: Thomas Huth @ 2020-10-22  4:54 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé,
	Wainer dos Santos Moschetta

On 21/10/2020 18.31, Alex Bennée wrote:
> From: Daniel P. Berrangé <berrange@redhat.com>
> 
> If the current branch is synced to the current upstream git master,
> there are no commits that need checking. This causes checkpatch.pl
> to print an error that it found no commits. We need to avoid calling
> checkpatch.pl in this case.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> Message-Id: <20201019143537.283094-2-berrange@redhat.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  .gitlab-ci.d/check-patch.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/.gitlab-ci.d/check-patch.py b/.gitlab-ci.d/check-patch.py
> index 5a14a25b13..0ff30ee077 100755
> --- a/.gitlab-ci.d/check-patch.py
> +++ b/.gitlab-ci.d/check-patch.py
> @@ -33,8 +33,16 @@ ancestor = subprocess.check_output(["git", "merge-base",
>  
>  ancestor = ancestor.strip()
>  
> +log = subprocess.check_output(["git", "log", "--format=%H %s",
> +                               ancestor + "..."],
> +                              universal_newlines=True)
> +
>  subprocess.check_call(["git", "remote", "rm", "check-patch"])
>  
> +if log == "":
> +    print("\nNo commits since %s, skipping checks\n" % ancestor)
> +    sys.exit(0)
> +
>  errors = False
>  
>  print("\nChecking all commits since %s...\n" % ancestor)
> 

Acked-by: Thomas Huth <thuth@redhat.com>



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

* Re: [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging
  2020-10-21 16:31 ` [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging Alex Bennée
@ 2020-10-22  5:20   ` Thomas Huth
  2020-10-22 11:07     ` Philippe Mathieu-Daudé
  2020-10-22  6:18   ` Pavel Dovgalyuk
  2020-10-22 15:46   ` Cleber Rosa
  2 siblings, 1 reply; 16+ messages in thread
From: Thomas Huth @ 2020-10-22  5:20 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: Paolo Bonzini, Philippe Mathieu-Daudé,
	Pavel Dovgalyuk, Wainer dos Santos Moschetta, Cleber Rosa

On 21/10/2020 18.31, Alex Bennée wrote:
> Currently the test randomly fails if you are using a shared machine
> due to contention on the well known port 1234. We can ameliorate this
> a bit by picking a random non-ephemeral port although it doesn't
> totally avoid the problem. While we could use a totally unique socket
> address for debugging it's impossible to probe for gdb support of the
> feature which makes this a sub-optimal but less fiddly option.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/acceptance/reverse_debugging.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Certainly better than before!

Reviewed-by: Thomas Huth <thuth@redhat.com>



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

* Re: [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging
  2020-10-21 16:31 ` [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging Alex Bennée
  2020-10-22  5:20   ` Thomas Huth
@ 2020-10-22  6:18   ` Pavel Dovgalyuk
  2020-10-22 15:46   ` Cleber Rosa
  2 siblings, 0 replies; 16+ messages in thread
From: Pavel Dovgalyuk @ 2020-10-22  6:18 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: Paolo Bonzini, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Pavel Dovgalyuk, Cleber Rosa

On 21.10.2020 19:31, Alex Bennée wrote:
> Currently the test randomly fails if you are using a shared machine
> due to contention on the well known port 1234. We can ameliorate this
> a bit by picking a random non-ephemeral port although it doesn't
> totally avoid the problem. While we could use a totally unique socket
> address for debugging it's impossible to probe for gdb support of the
> feature which makes this a sub-optimal but less fiddly option.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Reviewed-by: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>

> ---
>   tests/acceptance/reverse_debugging.py | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/acceptance/reverse_debugging.py b/tests/acceptance/reverse_debugging.py
> index b72fdf6cdc..f2e8245471 100644
> --- a/tests/acceptance/reverse_debugging.py
> +++ b/tests/acceptance/reverse_debugging.py
> @@ -16,6 +16,7 @@ from avocado.utils import gdb
>   from avocado.utils import process
>   from avocado.utils.path import find_command
>   from boot_linux_console import LinuxKernelTest
> +from random import randrange
>   
>   class ReverseDebugging(LinuxKernelTest):
>       """
> @@ -43,7 +44,8 @@ class ReverseDebugging(LinuxKernelTest):
>           else:
>               logger.info('replaying the execution...')
>               mode = 'replay'
> -            vm.add_args('-s', '-S')
> +            self.port = randrange(2048, 49152)
> +            vm.add_args('-gdb', 'tcp::%d' % (self.port), '-S')
>           vm.add_args('-icount', 'shift=%s,rr=%s,rrfile=%s,rrsnapshot=init' %
>                       (shift, mode, replay_path),
>                       '-net', 'none')
> @@ -122,7 +124,7 @@ class ReverseDebugging(LinuxKernelTest):
>           # replay and run debug commands
>           vm = self.run_vm(False, shift, args, replay_path, image_path)
>           logger.info('connecting to gdbstub')
> -        g = gdb.GDBRemote('127.0.0.1', 1234, False, False)
> +        g = gdb.GDBRemote('127.0.0.1', self.port, False, False)
>           g.connect()
>           r = g.cmd(b'qSupported')
>           if b'qXfer:features:read+' in r:
> 



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

* Re: [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging
  2020-10-22  5:20   ` Thomas Huth
@ 2020-10-22 11:07     ` Philippe Mathieu-Daudé
  2020-10-22 13:07       ` Alex Bennée
  0 siblings, 1 reply; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-22 11:07 UTC (permalink / raw)
  To: Thomas Huth, Alex Bennée, qemu-devel
  Cc: Paolo Bonzini, Pavel Dovgalyuk, Wainer dos Santos Moschetta, Cleber Rosa

On 10/22/20 7:20 AM, Thomas Huth wrote:
> On 21/10/2020 18.31, Alex Bennée wrote:
>> Currently the test randomly fails if you are using a shared machine
>> due to contention on the well known port 1234. We can ameliorate this
>> a bit by picking a random non-ephemeral port although it doesn't
>> totally avoid the problem. While we could use a totally unique socket
>> address for debugging it's impossible to probe for gdb support of the
>> feature which makes this a sub-optimal but less fiddly option.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>   tests/acceptance/reverse_debugging.py | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Certainly better than before!

I'd prefer another chardev that tcp, but as you said this is
already an improvement, so:

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

> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 



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

* Re: [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch
  2020-10-21 16:31 ` [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch Alex Bennée
  2020-10-22  4:54   ` Thomas Huth
@ 2020-10-22 11:08   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-22 11:08 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: Thomas Huth, Daniel P. Berrangé, Wainer dos Santos Moschetta

On 10/21/20 6:31 PM, Alex Bennée wrote:
> From: Daniel P. Berrangé <berrange@redhat.com>
> 
> If the current branch is synced to the current upstream git master,
> there are no commits that need checking. This causes checkpatch.pl
> to print an error that it found no commits. We need to avoid calling
> checkpatch.pl in this case.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> Message-Id: <20201019143537.283094-2-berrange@redhat.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   .gitlab-ci.d/check-patch.py | 8 ++++++++
>   1 file changed, 8 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging
  2020-10-22 11:07     ` Philippe Mathieu-Daudé
@ 2020-10-22 13:07       ` Alex Bennée
  0 siblings, 0 replies; 16+ messages in thread
From: Alex Bennée @ 2020-10-22 13:07 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, qemu-devel, Wainer dos Santos Moschetta,
	Pavel Dovgalyuk, Cleber Rosa, Paolo Bonzini


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

> On 10/22/20 7:20 AM, Thomas Huth wrote:
>> On 21/10/2020 18.31, Alex Bennée wrote:
>>> Currently the test randomly fails if you are using a shared machine
>>> due to contention on the well known port 1234. We can ameliorate this
>>> a bit by picking a random non-ephemeral port although it doesn't
>>> totally avoid the problem. While we could use a totally unique socket
>>> address for debugging it's impossible to probe for gdb support of the
>>> feature which makes this a sub-optimal but less fiddly option.
>>>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> ---
>>>   tests/acceptance/reverse_debugging.py | 6 ++++--
>>>   1 file changed, 4 insertions(+), 2 deletions(-)
>> 
>> Certainly better than before!
>
> I'd prefer another chardev that tcp, but as you said this is
> already an improvement, so:

We've supported sockets gdb and softmmu emulation for some time:

  -gdb unix:path=gdb.sock,server

the trouble is detecting if the host installed gdb is going to connect
before we try and fail after launching the VM. I think we might get away
with a version probe:

  > luispm: I want to know ahead of time for my scripts if gdb can do a
      "target remote gdb.sock"
  <luispm> ajb-linaro, I don't think so. My guess is that GDB will
      always attempt to stablish a connection if the socket is valid.
  <luispm> ajb-linaro, Can you check the validity of the file before
      invoking GDB?
  <luispm> ajb-linaro, No concept of "is this particular remote target
      available?".
  > luispm: it's not that - I know the socket will exist but the older
      gdb just bombs out trying to read it.
  <luispm> ajb-linaro, Not good.
  <luispm> ajb-linaro, So is this a matter of an older GDB that doesn't
      support using socket files and a newer one that does?
  > luispm: I thought I might probe "help target remote" text but it's
      unchanged between versions
  > luispm: yes
  <luispm> ajb-linaro, I think the code is probably hidden within the
      "target remote" implementation.
  > luispm: and most distro gdb's don't at the moment
  > luispm: if I could work out the version it was added that might help
  <luispm> ajb-linaro, I see some bits of it were reverted at some
      point.
  <luispm> ajb-linaro, Let me check.
  <luispm> ajb-linaro, It looks like GDB 8.3 was the first stable to get
      it.
  > luispm: thanks - I'll see if I can script that up
  <luispm> ajb-linaro, Looks like they initially went with an explicit
      prefix of "unix:" before the socket. But then dropped that in
      favor of autodetecting the socket file.
  <luispm> ajb-linaro, The only thing I get for a GDB that doesn't
      support socket connections if
      "/run/user/1000/at-spi2-QTZBS0/socket: No such device or address."
  <luispm> *is*
  <luispm> This is 8.1 in Ubuntu 18.04.
  <luispm> master GDB says "Remote communication error.  Target
      disconnected.: Connection reset by peer."

>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
>> 
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>> 


-- 
Alex Bennée


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

* Re: [PATCH  v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging
  2020-10-21 16:31 ` [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging Alex Bennée
  2020-10-22  5:20   ` Thomas Huth
  2020-10-22  6:18   ` Pavel Dovgalyuk
@ 2020-10-22 15:46   ` Cleber Rosa
  2 siblings, 0 replies; 16+ messages in thread
From: Cleber Rosa @ 2020-10-22 15:46 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Paolo Bonzini, Philippe Mathieu-Daudé,
	qemu-devel, Pavel Dovgalyuk, Wainer dos Santos Moschetta

[-- Attachment #1: Type: text/plain, Size: 5401 bytes --]

On Wed, Oct 21, 2020 at 05:31:36PM +0100, Alex Bennée wrote:
> Currently the test randomly fails if you are using a shared machine
> due to contention on the well known port 1234. We can ameliorate this
> a bit by picking a random non-ephemeral port although it doesn't
> totally avoid the problem. While we could use a totally unique socket
> address for debugging it's impossible to probe for gdb support of the
> feature which makes this a sub-optimal but less fiddly option.
>

Hi Alex,

This is already a clear improvement, so consider my points as suggestions.

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/acceptance/reverse_debugging.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/acceptance/reverse_debugging.py b/tests/acceptance/reverse_debugging.py
> index b72fdf6cdc..f2e8245471 100644
> --- a/tests/acceptance/reverse_debugging.py
> +++ b/tests/acceptance/reverse_debugging.py
> @@ -16,6 +16,7 @@ from avocado.utils import gdb
>  from avocado.utils import process
>  from avocado.utils.path import find_command
>  from boot_linux_console import LinuxKernelTest
> +from random import randrange

Avocado ships with a "avocado.utils.network.ports.find_free_port" utility:

   https://avocado-framework.readthedocs.io/en/81.0/api/utils/avocado.utils.network.html#avocado.utils.network.ports.find_free_port

Which *minimizes* the possibility of a clash by checking if the port
is available.  I think it's worth to consider using it.

>  
>  class ReverseDebugging(LinuxKernelTest):
>      """
> @@ -43,7 +44,8 @@ class ReverseDebugging(LinuxKernelTest):
>          else:
>              logger.info('replaying the execution...')
>              mode = 'replay'
> -            vm.add_args('-s', '-S')
> +            self.port = randrange(2048, 49152)
> +            vm.add_args('-gdb', 'tcp::%d' % (self.port), '-S')

It's a good idea to try to avoid setting instance attributes outside
of __init__().  In this specific case, I'd just add a "port" parameter
to run_vm().

>          vm.add_args('-icount', 'shift=%s,rr=%s,rrfile=%s,rrsnapshot=init' %
>                      (shift, mode, replay_path),
>                      '-net', 'none')
> @@ -122,7 +124,7 @@ class ReverseDebugging(LinuxKernelTest):
>          # replay and run debug commands
>          vm = self.run_vm(False, shift, args, replay_path, image_path)
>          logger.info('connecting to gdbstub')
> -        g = gdb.GDBRemote('127.0.0.1', 1234, False, False)
> +        g = gdb.GDBRemote('127.0.0.1', self.port, False, False)
>          g.connect()
>          r = g.cmd(b'qSupported')
>          if b'qXfer:features:read+' in r:
> -- 
> 2.20.1
> 


So, the overall diff of my suggestions look like:

---
diff --git a/tests/acceptance/reverse_debugging.py b/tests/acceptance/reverse_debugging.py
index f2e8245471..3d91dfaa8f 100644
--- a/tests/acceptance/reverse_debugging.py
+++ b/tests/acceptance/reverse_debugging.py
@@ -14,9 +14,10 @@ from avocado import skipIf
 from avocado_qemu import BUILD_DIR
 from avocado.utils import gdb
 from avocado.utils import process
+from avocado.utils.network.ports import find_free_port
 from avocado.utils.path import find_command
 from boot_linux_console import LinuxKernelTest
-from random import randrange
+
 
 class ReverseDebugging(LinuxKernelTest):
     """
@@ -34,7 +35,7 @@ class ReverseDebugging(LinuxKernelTest):
     STEPS = 10
     endian_is_le = True
 
-    def run_vm(self, record, shift, args, replay_path, image_path):
+    def run_vm(self, record, shift, args, replay_path, image_path, port):
         logger = logging.getLogger('replay')
         vm = self.get_vm()
         vm.set_console()
@@ -44,8 +45,7 @@ class ReverseDebugging(LinuxKernelTest):
         else:
             logger.info('replaying the execution...')
             mode = 'replay'
-            self.port = randrange(2048, 49152)
-            vm.add_args('-gdb', 'tcp::%d' % (self.port), '-S')
+            vm.add_args('-gdb', 'tcp::%d' % port, '-S')
         vm.add_args('-icount', 'shift=%s,rr=%s,rrfile=%s,rrsnapshot=init' %
                     (shift, mode, replay_path),
                     '-net', 'none')
@@ -111,9 +111,10 @@ class ReverseDebugging(LinuxKernelTest):
         process.run(cmd)
 
         replay_path = os.path.join(self.workdir, 'replay.bin')
+        port = find_free_port()
 
         # record the log
-        vm = self.run_vm(True, shift, args, replay_path, image_path)
+        vm = self.run_vm(True, shift, args, replay_path, image_path, port)
         while self.vm_get_icount(vm) <= self.STEPS:
             pass
         last_icount = self.vm_get_icount(vm)
@@ -122,9 +123,9 @@ class ReverseDebugging(LinuxKernelTest):
         logger.info("recorded log with %s+ steps" % last_icount)
 
         # replay and run debug commands
-        vm = self.run_vm(False, shift, args, replay_path, image_path)
+        vm = self.run_vm(False, shift, args, replay_path, image_path, port)
         logger.info('connecting to gdbstub')
-        g = gdb.GDBRemote('127.0.0.1', self.port, False, False)
+        g = gdb.GDBRemote('127.0.0.1', port, False, False)
         g.connect()
         r = g.cmd(b'qSupported')
         if b'qXfer:features:read+' in r:
---

Regards,
- Cleber.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2020-10-22 15:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 16:31 [PATCH v1 0/6] testing/next (gitdm, acceptance, docker, gitlab) Alex Bennée
2020-10-21 16:31 ` [PATCH v1 1/6] Adding ani's email as an individual contributor Alex Bennée
2020-10-21 16:31 ` [PATCH v1 2/6] contrib/gitdm: Add more individual contributors Alex Bennée
2020-10-21 17:16   ` Philippe Mathieu-Daudé
2020-10-21 16:31 ` [PATCH v1 3/6] tests/docker/dockerfiles/centos: Use SDL2 instead of SDL1 Alex Bennée
2020-10-21 17:17   ` Philippe Mathieu-Daudé
2020-10-21 16:31 ` [PATCH v1 4/6] gitlab: skip checkpatch.pl checks if no commit delta on branch Alex Bennée
2020-10-22  4:54   ` Thomas Huth
2020-10-22 11:08   ` Philippe Mathieu-Daudé
2020-10-21 16:31 ` [PATCH v1 5/6] scripts: fix error from checkpatch.pl when no commits are found Alex Bennée
2020-10-21 16:31 ` [PATCH v1 6/6] tests/acceptance: pick a random gdb port for reverse debugging Alex Bennée
2020-10-22  5:20   ` Thomas Huth
2020-10-22 11:07     ` Philippe Mathieu-Daudé
2020-10-22 13:07       ` Alex Bennée
2020-10-22  6:18   ` Pavel Dovgalyuk
2020-10-22 15:46   ` Cleber Rosa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).