From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 20 Oct 2025 14:59:17 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vApTo-009tqp-36 for lore@lore.pengutronix.de; Mon, 20 Oct 2025 14:59:16 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vApTh-00010v-66 for lore@pengutronix.de; Mon, 20 Oct 2025 14:59:16 +0200 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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LGMvjmSL9UUxjVuooXEgNzxAicRhtLKilhqzHq/yRmA=; b=AQBbB3PYppkHY9d6X7EToKW619 r37sEfG+ZUQJWcHlGOpWMs6dYtUrM+riqJIyQxsIn94VeLABkwW29wlywJRwnBDM6OHlJ9Ofaf/k3 PoK2f5m2Uo1bYRVzE656jF8BTJbmMUXV+36/y+wgYHgFdzi+i6zsORw7uHP8sJrowEyH0wrwoxFSM ccl9hKI24GX06U3is8RvbxCuzvMkEZSYCUNApCKMonNhBQ39Ht1qMMqsTW/a6dnisaBs448+dOnkT lgkmOyxUiONnNG3EtyIVZEhoii6sDpsn8LqRNm81r3TGNpxXRW+lUStCE6AaBPq3bdUX40BNNkDtt JSLqc7Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vApSr-0000000DfUY-2zev; Mon, 20 Oct 2025 12:58:17 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vApSl-0000000DfHI-3j0W for barebox@bombadil.infradead.org; Mon, 20 Oct 2025 12:58:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LGMvjmSL9UUxjVuooXEgNzxAicRhtLKilhqzHq/yRmA=; b=oWaQfdqVy1w/xTTg1w4apFBxRV j7Hkq61+Xt4uihwLWDFGSsUdLb1Jiktq7tIWZ64UwTHY63VRLLRGn0TR0/uZmYG5Me00x+aVe9A8S D4bTAhBUp1T/1zAKdkUOwHAqDzEJXWq0yuB1IroyRHiGv56n2BvPLJKm+w+cGHL8L6yfPyHqeB1Zg Iw5uMnAleR5FQ64aTVBdqW0n2YrzYy0YKCyTnI9m1aGUTwW0CnVi01Esa6sNoyxtA2ZqlRtsV9oCU VtszjmhyWg3FgaoiA1rYpoaDhhXByITfj5pLp5ItAAMEWRyEfgh4OWBl909WuczmVPMAIlS9mMv5N x/6D3SQw==; Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by casper.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vApSe-00000007hVW-3iXK for barebox@lists.infradead.org; Mon, 20 Oct 2025 12:58:10 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vApSb-0008CL-Qy for barebox@lists.infradead.org; Mon, 20 Oct 2025 14:58:01 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vAlVM-004W4M-1e; Mon, 20 Oct 2025 10:44:36 +0200 Received: from sha by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1vAlVM-007Gb0-1I; Mon, 20 Oct 2025 10:44:36 +0200 Date: Mon, 20 Oct 2025 10:44:36 +0200 From: Sascha Hauer To: Marco Felsch Cc: barebox@lists.infradead.org Message-ID: References: <20251017120406.1348897-1-m.felsch@pengutronix.de> <20251017120406.1348897-3-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251017120406.1348897-3-m.felsch@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251020_135806_182256_0E6524C1 X-CRM114-Status: GOOD ( 21.72 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.1 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Re: [PATCH 3/4] lib: hexdump: make use of pr_debug X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.whiteo.stw.pengutronix.de) On Fri, Oct 17, 2025 at 02:03:35PM +0200, Marco Felsch wrote: > The hexdump library was ported from Linux which supports different > printk() level. Because the barebox print* facility is different > compared to the one from Linux the barebox printk() doesn't support > levels. Therefore the level is always set to an empty string. > > Furthermore all barebox printk() calls aren't recorded by the internal > barebox_logbuf because they are mostly used for command prints. Linux on > the other hand record each printk() print. > > Not recording the output can be an issue on systems which don't have a > hw-console but a USB-ACM console, because the hexdump call may already > occurred before the console was ready. > > Make use of pr_debug() instead to record the output within the > barebox_logbuf to be available later on via dmesg. Using pr_debug() > should be fine since it is mostly used for debugging/development > purpose. > > Signed-off-by: Marco Felsch > --- > lib/hexdump.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/lib/hexdump.c b/lib/hexdump.c > index 940c4eec64e9..ab5e3cf727ec 100644 > --- a/lib/hexdump.c > +++ b/lib/hexdump.c > @@ -284,16 +284,13 @@ void dev_print_hex_dump(struct device *dev, const char *level, > > switch (prefix_type) { > case DUMP_PREFIX_ADDRESS: > - printk("%s%s%s%p: %s\n", level, name, prefix_str, > - ptr + i, linebuf); > + pr_debug("%s%s%p: %s\n", name, prefix_str, ptr + i, linebuf); pr_debug is only compiled in when DEBUG is defined. This means you have to add a "#define DEBUG" in lib/hexdump.c to make the messages visible printed in another file, or alternatively have to define DEBUG globally. I think we should rather replace the const char *level argument with a unsigned int level argument expecting one of MSG_* and use pr_print() here. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |