From patchwork Tue Oct 22 23:20:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13846255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F25BD2CDF6 for ; Tue, 22 Oct 2024 23:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=s/hCclruemc2oAgUqvAq0jDpE6JQw0QuXYeHo1AT2gw=; b=zNr93SrPk7ZkYkkpXn7BeMtguU mNOQyzyMfbnURHNYtozl5eMXNXYMXyl5DNUwRi2DS+mARBM1r4GsQ8X+hCz+mMFtk16mr9BgATETf 2s1+15i/Re1al97bMX9++pw1CTphSdtBSykjijpHvs7uRqS5Ff161mbLIeJ+OVhLlxKnkiNiIJ2/0 Jhrvs1miMGWGvgYOJEu38TfSFYoLx3aqxbOXHKDvWYvYDWGVrPvT08SYV/AB/kR3PHFO9+DHgdYPz ZTLv3fLx9DY3tUxLHPc4mHcPMi4lFGaVJQI3IGI5La59hXnToQPz2gEs3biXE9pKkVEqDdK0cnroR GUSlMgGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3OCx-0000000CQSo-0Be2; Tue, 22 Oct 2024 23:22:35 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3OBP-0000000CQCw-39gV for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 23:21:01 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 99E4CA44864; Tue, 22 Oct 2024 23:20:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A524C4CEC3; Tue, 22 Oct 2024 23:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729639258; bh=mYR/ssdjgfhPcrNhC0KC0PPm1VnAe2ZOjmzl7QmBqbs=; h=From:Date:Subject:To:Cc:From; b=RQqhPZnYi+hu1W9+0Gb1JegoQyjren/wSbeN62tNOBVVyJwZSA+zeOQQm/RuWvcFf qwaU3640jRT8+Oh2TqAEfkBZYlXdpc6idHMvOQQvrAOhsG54sp/kc+/WNWolwXiZvm JXVXJ4WTowaRAYmqA23wexFUeeP5kjUGn5X09eyvUB93Z4rujRAxH+eIiXcRbVrmBE 9dLXZsQyVie+VHbvzpCVnhk6pdNSp0A9LqFlRt2MvKZWfZUz+XJPWOOU8siAbXaNZ1 CM2fh0NsANoOECxKZilHRJt5isJMFWbQ9xGBoUJAxjsl5nYA61mo2JYPHazBGgxImf abJxA6sW2iEWw== From: Mark Brown Date: Wed, 23 Oct 2024 00:20:45 +0100 Subject: [PATCH] kselftest/arm64: Log fp-stress child startup errors to stdout MIME-Version: 1.0 Message-Id: <20241023-arm64-fp-stress-exec-fail-v1-1-ee3c62932c15@kernel.org> X-B4-Tracking: v=1; b=H4sIAEwzGGcC/x3MQQqDMBBG4avIrB1IYqilVxEXIf6pA9bKjIgg3 r2hy2/x3kUGFRi9mosUh5h81wrfNpTntL7BMlVTcCF653tO+nlELhvbrjBjnMhckiw8uT4iP0M usaPab4oi5/89jPf9A6VbXN5rAAAA X-Change-ID: 20241017-arm64-fp-stress-exec-fail-d074ec82cf43 To: Catalin Marinas , Will Deacon , Shuah Khan Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-9b746 X-Developer-Signature: v=1; a=openpgp-sha256; l=2334; i=broonie@kernel.org; h=from:subject:message-id; bh=mYR/ssdjgfhPcrNhC0KC0PPm1VnAe2ZOjmzl7QmBqbs=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBnGDNXQVJDieT+Ucl7taR/RCE7oQToa7f5rzjnl7vR Bx07CM6JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZxgzVwAKCRAk1otyXVSH0KP/B/ 0f7yI4J1eqPI/60TFfWUCAy/B74dWLr3AI0oXXkTBeC8Iw5PbSnnSYTmYE8GYLZ1hLdWzGUmXLvZhz QT52ebR/rVoO+6mo4xMYB1gGhubU9rSnWxO6VHO7THtMbkQ2jf0KfYfBmKrFIeWdTb6ur6zMThmMsT T1QnVt+cd73XvT9DtzmdiISNdZ8O7hut/3iZOqeDK2C2JxS/b5TL4aXmfqytnukeFUjsJs8enw4f+D AdfGjDS5a53HRT2Ny7MkI8cbf/6ZnQGTlLkLmSrfWIT26FEM7lOOZvCyqTRb8L9oih1aKBpxxId7jV Tmu/lXqMXR+gTai1JVaeEPx44zIyyH X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_162059_957877_972BE184 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently if we encounter an error between fork() and exec() of a child process we log the error to stderr. This means that the errors don't get annotated with the child information which makes diagnostics harder and means that if we miss the exit signal from the child we can deadlock waiting for output from the child. Improve robustness and output quality by logging to stdout instead. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-stress.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) --- base-commit: 8e929cb546ee42c9a61d24fae60605e9e3192354 change-id: 20241017-arm64-fp-stress-exec-fail-d074ec82cf43 Best regards, diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c index faac24bdefeb9436e2daf20b7250d0ae25ca23a7..80f22789504d661efc52a90d4b0893fbebec42f8 100644 --- a/tools/testing/selftests/arm64/fp/fp-stress.c +++ b/tools/testing/selftests/arm64/fp/fp-stress.c @@ -79,7 +79,7 @@ static void child_start(struct child_data *child, const char *program) */ ret = dup2(pipefd[1], 1); if (ret == -1) { - fprintf(stderr, "dup2() %d\n", errno); + printf("dup2() %d\n", errno); exit(EXIT_FAILURE); } @@ -89,7 +89,7 @@ static void child_start(struct child_data *child, const char *program) */ ret = dup2(startup_pipe[0], 3); if (ret == -1) { - fprintf(stderr, "dup2() %d\n", errno); + printf("dup2() %d\n", errno); exit(EXIT_FAILURE); } @@ -107,16 +107,15 @@ static void child_start(struct child_data *child, const char *program) */ ret = read(3, &i, sizeof(i)); if (ret < 0) - fprintf(stderr, "read(startp pipe) failed: %s (%d)\n", - strerror(errno), errno); + printf("read(startp pipe) failed: %s (%d)\n", + strerror(errno), errno); if (ret > 0) - fprintf(stderr, "%d bytes of data on startup pipe\n", - ret); + printf("%d bytes of data on startup pipe\n", ret); close(3); ret = execl(program, program, NULL); - fprintf(stderr, "execl(%s) failed: %d (%s)\n", - program, errno, strerror(errno)); + printf("execl(%s) failed: %d (%s)\n", + program, errno, strerror(errno)); exit(EXIT_FAILURE); } else {