From patchwork Fri Jan 2 00:50:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1167 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315095; bh=wgCbQk46sAVp5mMGNWdKJceZGnXsJPEI35CaExYsIfo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CqGAjHMaFUilyyrS0eoGnKnQmsoH9OLFHxQtZSwI3tK2Mfct95phOVog/kggSewZt a1mdFVWVX2/tPIxBj8bHAh/THoXjZaKpTD64Hchu+C+zM7IQ8e82+1OQzI83K2Q2Ag vxiLyUb4xOVNJKxIz22tsCXUWatuuwB6G8osi7JY4ceAf+Nzr701ywSYzbPz+rLlSg aGb7DRu8rm74TIVKl1GnX7B1v3Z9B2KA0hFxHt4sWK3pd17tdKsCeGvNRIRZ0f6NRY 1rHZ5yYVeqfUPXeCGAc6wFJ7w4Isb0M9AV0ho8eaD3o6fFkztQbiJb5KYPpjNmCs1k dMV9ENH3p8DGg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5E1D468F56 for ; Thu, 1 Jan 2026 17:51:35 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qK59ycc_A81S for ; Thu, 1 Jan 2026 17:51:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315095; bh=wgCbQk46sAVp5mMGNWdKJceZGnXsJPEI35CaExYsIfo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CqGAjHMaFUilyyrS0eoGnKnQmsoH9OLFHxQtZSwI3tK2Mfct95phOVog/kggSewZt a1mdFVWVX2/tPIxBj8bHAh/THoXjZaKpTD64Hchu+C+zM7IQ8e82+1OQzI83K2Q2Ag vxiLyUb4xOVNJKxIz22tsCXUWatuuwB6G8osi7JY4ceAf+Nzr701ywSYzbPz+rLlSg aGb7DRu8rm74TIVKl1GnX7B1v3Z9B2KA0hFxHt4sWK3pd17tdKsCeGvNRIRZ0f6NRY 1rHZ5yYVeqfUPXeCGAc6wFJ7w4Isb0M9AV0ho8eaD3o6fFkztQbiJb5KYPpjNmCs1k dMV9ENH3p8DGg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A04A68FFD for ; Thu, 1 Jan 2026 17:51:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315092; bh=HqLvP0KbRAVat8ijXoQt1gnRNZ6FwDh3X8R8q6YB8cg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b5BTyLKiUdnL6fBf9AibdwCGPBdryUuoBEUqUNQjQBl+p4R2rZAdKrEuX2N88Up7L huOO1W73cTX417RcJim4smqBDD+aLkxna4GhMkNBfbl7B2yjleO+Rl7JL2/Om7ljqY g98rueIuyi0CN5gLGwIjLKSF5HncAsNxAuYRw5MivFOZHAA1p9JzvNaa9hSQw4ZSNN NSM8uuKod15EDJm9CoZtOnqLL0EXbSDW455sR/wSeiu7WM1HUBrWwJgpjyDQl664Yb WaDwu4s55WyAXnGScGmBRnAFo863D2LGi91a9ncAy3E1tuZBqcl0FmmHyVU/fF68UW tE3YP3IQo1FZQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CE7306901E; Thu, 1 Jan 2026 17:51:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id rZL9wzHZ9HQy; Thu, 1 Jan 2026 17:51:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315090; bh=7X2Ky4hRS1WoM79Thw9wzQ6bymehUUYWeJF5kHEZs3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=USILo2gB0TTYeqxn1/ADGQAoaTmROFZN+oDkTcELDlM8rFLR4NJ9YZA1kzc0yywdn tENd+teJQ/6/xpqpr9pzKajNab+5J/xvF0b/d8LO3JG3LB4uGMr8DZlBS5E3mNO8C0 KxaMyc0l5XTGtbcolBPKS64op1ZCSvxmmwTrDN1x8tjiWSabXWMRWHeHquMsxxWXkF g2NvVEEKPM9Se8OvDNx7/JihUVYh1EnKJpXI5Rf/c/gou6WeS2gWvbxLNol7/MUsDG 2DAqekhdlydDGSZoEQmtWD0w+oc0sJ3RukJrOwnQiB3SRyB7zxNy5Dq2Zet4H9lljA xbXUMVLZSJwcA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D60EA68313; Thu, 1 Jan 2026 17:51:29 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 1 Jan 2026 17:50:33 -0700 Message-ID: <20260102005112.552256-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260102005112.552256-1-sjg@u-boot.org> References: <20260102005112.552256-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7H7T74LJ3CE37I57NUOGI6NIZHEDH7Z4 X-Message-ID-Hash: 7H7T74LJ3CE37I57NUOGI6NIZHEDH7Z4 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 03/30] sandbox: Add --quiet_vidconsole option to speed up output List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When running sandbox with lots of console output, the vidconsole slows things down significantly since it renders truetype fonts to the internal framebuffer. Add a -Q/--quiet_vidconsole command-line option that removes vidconsole from stdout and stderr, using only the serial console. This can provide a ~300x speedup for output-heavy operations. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/start.c | 10 ++++++++++ arch/sandbox/include/asm/state.h | 1 + board/sandbox/sandbox.c | 16 ++++++++++++++++ doc/arch/sandbox/sandbox.rst | 7 +++++++ test/py/tests/test_event_dump.py | 1 + 5 files changed, 35 insertions(+) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 30d4f83b6ee..1a5ca97e15e 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -476,6 +476,16 @@ static int sandbox_cmdline_cb_no_term_present(struct sandbox_state *state, SANDBOX_CMDLINE_OPT_SHORT(no_term_present, 'A', 0, "Assume no terminal present (for pager testing)"); +static int sandbox_cmdline_cb_quiet_vidconsole(struct sandbox_state *state, + const char *arg) +{ + state->quiet_vidconsole = true; + + return 0; +} +SANDBOX_CMDLINE_OPT_SHORT(quiet_vidconsole, 'Q', 0, + "Don't use vidconsole for stdout/stderr"); + static int sandbox_cmdline_cb_upl(struct sandbox_state *state, const char *arg) { state->upl = true; diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 6a89f0ca5ef..ff7493ec5d6 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -177,6 +177,7 @@ struct sandbox_state { bool soft_fail; /* Continue on failure */ bool pager_bypass; /* Enable pager-bypass mode */ bool no_term_present; /* Assume no terminal present */ + bool quiet_vidconsole; /* Don't use vidconsole for stdout */ int video_test; /* ms to wait before next assert */ const char *video_frames_dir; /* Directory to write video frames */ int video_frame_count; /* Number of frames written */ diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index d97945e58fc..78b2b7b1f47 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -10,7 +10,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -19,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -185,3 +188,16 @@ void fwu_plat_get_bootidx(uint *boot_idx) *boot_idx = 0; } #endif + +static int sandbox_settings(void) +{ + struct sandbox_state *state = state_get_current(); + + if (state->quiet_vidconsole) { + env_set("stdout", "serial"); + env_set("stderr", "serial"); + } + + return 0; +} +EVENT_SPY_SIMPLE(EVT_SETTINGS_R, sandbox_settings); diff --git a/doc/arch/sandbox/sandbox.rst b/doc/arch/sandbox/sandbox.rst index b2f4d8913d2..90c3dfa837e 100644 --- a/doc/arch/sandbox/sandbox.rst +++ b/doc/arch/sandbox/sandbox.rst @@ -208,6 +208,13 @@ available options. Some of these are described below: -P, --pager_bypass Enable pager bypass mode for testing. +-Q, --quiet_vidconsole + Don't use vidconsole for stdout/stderr. By default, sandbox outputs to both + serial and vidconsole. This can be slow when there is a lot of output, due to + truetype font rendering to the internal framebuffer. Use this option to use + only serial output, which can provide a significant speedup for output-heavy + operations. + -r, --read Read driver state from a dtb file. In conjunction with `-w`, this allows sandbox to save and restore emulated hardware state (such as a TPM) across diff --git a/test/py/tests/test_event_dump.py b/test/py/tests/test_event_dump.py index 3ddd60198fe..ff0da82196b 100644 --- a/test/py/tests/test_event_dump.py +++ b/test/py/tests/test_event_dump.py @@ -22,5 +22,6 @@ EVT_LAST_STAGE_INIT efi_block_device_create .*lib/efi_driver/efi_block EVT_LAST_STAGE_INIT install_smbios_table .*lib/efi_loader/efi_smbios.c:.* EVT_LAST_STAGE_INIT last_stage_init .*arch/sandbox/cpu/start.c:.* EVT_MISC_INIT_F sandbox_early_getopt_check .*arch/sandbox/cpu/start.c:.* +EVT_SETTINGS_R sandbox_settings .*board/sandbox/sandbox.c:.* EVT_TEST h_adder_simple .*test/common/event.c:''' assert re.match(expect, out, re.MULTILINE) is not None