From patchwork Tue Feb 7 13:27:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lancelot SIX X-Patchwork-Id: 64447 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD0103858C36 for ; Tue, 7 Feb 2023 13:28:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD0103858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675776539; bh=gFSoTKJzHzKCasQ75AKHkg/kGPdIEdO8DkptA0pTfu4=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=t0wZfjaVg7Vok7462uDKLCPOFCJOc4V58FCfw9YCDqqJ5A+IfpWQOifeNiaw/L7zr /JNnP8jMgYhW02YqPG+vJsgtecR0ICdsN4wfEUPxug3/jEmLT7+jdXs/W4YKFmMHaF 1tefXC92CSW8GHU8KKmxVkibxU4WvcdahxLFQwxM= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2081.outbound.protection.outlook.com [40.107.92.81]) by sourceware.org (Postfix) with ESMTPS id 24E3B3858D33 for ; Tue, 7 Feb 2023 13:28:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24E3B3858D33 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gP7AJlzYwMlqP0vQCOE/DqSREQsqyRpfM0wtRAVfjrPDhJAwMok9b8hirubJH4DGMNKSpmEXZj/ZDJeAgFc1eqbD8qsAw2/FGzn1IVdhCjKjdsICLA9L8zW1GuRJLBH+1Hh8Gr0DHlWyJkvqB/1d2sVbUZ5uo/FYJ2iqZv0cMZ/oMOrRFk7ElPLEk8J2Wtct0VwUBF/Ia/n2qNP95NEtK4PryG0e/oKho3Omd0UfJsWR4N7+TfPpENIbDPBa+ntNzUwVKrXFRuOH9/i2me/qRL3LMR4oCERWLHM3vOjP25TmcEiz1ezsE12ttpisjdwNDqYu9QwYlBObgBV11elTuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gFSoTKJzHzKCasQ75AKHkg/kGPdIEdO8DkptA0pTfu4=; b=V8+PBXjGd6O7NGUelvg2p9WXVhkCy+Vmu2gPsTWeaHeml8C9pQAv6sxYSymJvBdPqFFNa5BR7x6GRPzMt3eCRTu0y1m3NGzSjm8tEK+3tr+aaZ9e6jS1VlVqi9Di9YFZMfVzheNOl6b74qqKG4Hpe6ZS/LVsV3wON6EYF0oh0l4NlbLF+INlabvCzoF9s/XC0uBvWlMBRgKvXaRZIuQrRY6EsG8GICCh5ctOSfhnZC5c1yD9I377e7YiXDafQh8peTitIgpR3yGR8rHRXyzGSJvrHCUHxV3sO2FAtGG/7FBJ2rLNhlJZADp8B6ghF2gDcjf1cCBcZ3Ukz/KmLsSGVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM6PR11CA0014.namprd11.prod.outlook.com (2603:10b6:5:190::27) by PH8PR12MB6963.namprd12.prod.outlook.com (2603:10b6:510:1be::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Tue, 7 Feb 2023 13:28:31 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::55) by DM6PR11CA0014.outlook.office365.com (2603:10b6:5:190::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.35 via Frontend Transport; Tue, 7 Feb 2023 13:28:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6086.16 via Frontend Transport; Tue, 7 Feb 2023 13:28:31 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Feb 2023 07:28:29 -0600 To: CC: , Lancelot SIX Subject: [PATCH 1/4] gdb: 'show config' shows --with[out]-amd-dbgapi Date: Tue, 7 Feb 2023 13:27:59 +0000 Message-ID: <20230207132802.223510-2-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230207132802.223510-1-lancelot.six@amd.com> References: <20230207132802.223510-1-lancelot.six@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT010:EE_|PH8PR12MB6963:EE_ X-MS-Office365-Filtering-Correlation-Id: f14cdb54-b776-4975-095d-08db090f3491 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ngPlWjL9rMHMlidC2GFo5w9wijeWUBqwl14F4eqEMFQ3NPFS+DihwcVrhUp7K0uEn+m3b72HVd5JNnYr271YNIdVNKsm5y6QvY9Ft6SUtp5SQi0RRWviE6njqSjuTFrz798qUiUFqsrTm0SQWoqChLpoUmRA/g+qwU4cMIoqJKJK+AE37lA6XgTxpn2muuC7nXuCreAN9bQlPDB9dsIB3L+pX8dtE1q8DvNvZBiUFsDDw9QEu5BKePGNsxXpHLhLyKRSHM0d8f44GDFxk1RWera4v/r9JPXS8TZDRnfDFo6eHQwJ6FZE+ZhJkv9srTTIUj3Ww1+5nbz452oN6hnWKSwGLnI6n9Snhbc/J86v4l9/qk+sq3rJbUhckurY9vM3DVzEbPo1OTr/UUeFwCEYqGJEGywgFB1FXfdObQvgDQsowK1rPNg2A1DwUC/h4fdYwd5iaGSbM6F7stcRdv6+vroP3l3tLI/nK88pGS5Mm/5qzFMcPLj5oMhC36JQCDquuxqSFfiQrX/l2XleoyA64rxZh3Mmo8LF4QHm5F9NXDkfvUNUb5mynk6JLQnk8KaQDIYE7fd54M/0GXjlBtJ7vqncam9fkhKHr1YnM8qzOwAsRyJVeAoGoXESgH4gFq7sibb8yVJEOeosSVWoRJtuu+XOqSftWXcVWMOaFFQn/kulAyARrFUwK6oLVj/GiVWGnvakQUDR0EsNja1jIj5/uhJ7XRsAn6CgaMutY2OWQu8= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230025)(4636009)(136003)(39860400002)(376002)(346002)(396003)(451199018)(40470700004)(36840700001)(46966006)(45080400002)(478600001)(7696005)(54906003)(316002)(1076003)(2616005)(82310400005)(16526019)(186003)(6666004)(26005)(36756003)(5660300002)(86362001)(40460700003)(82740400003)(426003)(47076005)(40480700001)(4326008)(83380400001)(336012)(70206006)(8676002)(70586007)(6916009)(2906002)(81166007)(36860700001)(356005)(8936002)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 13:28:31.3199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f14cdb54-b776-4975-095d-08db090f3491 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6963 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lancelot SIX via Gdb-patches From: Lancelot SIX Reply-To: Lancelot SIX Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Ensure that the "show configuration" command and the "--configuration" command line switch shows if GDB was built with the AMDGPU support or not. This will be used in a later patch in this series. --- gdb/config.in | 3 +++ gdb/configure | 3 +++ gdb/configure.ac | 1 + gdb/top.c | 10 ++++++++++ 4 files changed, 17 insertions(+) diff --git a/gdb/config.in b/gdb/config.in index 7da131ebf04..a6027847444 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -84,6 +84,9 @@ */ #undef HAVE_ALLOCA_H +/* Define if amd-dbgapi is being linked in. */ +#undef HAVE_AMD_DBGAPI + /* Define to 1 if you have the `btowc' function. */ #undef HAVE_BTOWC diff --git a/gdb/configure b/gdb/configure index 113b7cf8a30..8b2039912e7 100755 --- a/gdb/configure +++ b/gdb/configure @@ -18252,6 +18252,9 @@ $as_echo "yes" >&6; } fi if test "$has_amd_dbgapi" = "yes"; then + +$as_echo "#define HAVE_AMD_DBGAPI 1" >>confdefs.h + TARGET_OBS="$TARGET_OBS amd-dbgapi-target.o" # If --enable-targets=all was provided, use the list of all files depending diff --git a/gdb/configure.ac b/gdb/configure.ac index 7c7bf88b3fb..79eb013ce19 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -275,6 +275,7 @@ if test "$gdb_require_amd_dbgapi" = true \ [has_amd_dbgapi=yes], [has_amd_dbgapi=no]) if test "$has_amd_dbgapi" = "yes"; then + AC_DEFINE(HAVE_AMD_DBGAPI, 1, [Define if amd-dbgapi is being linked in.]) TARGET_OBS="$TARGET_OBS amd-dbgapi-target.o" # If --enable-targets=all was provided, use the list of all files depending diff --git a/gdb/top.c b/gdb/top.c index 205eb360ba3..2447ba55bca 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1629,6 +1629,16 @@ This GDB was configured as follows:\n\ ")); #endif +#if HAVE_AMD_DBGAPI + gdb_printf (stream, _("\ + --with-amd-dbgapi\n\ +")); +#else + gdb_printf (stream, _("\ + --without-amd-dbapi\n\ +")); +#endif + #if HAVE_SOURCE_HIGHLIGHT gdb_printf (stream, _("\ --enable-source-highlight\n\ From patchwork Tue Feb 7 13:28:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lancelot SIX X-Patchwork-Id: 64450 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 50A8B385840C for ; Tue, 7 Feb 2023 13:29:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50A8B385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675776570; bh=q7mTO4EuVXGo/OFm6rX9KgorTaYbj3U5PEOS74iBr6E=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=AKs3loqVhvWqdkYuCuJO6Un6OXwRWFMI5SB2Q14leVUoX82mbC+Z0/Ley5kKmNLOm VqqpaKch0c1KsnQ28E8pWPgtp8QX/tfV+Ok3pqqaCqSf8mpfs6dj4s+Y7qHEa+tskC urx8+TOhK0YsE1uaM/DNv6mUzCDfI/5ibfGU5Lp4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2052.outbound.protection.outlook.com [40.107.243.52]) by sourceware.org (Postfix) with ESMTPS id EA5FB3858D38 for ; Tue, 7 Feb 2023 13:28:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA5FB3858D38 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ElWSbTCiOCyL5YD72R7VE+UbgQrjTrYRPTTju1WmkxGqZE88bB+5dXJxMewQPW8LnxtOqiF3mlFl1fKBC9nvAB7Bop6SBNgkbME/8lgwfm+23lX1UYNt9CUJNOofOT+HSZcdlcJyQTz6qwgTLXNVleXdgaO1bhJ9S7uM/Pj4rrerCRpaMjwx39wOidkAiTRb7hyZ68hTzr6+qWDB7utdqvRS9mt+YUGHGHEJ8Dlmy43pYEB8pI3BbEqtvv/SH3J1xySHYvwQAalaOKKuIMZ4OeIots0wnWFUqrCCITHTtM3WFGDXZ4nUEx+JHddyrajaqP/QHq145abo/dTVeDxwrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=q7mTO4EuVXGo/OFm6rX9KgorTaYbj3U5PEOS74iBr6E=; b=oZhY1X41eHQ30cIpddG8ojYAFCIqz1V5XTDoGK7yVY+UJVjBtcGOERZ93hTzlWy74AoBREdTUHBMTWjuUpcFFhBU3a2Ty6yHvyJ23DajwhFgWAf5GcTWTckfvLkoy8g8KVIew25QHm9fEipJlHlsalxQ1GKAqnxsLBN98y1R1H24pxipv4F8OtJSxEZ3gFhq4se8ue4L3G5XP9FvMaRYL2oCtTYArZQiWeicVRacYLOaadkiaJ56fYjGeYG/lpJ/r0a/7ZC1nila1mKTsONoV/VnzecoOPcH0EMm5HC3mawkELRYz4CpPueI3oXQiXfzrmgobyUe50sIY9LoeNRbhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM6PR11CA0012.namprd11.prod.outlook.com (2603:10b6:5:190::25) by BN9PR12MB5177.namprd12.prod.outlook.com (2603:10b6:408:11a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Tue, 7 Feb 2023 13:28:32 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::ee) by DM6PR11CA0012.outlook.office365.com (2603:10b6:5:190::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36 via Frontend Transport; Tue, 7 Feb 2023 13:28:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6086.16 via Frontend Transport; Tue, 7 Feb 2023 13:28:32 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Feb 2023 07:28:30 -0600 To: CC: , Lancelot SIX Subject: [PATCH 2/4] gdb/testsuite: Rename skip_hipcc_tests to allow_hipcc_tests Date: Tue, 7 Feb 2023 13:28:00 +0000 Message-ID: <20230207132802.223510-3-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230207132802.223510-1-lancelot.six@amd.com> References: <20230207132802.223510-1-lancelot.six@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT010:EE_|BN9PR12MB5177:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ca38435-0635-41a0-c483-08db090f3530 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jNdWVozqTGbYMdiGhm8YiwY3Ui3fjGrm3fPiNTA6CWDNuA3+D2Wy7s/wfco1xk3FO7YeHMw0OxhndLs1mhE0JJTAh00J6D+yM9aD5MLvjTcDy9Xwu2wcecdWGDV+OnwqAJWhfMXZZ162GhX6OE2pj8prgslDoM2wlnJYsc7lyFHuJce64jyN7Wwio2+I3AV7M2Rj0js5kQoS7wulAmJDHtLcg3Z72iQMQtiQHdcGeECxyvH2UYVDtU1Aalv35exNPpaUEMXocWbpx9jMhxS6Jhp0FqpwCy8vXX5mO0ApVyujEBN9b1fjFjXFKCpmEm0op0esPe4n6ioEjdbrCcyrSFNx07wdTxSgU5qouy3kQ96EYvWTNjUz87I42F986AHN68NAz0933+NLuuWVTRRrN0EcCFNx/0kwJQlEyl3Ydcp2pf1+AUjH/wjhMVjy5pFtFXVpJzkNEB43+ZFNAuaAyBZoC4aoCtPpKXnnmo5Szauq7SH/4kGm6i7nu1GPouNjBaoQiEXeWtLml3RjkoUaVdRC7WIMUEsEuXkYIBX8dXJh6Cs2v7u0n+tWdEh1HTEmj3o5/JbQFJv1gZPdcAYcAQZKHyKV+aga4zBiIun5IDShjUInjJemTlG6nnFdQQcX+6W2A2cg2iaiZarAMoxgrUG4UB7ebE006m6qlU6qiLVzFNYWdUbtWONOVUeVb40AiFyzN3vVphWvv7OhU+nhbEcBUgMb9GWx+0SST6AHrP888/2Ytt2EUtTXuvOCsdnCCC/IRHYWVReS/83tI9VtxA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(396003)(39860400002)(346002)(451199018)(40470700004)(46966006)(36840700001)(40460700003)(4326008)(82740400003)(81166007)(316002)(356005)(8936002)(8676002)(41300700001)(6916009)(70586007)(70206006)(2906002)(36860700001)(5660300002)(2616005)(1076003)(6666004)(26005)(16526019)(478600001)(186003)(82310400005)(86362001)(83380400001)(54906003)(426003)(47076005)(336012)(7696005)(40480700001)(36756003)(84970400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 13:28:32.3823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ca38435-0635-41a0-c483-08db090f3530 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5177 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lancelot SIX via Gdb-patches From: Lancelot SIX Reply-To: Lancelot SIX Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Rename skip_hipcc_tests to allow_hipcc_tests so it can be used as a "require" predicate in tests. Use require in gdb.rocm/simple.exp. --- gdb/testsuite/gdb.rocm/simple.exp | 5 +---- gdb/testsuite/lib/rocm.exp | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.rocm/simple.exp b/gdb/testsuite/gdb.rocm/simple.exp index f84df71414e..befcc7aaabc 100644 --- a/gdb/testsuite/gdb.rocm/simple.exp +++ b/gdb/testsuite/gdb.rocm/simple.exp @@ -20,10 +20,7 @@ load_lib rocm.exp standard_testfile .cpp -if [skip_hipcc_tests] { - verbose "skipping hip test: ${testfile}" - return -} +require allow_hipcc_tests if {[build_executable "failed to prepare" $testfile $srcfile {debug hip}]} { return diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp index e22f392deb1..1440ac85d32 100644 --- a/gdb/testsuite/lib/rocm.exp +++ b/gdb/testsuite/lib/rocm.exp @@ -15,14 +15,14 @@ # # Support library for testing ROCm (AMD GPU) GDB features. -proc skip_hipcc_tests { } { +proc allow_hipcc_tests { } { # Only the native target supports ROCm debugging. E.g., when # testing against GDBserver, there's no point in running the ROCm # tests. if {[target_info gdb_protocol] != ""} { - return 1 + return 0 } - return 0 + return 1 } # The lock file used to ensure that only one GDB has access to the GPU From patchwork Tue Feb 7 13:28:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lancelot SIX X-Patchwork-Id: 64448 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1ED31385B52C for ; Tue, 7 Feb 2023 13:29:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1ED31385B52C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675776547; bh=165XItic3Ljm688Z30Orn0lrbzYZNCAagn5zHRAMxiY=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=HqlrvrkKn5awLozoGqy3wM+nNsP9tRATOYHU+7CFPZaugtuTFBKSUCdjHadRnQWuh RwpCD0rNn5VZhFk4npLLjIoa8QZsirgkGW48q6eDMZoRyQzCjwFTnRrkT1HnciItIV NBU1ImnKxfIQXDnvCU0I86HV/ci3VSd1SyXBwlCM= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.45]) by sourceware.org (Postfix) with ESMTPS id D1CBB3858D39 for ; Tue, 7 Feb 2023 13:28:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1CBB3858D39 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aRiCLKff9+JE7MhnANtKkZfrDkXwM7F0ENHT67C0FTqU8QgRM3pPO33I5fOnd993sX60kElc+H6Dx8OtdTQpJoIl50swY4h/wIruskv68mYNqfOlCA6xXUhm9BKpB1kGEcDyRWTgRZwm3hChxStJD2K667gzwg4QMdysxuB/F55jbwQhsZZRibpzkC+Ci/3buWMKdWDEXCTOUEXD/lqfgJC7StwD2IDc66WAblPouSzyAIJNk74/UchbdSe4ZT2QmZulVHl4T+66D0LN3KywjGsSagbA4e99FrwfLCcq/7ctPKSmuJFqNtIb81fdVyVd2WJwWbSZDX9tdHKCJXIaww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=165XItic3Ljm688Z30Orn0lrbzYZNCAagn5zHRAMxiY=; b=nZzbpJvW9MvSqRDbRH0w+QG1m28DBltbXCgxXkyvbjuJV3lc4iG1JajOLlm5qAer17+c90KbSZd1kAixu9AbCI7aRbydt1x2JgwoXnAoj5U22OoInHV1YWl4zorUuxzklehl6C8Fqj8AnWYhyiDFk1K8Z3IWqCaRAPEXuTSOSbjz3N8NE4qz/vwHP3bSJY6qUsY5mj8AzbKEnIS7vnW7A6U3GmdCxUT+DQHTGTSA0pIz7JlJj+j7FSLvngIVqGHZsEHiGEaDCGV42DkqvX5um6XKSVhPWJJjwrOHZZhOkiW+ifKSpeMcpIh3vFCxfBhP7NZUZLh24sqfKaq60d9+uA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM6PR11CA0030.namprd11.prod.outlook.com (2603:10b6:5:190::43) by PH8PR12MB7110.namprd12.prod.outlook.com (2603:10b6:510:22e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Tue, 7 Feb 2023 13:28:33 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::6b) by DM6PR11CA0030.outlook.office365.com (2603:10b6:5:190::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36 via Frontend Transport; Tue, 7 Feb 2023 13:28:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6086.16 via Frontend Transport; Tue, 7 Feb 2023 13:28:33 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Feb 2023 07:28:31 -0600 To: CC: , Lancelot SIX Subject: [PATCH 3/4] gdb/testsuite: require amd-dbgapi support to run rocm tests Date: Tue, 7 Feb 2023 13:28:01 +0000 Message-ID: <20230207132802.223510-4-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230207132802.223510-1-lancelot.six@amd.com> References: <20230207132802.223510-1-lancelot.six@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT010:EE_|PH8PR12MB7110:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a59f4e1-fa79-4f56-30a4-08db090f35c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e8HVpyU4khPaOYRA6z7Lz2MdkT3D7n9KcJrQHxcfdq1dV8l9QUVEe30aSiLfvE+lmhPCZFHkY+5spYFexTgbGh+fXYtYoVupzYPqfnwkW8g/Qau4FJbRZBj1pE3uAJ8nVRYeMIV1Vkz/K2YaC6jUJftvW/NjuEMQfp9XyHl5gE4Jb2GjrNs8HvJpOCREOfJrrkDH1y7tjXjidYSUiMMfQwiWrH4EGojnkvvtr/djoWjOdv5+3+ve3BagkiIYVoF9fWQ6bK9vHv4t3+GJkmV9wcSkkxi3tlxrior2SBtpxHarRYLtHg2I3wHDnXxB7EkGZkJ8lfSyYxdC2GgP11USpvXiEgCR+ciF7CWBQHgRXto3kVKQtwLYMBp4SFZeA3UE0ifBy6WwDEx0SRj4DX7TP0zeCQHv+xzu/IkmODlbNYVawDOsiD6aF8ldj0/Qvj5utLAPbSAxCUGj5ulUj8iZ/SrDVVRoA1Egh24AIaxKNisEfEYRbsfj5Woqy/pWq3/RV1dqzOoAl5xHrNqiQPABe72FvRxNOrrn/cq+9oSNs0EO04UCzGxghi0u3ivBrF44OEOYUOiWP0svAHw+r2AAOkHSj/z1gP9I7LW4FyoiuoNtgRewk8OG9H2RsRu7MVNPWUnct2yOhcyuTCwHYFTRjwnC33YyxKMaVGcZi886nBkOgbzHqWZI271uG0XLSkXjbzD149oou+yE4wn2r9ylFO9b1jP8XCyiqu1flDm2oNs= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230025)(4636009)(376002)(346002)(136003)(39860400002)(396003)(451199018)(40470700004)(46966006)(36840700001)(4326008)(426003)(82310400005)(54906003)(36860700001)(8676002)(5660300002)(40480700001)(41300700001)(8936002)(356005)(4744005)(86362001)(316002)(82740400003)(81166007)(16526019)(1076003)(47076005)(186003)(336012)(83380400001)(40460700003)(26005)(7696005)(2616005)(2906002)(36756003)(478600001)(70206006)(6666004)(70586007)(6916009)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 13:28:33.3354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a59f4e1-fa79-4f56-30a4-08db090f35c2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7110 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lancelot SIX via Gdb-patches From: Lancelot SIX Reply-To: Lancelot SIX Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Update allow_hipcc_tests to check that GDB has the amd-dbgapi support built-in. Without this support, all tests using hipcc and the rocm stack will fail. --- gdb/testsuite/lib/rocm.exp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp index 1440ac85d32..b5b59748c27 100644 --- a/gdb/testsuite/lib/rocm.exp +++ b/gdb/testsuite/lib/rocm.exp @@ -22,6 +22,13 @@ proc allow_hipcc_tests { } { if {[target_info gdb_protocol] != ""} { return 0 } + + # Ensure that GDB is built with amd-dbgapi support. + set output [remote_exec host $::GDB "$::INTERNAL_GDBFLAGS --configuration"] + if { [expr {[string first "--with-amd-dbgapi" $output] == -1}] } { + return 0 + } + return 1 } From patchwork Tue Feb 7 13:28:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lancelot SIX X-Patchwork-Id: 64449 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B22913858032 for ; Tue, 7 Feb 2023 13:29:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B22913858032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675776551; bh=BO5jtvQidGmVj/wEq2oVmEm+DeGIMNKwglrOlogcdss=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=FP8OSQuz2M0AURV8NY7zza8S0dgUmJCZDcbuzGOfXTAbXUAkRoQgSnsOgfjV+MFWF eTOOIzHDRmV9i0vwowFEsetF8kCgA4mP6xo3Kv27DUID7Adb7YBKRkh30eKCG7oh2A Twi/tbEmu5vDhbdgHrPdvrEM+mHivNpS6wHMFx8Q= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20608.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::608]) by sourceware.org (Postfix) with ESMTPS id 6D894385841D for ; Tue, 7 Feb 2023 13:28:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D894385841D ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YZY49McuTaJh00gAsWnVUoxgjB9x8wCkoafsXz+a9ohcu3SfeDP09P7vrouBgxVT45zeDhWQfFriqKexeGcSnA0Qt3damD9rhaPo4vxKei1Fhm99EYTM9yhI7sSHh11mGoTWEp4B/XZW+397sxZpVBl+p+fPICXF0NmGzyVHAiPCsQpheoy7rO59A22k0uveidx37FjSX7NHEqydCFvphmX1Gqn1ft+q0hTP/TR1eStnN01l0dh8e98QFXitlbAeE7QXHIism4Z+qM0QqCFp3LIjdoHF7mDfYkF7pUTkwPjIMQoW5RI10lldxSwU4Gn02ee9ItMml92h0pXAICcDIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BO5jtvQidGmVj/wEq2oVmEm+DeGIMNKwglrOlogcdss=; b=GZD85ZRUWm8O9nkXy2Tfr/XBLDB8igGTQ1Cr6qbPmN8CcSg+llzs/LTI8kOAmRjU7T2wXGSaOj6bkCGO2zmuA2vSZfw5CxapJaneEBMaVKVI9zmyyZupqLOR1fAWAVbP58v6+Gbx+fhO+u59kM64QhstSH1X7bIhRCsAzf4ztsH2Lvk0O3px+uDaNFgbRqRNAdB1EJ4cVaYa3tCMoS1IzW3Xj46ZIidb6JWvqEa39u8EMlPjcBx0UmVZloO3xyTEBw2OKA8SOXxqhbpP3ZaTzTaPip7QhxRa/u8zrZL496+b1jU0N698BPPuq0BtplSTTaV6vEajb0It76miKVcUQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM6PR11CA0009.namprd11.prod.outlook.com (2603:10b6:5:190::22) by DM6PR12MB4497.namprd12.prod.outlook.com (2603:10b6:5:2a5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Tue, 7 Feb 2023 13:28:35 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::36) by DM6PR11CA0009.outlook.office365.com (2603:10b6:5:190::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.35 via Frontend Transport; Tue, 7 Feb 2023 13:28:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6086.16 via Frontend Transport; Tue, 7 Feb 2023 13:28:35 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Feb 2023 07:28:33 -0600 To: CC: , Lancelot SIX Subject: [PATCH 4/4] gdb/testsuite: allow_hipcc_tests tests the hipcc compiler Date: Tue, 7 Feb 2023 13:28:02 +0000 Message-ID: <20230207132802.223510-5-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230207132802.223510-1-lancelot.six@amd.com> References: <20230207132802.223510-1-lancelot.six@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT010:EE_|DM6PR12MB4497:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f18535d-7f5d-42ae-f192-08db090f372e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rEzerzfiYfrAn9wXO4WgPm+Vrk59u3hKfdu7ClBY3p2Oc9AercezbQiS9qY+FlTr4X5RnFyS71iAkoGR3FDCtbzrdtGSKAX8c9L/jDtoeHH9c8rLJvW7eTKyGjdrxYNyqBxinoVBas9QniMaCgRRtlFv9yYusPwrAodThdOJ9b4tptA1Pgg5MOa+UOv366E2ngdGsv+x2fn8i/XmNp4V3jNuEsMKEbCeMImxgaX8h+JtyyI3up7V08ZOcGd95YJ7GJfbLO/jz1MqOAL6ijN5+ms/7aLw0jLwxBUA8iiZbi0SLFj14bERJ0EJwlOYHSKmwJXQVYlUfQzVXlsjJTNVF58U0q8tY0LwL2McymqhnYAL5HQ8QkTSGcPC179VN6dKPdaDdhsQtUOOrdN0efmpuGrtROf5cTiYYa5lqLjLKarGIMvLouP5Pq3BJgApMO1Do8AmjCqkHS6ecnYoFQ4KWD+1MiXm/ObET/R4zlmIHLPnI4xyI/OweoR9jNZ2M3GIEviamPzzE+QK4Yj+InDScvppS5TFnEMyqYsNYWSiHfABHJ+cdvnrV/SBNVRrwQi8RSTBP1vzNHO8LonyKb21A72BsLHmNtCu2/eknvrQ24Gez3t2mzCtJ3H+DwZ80Nzas7WlFhwxyh8LT5ZRANUoZpKiaAfxZeopUHp3eKpZWHTk3U6+CuL23hXuybHcOgAj50POvlGiNfyS8FsIZqaVS3zVjeobd/bpTbcpcG4IAEk= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230025)(4636009)(136003)(39860400002)(346002)(396003)(376002)(451199018)(36840700001)(46966006)(40470700004)(83380400001)(36860700001)(81166007)(7696005)(36756003)(40460700003)(70586007)(6916009)(40480700001)(70206006)(86362001)(16526019)(4326008)(8676002)(82310400005)(2616005)(336012)(426003)(356005)(47076005)(82740400003)(478600001)(6666004)(186003)(26005)(1076003)(5660300002)(8936002)(316002)(54906003)(2906002)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 13:28:35.7102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f18535d-7f5d-42ae-f192-08db090f372e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4497 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lancelot SIX via Gdb-patches From: Lancelot SIX Reply-To: Lancelot SIX Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Update allow_hipcc_tests so all gdb.rocm tests are skipped if we do not have a working hipcc compiler available. To achieve this, adjust gdb_simple_compile to ensure that the hip program is saved in a ".cpp" file before calling hipcc otherwise compilation will fail. One thing to note is that it is possible to have a hipcc installed with a CUDA backend. Compiling with this back-end will successfully result in an application, but GDB cannot debug it (at least for the offload part). In the context of the gdb.rocm tests, we want to detect such situation where gdb_simple_compile would give a false positive. To achieve this, this patch checks that there is at least one AMDGPU device available and that hipcc can compile for this or those targets. Detecting the device is done using the rocm_agent_enumerator tool which is installed with the all ROCm installations (it is used by hipcc to detect identify targets if this is not specified on the comand line). This patch also makes the allow_hipcc_tests proc a cached proc. --- gdb/testsuite/lib/gdb.exp | 4 +++ gdb/testsuite/lib/rocm.exp | 69 +++++++++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index faa0ac05a9a..6333728f71e 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4581,6 +4581,10 @@ proc gdb_simple_compile {name code {type object} {compile_flags {}} {object obj} set ext "go" break } + if { "$flag" eq "hip" } { + set ext "cpp" + break + } } set src [standard_temp_file $name-[pid].$ext] set obj [standard_temp_file $name-[pid].$postfix] diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp index b5b59748c27..06d5b3988b8 100644 --- a/gdb/testsuite/lib/rocm.exp +++ b/gdb/testsuite/lib/rocm.exp @@ -15,7 +15,51 @@ # # Support library for testing ROCm (AMD GPU) GDB features. -proc allow_hipcc_tests { } { +# Get the list of gpu targets to compile for. +# +# If HCC_AMDGPU_TARGET is set in the environment, use it. Otherwise, +# try reading it from the system using the rocm_agent_enumerator +# utility. + +proc hcc_amdgpu_targets {} { + # Look for HCC_AMDGPU_TARGET (same env var hipcc uses). If + # that fails, try using rocm_agent_enumerator (again, same as + # hipcc does). + if {[info exists ::env(HCC_AMDGPU_TARGET)]} { + return [split $::env(HCC_AMDGPU_TARGET) ","] + } + + set rocm_agent_enumerator "rocm_agent_enumerator" + + # If available, use ROCM_PATH to locate rocm_agent_enumerator. + if { [info exists ::env(ROCM_PATH)] } { + set rocm_agent_enumerator \ + "$::env(ROCM_PATH)/bin/rocm_agent_enumerator" + } + + # If we fail to locate the rocm_agent_enumerator, just return an empty + # list of targets and let the caller decide if this should be an error. + if { [which $rocm_agent_enumerator] == 0 } { + return [list] + } + + set result [remote_exec host $rocm_agent_enumerator] + if { [lindex $result 0] != 0 } { + error "rocm_agent_enumerator failed" + } + + set targets [list] + foreach target [lindex $result 1] { + # Ignore gfx000 which is the host CPU. + if { $target ne "gfx000" } { + lappend targets $target + } + } + + return $targets +} + +gdb_caching_proc allow_hipcc_tests { # Only the native target supports ROCm debugging. E.g., when # testing against GDBserver, there's no point in running the ROCm # tests. @@ -29,6 +73,29 @@ proc allow_hipcc_tests { } { return 0 } + # Check we have a working hipcc compiler available. + set targets [hcc_amdgpu_targets] + if { [llength $targets] == 0} { + return 0 + } + + set flags [list hip additional_flags=--offload-arch=[join $targets ","]] + if {![gdb_simple_compile hipprobe { + #include + __global__ void + kern () {} + + int + main () + { + kern<<<1, 1>>> (); + hipDeviceSynchronize (); + return 0; + } + } executable $flags]} { + return 0 + } + return 1 }