From patchwork Thu Mar 4 13:50:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1447325 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ULxmXytu; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DrslY1w8Pz9sSC for ; Fri, 5 Mar 2021 00:53:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 152DB82817; Thu, 4 Mar 2021 14:52:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ULxmXytu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B8BB182790; Thu, 4 Mar 2021 14:51:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F1085826FB for ; Thu, 4 Mar 2021 14:51:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x22e.google.com with SMTP id z126so30146693oiz.6 for ; Thu, 04 Mar 2021 05:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jzdSlokF6/yI65DwNywu+TbSLU+HjlnWt3jJ0h0HW+A=; b=ULxmXytu6onB0eZLf6pHoGfPijfNG8m5KEzNzM8BA7GnkKTnmvD/xJAE3dmg3Ylc9+ 1rcdnzawcMeJCVufWUPUR4DIBQiYl8Jl0jHBQcFZbOhVN4P8ncJf62E1Z28gtjoUdykF r8Kx0f4qxyLzffStA/HszCfSu8bpxiNQlaC88= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jzdSlokF6/yI65DwNywu+TbSLU+HjlnWt3jJ0h0HW+A=; b=nyrpFT9+eYHnOZ7bQcKeZVXThXieoJcSgdlG90rxA3zuc3+zc2H12UcZ6AnzjUotDd VoJZlu5Wc7xI+q1oeVhnAFWxD5zLRak0iuNw8vfJDRLLFEFNVU3oiwy4oQG65eZlxlXh DyZsGMm/6cGXwg0JjTQvS2lD81nNjKLiVwmo7NfvIanMj9n03SjZt8ts082mko9Bv+3T duBPMj+o+AvEq4/X0XK9Zt+F6DWvJeHCUT2YIQmMeJxr9NrtVTnp/JYHJ+GHBUbjHAJe pPtGOEsaJR2qnFygzZ0mKO2sEyfpv8DburJUvsxeAbAJBMcfV7Y6EGTnhqfie+6mD9Fh hJbw== X-Gm-Message-State: AOAM531jb1jEChPD8c8o/HHBx1VPzjTy3dh4pvUG+q1KWLLit2Y+CXIs UFxjTGB/i4DK/0ymzTfeaQ1MiZp+0MQ+a8Wd X-Google-Smtp-Source: ABdhPJzH83wI5/NfdqQqBtORTgc22ibdwADK7Jimc+Vz+3qk0Je0BXvLKLUxUymf0u84XS78pdKTrw== X-Received: by 2002:aca:7516:: with SMTP id q22mr1436921oic.158.1614865906669; Thu, 04 Mar 2021 05:51:46 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id x10sm4029465otp.19.2021.03.04.05.51.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 05:51:46 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Stephen Warren , Stephen Warren , Simon Glass Subject: [PATCH v4 04/42] sandbox: Drop the 'starting...' message unless testing Date: Thu, 4 Mar 2021 06:50:40 -0700 Message-Id: <20210304135118.643277-5-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210304135118.643277-1-sjg@chromium.org> References: <20210304135118.643277-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean This message is annoying since it is only useful for testing. Add a flag to control whether it is emitted or not, so it can be supressed by default. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/start.c | 15 +++++++++++++-- arch/sandbox/include/asm/state.h | 1 + test/py/tests/test_log.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index c4c4128d465..3dcab6a0cc8 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -389,6 +389,15 @@ static int sandbox_cmdline_cb_select_unittests(struct sandbox_state *state, } SANDBOX_CMDLINE_OPT_SHORT(select_unittests, 'k', 1, "Select unit tests to run"); +static int sandbox_cmdline_cb_log_test(struct sandbox_state *state, + const char *arg) +{ + state->log_test = true; + + return 0; +} +SANDBOX_CMDLINE_OPT(log_test, 0, "Show logging info on startup (for testing)"); + static void setup_ram_buf(struct sandbox_state *state) { /* Zero the RAM buffer if we didn't read it, to keep valgrind happy */ @@ -491,8 +500,10 @@ int main(int argc, char *argv[]) gd->reloc_off = (ulong)gd->arch.text_base; /* sandbox test: log functions called before log_init in board_init_f */ - log_info("sandbox: starting...\n"); - log_debug("debug: %s\n", __func__); + if (state->log_test) { + log_info("sandbox: starting...\n"); + log_debug("debug: %s\n", __func__); + } /* Do pre- and post-relocation init */ board_init_f(0); diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index bca13069824..d0e7fdbd5b0 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -105,6 +105,7 @@ struct sandbox_state { struct list_head mapmem_head; /* struct sandbox_mapmem_entry */ bool hwspinlock; /* Hardware Spinlock status */ bool allow_memio; /* Allow readl() etc. to work */ + bool log_test; /* Output some log info for testing */ /* * This struct is getting large. diff --git a/test/py/tests/test_log.py b/test/py/tests/test_log.py index f889120f2b3..e2955ab0770 100644 --- a/test/py/tests/test_log.py +++ b/test/py/tests/test_log.py @@ -43,7 +43,7 @@ def test_log_dropped(u_boot_console): """Test dropped 'log' message when debug_uart is activated""" cons = u_boot_console - cons.restart_uboot() + cons.restart_uboot_with_flags(['--log_test']) output = cons.get_spawn_output().replace('\r', '') assert 'sandbox: starting...' in output assert (not 'debug: main' in output)