Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1117658rwo; Sat, 22 Jul 2023 06:59:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlGVY5mKlqEyGpVmXsZ5iOvl+CQF6RJhFC1UJb/K9XMETo3V/yjdhnww4ctViQq9tat7foKQ X-Received: by 2002:a05:6a20:197:b0:101:1951:d491 with SMTP id 23-20020a056a20019700b001011951d491mr3184578pzy.6.1690034397926; Sat, 22 Jul 2023 06:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690034397; cv=none; d=google.com; s=arc-20160816; b=i92feSkFZcP9khbdD+unkeD62hOuTS0hJk7e2aUWnlSYAmgCKsmDOOvhRpPviBOkoa 1RdseVYGTxYOXBxvz3LGyEd6xiEM3kdAth4tLlS201Sbeop28dDe/+2UENRUXR2JViz7 C0OWY/Au+IDvdxIm6M9FHp3Iai5obT+EDu460F4kOWqjQVwRPdUgNVoYp/Pg2TPdxXML f1RKH2fx2VD0fT426Ch/XmBGZONeQnR76uhbYiSPm6i11WkKQz9uWC+b88fg/EiNJBvu jLz4Rd9ym8i/XCbnTnAbLlsDOyaKAH4gu1qn2S21kOTMJc+8pKZoP5JOHqlw0EGra+bm v5lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pLTM40Ynu7tXl7Z5RjJ/B27G7Um9XM1X/H+9b2TR3fk=; fh=ujwW7c4tbJyQEFqfHDIuJXTy68vjNzYK6N7f8YmL270=; b=xb5SCDugOrxpIJ8GmDDXhLE7+BXLQhKZDN1bkfVKQqo8lp8LeLVn00TJ5hni0+RNbt hLMJsQTAYl7oH0BS3qtdO3RiXwigw2ZHykyve6sZi5DtL+q8DrV3KauB4I4vGCy0Ai8u DPwlxcOdkHA8Ezlm1TNpfTbpoI+pAwL6wUElGLbGYVaViGqyFxwntPgTPMMLMYiHL0cs VWfPHuMKR+hEJtgxrLul828W0m5AgT+dzv0N2MNrOO2lJFg7bGZgyhWfmTeIKEK3cE5C ABTA7QoFRKTY6ZOVv1HHFdlEq7YIq5frtZH4MuPaRE1HaQUmjtdSpKLrZbLO4umRzEyg 9YZg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a056a00134400b006828af9aeb5si5349595pfu.352.2023.07.22.06.59.44; Sat, 22 Jul 2023 06:59:57 -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 S229922AbjGVM3i (ORCPT + 99 others); Sat, 22 Jul 2023 08:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbjGVM3h (ORCPT ); Sat, 22 Jul 2023 08:29:37 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E3601E0; Sat, 22 Jul 2023 05:29:34 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 36MCTQA4017403; Sat, 22 Jul 2023 14:29:26 +0200 Date: Sat, 22 Jul 2023 14:29:26 +0200 From: Willy Tarreau To: Zhangjin Wu Cc: thomas@t-8ch.de, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 03/14] selftests/nolibc: print running log to screen Message-ID: <20230722122926.GF17311@1wt.eu> References: <1373113bdaf2d4812c3d712684bd0019f992a032.1689759351.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1373113bdaf2d4812c3d712684bd0019f992a032.1689759351.git.falcon@tinylab.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,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: X-Mailing-List: linux-kernel@vger.kernel.org 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