public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lancelot.six@amd.com>
To: <gdb-patches@sourceware.org>
Cc: <lsix@lancelotsix.com>, Lancelot Six <lancelot.six@amd.com>,
	Pedro Alves <pedro@palves.net>
Subject: [pushed v2 1/2] gdb/testsuite/rocm: Add the hip_devices_support_debug_multi_process proc
Date: Mon, 31 Jul 2023 15:30:30 +0100	[thread overview]
Message-ID: <20230731143031.313937-2-lancelot.six@amd.com> (raw)
In-Reply-To: <20230731143031.313937-1-lancelot.six@amd.com>

From: Lancelot Six <lancelot.six@amd.com>

It is not possible to debug multiple processes simultaneously on all
generations of AMDGPU devices.  As some tests will need to debug
multiple inferiors using AMDGPU devices, we need to ensure that all
devices available have the required capability.  Failing to do so would
result in GDB not being able to debug all inferiors properly.

Add the hip_devices_support_debug_multi_process helper function used to
ensure that all devices available can debug multiple processes.

Approved-By: Pedro Alves <pedro@palves.net>
---
 gdb/testsuite/lib/rocm.exp | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp
index 389d73bcaa5..98a3b308228 100644
--- a/gdb/testsuite/lib/rocm.exp
+++ b/gdb/testsuite/lib/rocm.exp
@@ -166,3 +166,23 @@ proc with_rocm_gpu_lock { body } {
 	return -code $code $result
     }
 }
+
+# Return true if all the devices support debugging multiple processes
+# using the GPU.
+
+proc hip_devices_support_debug_multi_process {} {
+    set unsupported_targets \
+	{gfx900 gfx906 gfx908 gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032}
+
+    set targets [hcc_amdgpu_targets]
+    if { [llength $targets] == 0 } {
+	return 0
+    }
+
+    foreach target $targets {
+	if { [lsearch -exact $unsupported_targets $target] != -1 } {
+	    return 0
+	}
+    }
+    return 1
+}
-- 
2.34.1


  reply	other threads:[~2023-07-31 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31 14:30 [pushed v2 0/2] Fix debugging multi inferiors using the ROCm runtime Lancelot SIX
2023-07-31 14:30 ` Lancelot SIX [this message]
2023-07-31 14:30 ` [pushed v2 2/2] gdb/amdgpu: Fix debugging multiple " Lancelot SIX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230731143031.313937-2-lancelot.six@amd.com \
    --to=lancelot.six@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).