Message ID | 20240507091723.107082-1-lancelot.six@amd.com |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 B1F03385841D for <patchwork@sourceware.org>; Tue, 7 May 2024 09:18:11 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2043.outbound.protection.outlook.com [40.107.94.43]) by sourceware.org (Postfix) with ESMTPS id BD78F3858D1E for <gdb-patches@sourceware.org>; Tue, 7 May 2024 09:17:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD78F3858D1E Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BD78F3858D1E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.94.43 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1715073467; cv=pass; b=EZbUhWi7Ap1UuOIcl7LFvHE/r9BVm/NZAboCNAcoRS4G2I1k+s0yt/fIm0wjkJtxblRHhcU8Fuuc8fwQvGIQXIZI7lj+rrZ4QB/TfStuWWuMX/dmgruuAAzHEdOOiHs5GuI6VtHHhtqaycY/Vz/xj8B9GPNDMbNMeTa5+0XS5pQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1715073467; c=relaxed/simple; bh=ddIifLXb41ifHZr8H2FgwU2z6q4Cjp/IEVvpKkRQIfc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EkEYzsSTqihiWwcULH7ZhR4zhaIAVrMYMov5dxL5hwuC9kkdioeLEseizje0RVJJ4KH2XZ33ePwkf0w6jQO/Ty/vdxy7tsoZbnsxWXb/BJ5KFr4qg8cwpE1Vz6vlrPLWg27YeYFVQsX3sbTJ7CnEJvbn9Aqm+Si3VLhJ4vpAoUQ= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z7mVGd6DG6BrE1DtkfnlCB+roJyasviAarHn+et8sYafFfYHaHVDpUQ48/hsii+H1GAp38wpDRulP7ePKP+UuORZv6gsvk+CJ7AnfByVPY3a/jmyyKuyaOVKLDvnyC6OUmgpPpxiBXwxPztTuXYKQnaXy0jr71nWQUwq/pLy/GZRLxdVj33AxGg8NGwgHlhY/pk7IlR8nWIYGXvkTEz2unp0zQRNTaFg3hZZik4+bT7+DAkCSdJTsCi8GoGRXfOhCERHOm7MQ/hJCFzmPBpEBxpC1p5n9Kro6HUw8KhT+2IojjYsEl9H1W3UUHFHIlzDumtNzurDhGKuBFci6uSDIw== 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=2X/RfO9sx0Ehir3k9qu+xIIEpdIlEwMQQn5YrwliRw4=; b=nLYh2lJCWowzwZkHT075WlFtvMByHX7rf4Ydgy1DTd6TI2NgQnw3q9NaarIiBqDLo8jYNzzfl9z9cLeg1KsHxLx2F3VxGGHK6gobdsbhQEiuVqEVyb4gl7jwxtWCAq3nQ6Qg2JB5b7hY6cNBCMo83nQgLUn+6SekhPpHRMbcaKOxQ2O+3c5KHspXJbB//G/1vh0RewMogvEfxhc3bBDzY8Krf+c8lnHjSLy2ecIcnuswnZXEhUf9lKcT1bkpQBrWjiv3skxLD/VjF058kTGoJp6WQ8QUhLVpw4+1QGd3CU22RAses4GEQAk8mGEQw8wDQhAMWRO7jDzEiwhZBzviYQ== 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 (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2X/RfO9sx0Ehir3k9qu+xIIEpdIlEwMQQn5YrwliRw4=; b=KE4WLnIjwuZRwEvy6mdABuVx0J52UVuua52GMCDdZKKirbjLvjh6wmqPmVYxsINpYFRIG6MjceIABiFnVQdjBTVFAgKNqIp7sDr2/4QDIjswJe+0a61heZPE/F+NvEw3z2IJ/NW/HLGu94YP+pJNhIP2ulRXfwLjaWApyXpWHr8= Received: from SA1PR03CA0016.namprd03.prod.outlook.com (2603:10b6:806:2d3::18) by CH2PR12MB4183.namprd12.prod.outlook.com (2603:10b6:610:7a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42; Tue, 7 May 2024 09:17:41 +0000 Received: from SN1PEPF0002636B.namprd02.prod.outlook.com (2603:10b6:806:2d3:cafe::26) by SA1PR03CA0016.outlook.office365.com (2603:10b6:806:2d3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.43 via Frontend Transport; Tue, 7 May 2024 09:17:40 +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 SN1PEPF0002636B.mail.protection.outlook.com (10.167.241.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 7 May 2024 09:17:40 +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.2507.35; Tue, 7 May 2024 04:17:38 -0500 From: Lancelot SIX <lancelot.six@amd.com> To: <gdb-patches@sourceware.org> CC: <tdevries@suse.de>, Lancelot SIX <lancelot.six@amd.com> Subject: [PATCH] gdb/testsuite/lib/rocm: Fix with_rocm_gpu_lock Date: Tue, 7 May 2024 10:17:23 +0100 Message-ID: <20240507091723.107082-1-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: SN1PEPF0002636B:EE_|CH2PR12MB4183:EE_ X-MS-Office365-Filtering-Correlation-Id: f2d35d83-3d3c-4221-1c8e-08dc6e768ba8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|1800799015|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: X1dc9sfhT/TnGUQ2IzH0iSvSRywCRhMcR3jwrrcor+AwGOqgreuf/q9NvhqEpzUm24Y3Nhec9VDzh1n9y0eV3/s4nATqYEWBjXeRNwQb8Ti6xsE/96SzysfYKdDB/QEmTQAJu4qDCe5E0EOC95J3OnolwdGBsLZs4SyQEQqNzhr2kVPOZJjLIdG+RnOlOr41tkCe5XoSF7IpqKqw2dUSQ2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7qOtLeG00wXjKHYzWjGp+5P3Ab6i/mCLYTaWvZEQH5Lh8GCPsZ1y0vmp/Udk7lnZLt9g75mGL21DFaj9w6RE8RwkELaEupGvuuPlHoYvy3XvWD0gTt 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:(13230031)(376005)(1800799015)(36860700004)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 09:17:40.7233 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2d35d83-3d3c-4221-1c8e-08dc6e768ba8 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: SN1PEPF0002636B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4183 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, 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.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org |
Series |
gdb/testsuite/lib/rocm: Fix with_rocm_gpu_lock
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | warning | Patch is already merged |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | warning | Patch is already merged |
Commit Message
Lancelot SIX
May 7, 2024, 9:17 a.m. UTC
A recent commit refactored with_rocm_gpu_lock: commit fbb0edfe60edf4ca01884151e6d9b1353aaa0a7e Date: Sat May 4 10:41:09 2024 +0200 [gdb/testsuite] Factor out proc with_lock Factor out proc with_lock from with_rocm_gpu_lock, and move required procs lock_file_acquire and lock_file_release to lib/gdb-utils.exp. This causes regressions in gdb.rocm/*.exp (as well as in downstream ROCgdb). The issue can be reproduced in the following minimal test: load_lib rocm.exp set foo hello with_rocm_gpu_lock { verbose -logs $foo } The issue is that the body to execute under the lock is executed in the context of with_rocm_gpu_lock (uplevel 1 used in with_lock) instead of in the context of the "original" caller. This patch adjusted with_rocm_gpu_lock to account for the new extra frame in the call stack between the caller of with_rocm_gpu_lock and where the code execution is triggered. Change-Id: I79ce2c9615012215867ed5bb60144abe7dce28fe --- gdb/testsuite/lib/rocm.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: cdf5362f562ad605199f28db686f93251979ae5d
Comments
On 5/7/24 11:17, Lancelot SIX wrote: > A recent commit refactored with_rocm_gpu_lock: > > commit fbb0edfe60edf4ca01884151e6d9b1353aaa0a7e > Date: Sat May 4 10:41:09 2024 +0200 > > [gdb/testsuite] Factor out proc with_lock > > Factor out proc with_lock from with_rocm_gpu_lock, and move required procs > lock_file_acquire and lock_file_release to lib/gdb-utils.exp. > > This causes regressions in gdb.rocm/*.exp (as well as in downstream > ROCgdb). The issue can be reproduced in the following minimal test: > > load_lib rocm.exp > set foo hello > with_rocm_gpu_lock { > verbose -logs $foo > } > > The issue is that the body to execute under the lock is executed in the > context of with_rocm_gpu_lock (uplevel 1 used in with_lock) instead of > in the context of the "original" caller. > > This patch adjusted with_rocm_gpu_lock to account for the new extra > frame in the call stack between the caller of with_rocm_gpu_lock and > where the code execution is triggered. > Hi Lancelot, sorry for the breakage, thanks for fixing this. LGTM. Approved-By: Tom de Vries <tdevries@suse.de> Thanks, - Tom > Change-Id: I79ce2c9615012215867ed5bb60144abe7dce28fe > --- > gdb/testsuite/lib/rocm.exp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp > index 2276bb3640e..b2db0d5c783 100644 > --- a/gdb/testsuite/lib/rocm.exp > +++ b/gdb/testsuite/lib/rocm.exp > @@ -112,7 +112,7 @@ set gpu_lock_filename gpu-parallel.lock > # the GPU lock. > > proc with_rocm_gpu_lock { body } { > - with_lock $::gpu_lock_filename $body > + with_lock $::gpu_lock_filename {uplevel 1 $body} > > # In case BODY returned early due to some testcase failing, and > # left GDB running, debugging the GPU. > > base-commit: cdf5362f562ad605199f28db686f93251979ae5d
> sorry for the breakage, thanks for fixing this. No problem, that was an easy fix. > > LGTM. > > Approved-By: Tom de Vries <tdevries@suse.de> Thanks, I have pushed this patch. Best, Lancelot.
diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp index 2276bb3640e..b2db0d5c783 100644 --- a/gdb/testsuite/lib/rocm.exp +++ b/gdb/testsuite/lib/rocm.exp @@ -112,7 +112,7 @@ set gpu_lock_filename gpu-parallel.lock # the GPU lock. proc with_rocm_gpu_lock { body } { - with_lock $::gpu_lock_filename $body + with_lock $::gpu_lock_filename {uplevel 1 $body} # In case BODY returned early due to some testcase failing, and # left GDB running, debugging the GPU.