Message ID | 1373113bdaf2d4812c3d712684bd0019f992a032.1689759351.git.falcon@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2452730vqt; Wed, 19 Jul 2023 06:50:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7mLH0FESU+CeADfXG5csSHFDS8Uc0/i0UnROSEM8iFd23D/p2qkkKfHor16a6Ftx9OlA/ X-Received: by 2002:a05:6358:e49c:b0:137:5f79:7c2e with SMTP id by28-20020a056358e49c00b001375f797c2emr3176913rwb.0.1689774622700; Wed, 19 Jul 2023 06:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689774622; cv=none; d=google.com; s=arc-20160816; b=YUvOYFBuEcq+qHPW7hXxlC28mf2MjXjR7Tqe3S5NYHTOe/ov/r8aBXiQvNpIo7fFDX WnaM5Chks6fuaDate6UpWmCt+/wZX0aJ5gcTqCsdzCF7vXUKdRlLv6EPGB/7HHUApA9G vH4MwBK7l16mUhSjVG+HDpjdHdEAZydE1wsF3PnLQ3B0mfBexbeoMImF6/jzGvnAa9Q4 yCseEtw9fAmFz8g5LXVu+XQmZ7PqtU+eMb3Wl1NMhRPiKoRUrhrzUGYLl5wuNyW3vgtg mxW+npNNL+3bL9NsulcnQz+QE97pmfg/aM+8413Qs1y1W2nVyiWLmm0cT1h3G1LJy/wO UQ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=80gX1/UcnJTDi5kq1eU4Q1R7TUMAYeq6lajsNy0/Yds=; fh=LUnDCxFG3oyWlcYTkiNww5x4+0V5pkm51/GfDl61ZDU=; b=xGnGQ7cjFq/f/Ee2PqbuqgJN3/fkqIgbT/Foa0ZmYqwCy1Di1F4WGCR5Q50wIg+d7Y bTeC+vbrTPW9hmkmevp9tIn8JAsHEJTFaMIRJgYqyRwQEP/HTroGDRNi3csF5LhHm3bE LYP9T0iaUMrW4k1Dw4n0JTa1x/4JNIbdipZqozVfgwT0kehAnRP4/j32LcKwz4LCmAZX AEpxtLquBhTnPp8cncRXacSxQwjKfLmW91I22CXvmaGOLpP60SVuDlOPdGobFSTPSpI0 r/69uUJLasy6waYksXH2xYV+VFN/hzDqOfTx8cEnFEmrI5M0LkJiAYu+CQq17dOfcI/n QUXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a65538a000000b0055b71766bc0si3545691pgq.184.2023.07.19.06.50.01; Wed, 19 Jul 2023 06:50:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229911AbjGSNUc (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Wed, 19 Jul 2023 09:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGSNUb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Jul 2023 09:20:31 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBA8A113; Wed, 19 Jul 2023 06:20:29 -0700 (PDT) X-QQ-mid: bizesmtp85t1689772819twb1jfej Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:20:17 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: D2GZf6M6C/hj3mYQLM88nlD2/Bu6nnA6SGYdUSehcdKNVIGkXjN0KKlH1XkyC rw0zS+R2oehzieMoKnE3XC/UQkcpuzTLEUl+IxDag2sW11hJq2NSTs7tUnFs+JzstgFTm5z unpbSl/Fy6JIRLdNKwSRjWWZcPoHTLevni6NilJdqG0HPbQYUziCJIwMOZTF/BalkMtXf1Z rg2TWC0UCXFlS4Mm/5bPdxy2C9eqJxIKdO4G9XibDMP1pDpjj4nHRMxaErBf7q3RL9LArh8 v6Pm5gNrD4QtMj53G8dK9AE0fovcIj8My5M5mpCmpmtQey5kV0H9GckANp7Kxuf+NHHYnLm GK2vkuxrrObADSOGo6OgsZqq/KTPwc4rCfUiky0LLCakI/9hbyVhwEscb0Jgg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14450965798290048757 From: Zhangjin Wu <falcon@tinylab.org> To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 03/14] selftests/nolibc: print running log to screen Date: Wed, 19 Jul 2023 21:20:17 +0800 Message-Id: <1373113bdaf2d4812c3d712684bd0019f992a032.1689759351.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1689759351.git.falcon@tinylab.org> References: <cover.1689759351.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771857114731786951 X-GMAIL-MSGID: 1771857114731786951 |
Series |
selftests/nolibc: add minimal kernel config support - part1
|
|
Commit Message
Zhangjin Wu
July 19, 2023, 1:20 p.m. UTC
When poweroff fails, qemu-system will hang there without any output.
It is very hard to debug in such case, let's print the running log to
the screen to allow users to learn what is happening at the first
glance, without editing the Makefile manually every time.
To get a clean output, the 'grep status' command can be used.
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
tools/testing/selftests/nolibc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Jul 19, 2023 at 09:20:17PM +0800, Zhangjin Wu wrote: > When poweroff fails, qemu-system will hang there without any output. > > It is very hard to debug in such case, let's print the running log to > the screen to allow users to learn what is happening at the first > glance, without editing the Makefile manually every time. > > To get a clean output, the 'grep status' command can be used. The problem with doing this is that it rolls back to the initial version that breaks with qemu. When its stdout is sent to a pipe, we've found that the output got randomly mangled and/or missing contents. It's only when sent to a file that it's OK. I suspect it has something to do with non-blocking writes being used to avoid blocking the emulation but I could be totally wrong. That's the reason why we had to switch to a file. And I'd rather avoid starting it in the background as well. Maybe you'd want to run the qemu command under the "timeout" one ? That could be better than nothing. Willy
Hi, Willy > On Wed, Jul 19, 2023 at 09:20:17PM +0800, Zhangjin Wu wrote: > > When poweroff fails, qemu-system will hang there without any output. > > > > It is very hard to debug in such case, let's print the running log to > > the screen to allow users to learn what is happening at the first > > glance, without editing the Makefile manually every time. > > > > To get a clean output, the 'grep status' command can be used. > > The problem with doing this is that it rolls back to the initial > version that breaks with qemu. When its stdout is sent to a pipe, we've > found that the output got randomly mangled and/or missing contents. > It's only when sent to a file that it's OK. I suspect it has something > to do with non-blocking writes being used to avoid blocking the > emulation but I could be totally wrong. That's the reason why we had > to switch to a file. > ok, thanks for sharing the history, it is important. > And I'd rather avoid starting it in the background as well. Maybe > you'd want to run the qemu command under the "timeout" one ? That > could be better than nothing. Yeah, with the timeout logic, this may be not really required, so, let's drop this patch and the LOG_OUT from the previous one. with our timeout logic, we are able to quit qemu and then print the running log to screen to tell users what happens background, let's discuss timeout logic in its own patch. Thanks, Zhangjin > > Willy
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 8c531518bb9f..f1c8e4a0f1b2 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -168,7 +168,7 @@ libc-test: nolibc-test.c # common macros for logging RUN_OUT = $(CURDIR)/run.out -LOG_OUT = > "$(RUN_OUT)" +LOG_OUT = | tee "$(RUN_OUT)" REPORT_RUN_OUT = $(REPORT) "$(RUN_OUT)" # local libc-test