From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E013374E46 for ; Thu, 19 Mar 2026 09:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773913572; cv=none; b=ZDZCa4areJXtKnbsKIs0VcQXgyQg8l/HNtMVEUVx9XRUdmMTxBu0XL+D+skbvMhWhxWOLpefNUQiiq0Pm5f1aYCjTt9rVg2HxAn9P7HCcIPn4aqlrgeqTjq5Ue90L29RJ9rdNfK9i/M94aEbrOXGCd2dTsncDawHlqSlZSHeGu8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773913572; c=relaxed/simple; bh=zigYJVFmtBfzHq0XYgBtjlqfs36ABnWuAZkeXik61xc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=J77FeR898rB9ZgkxlV5fsS+21Njy6oIFpFCGKYGZZb4t7m59tQjfEYBF/gaCYd/XA/fwUetyWG/uThGi+lfJ1lBgOH0gTEnp0sa2TZeCHV7i6iqDRTLF6OdvYzRNQxeAQJHFKL4y9Dt7LHiBy7j/4Ro1SCnbDWGYUhkN2y+2PWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Kur37wn+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qNpQh5T9; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Kur37wn+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qNpQh5T9" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773913570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pcIeOJ5i7CsCehEfMMj5i+JyN20FYcPn4g2orSwKqus=; b=Kur37wn+yO7R3UflS/DlkS00VHOwxsBbP32SWGT+B5I2e9UlWB9GGRKkjGTcf9PvEf2uEU T5roIcOw/hhGzfn2xn5vkvTsVJSGYjB+OM+ouOT+P9VLxBbPDvWS7T7DPlRNPVqQ0E/wXf WS/5qpTEepbsZ535g3mXtUdaMRyb3preo6K6snDLgF4Rb8xInFNh7qcRqKG/pTuq9+7B5d +AP0NaHe5/InqcKpXJVQ++SHIF+gPRTssXfJqS1DRrW8RR1iLwCmv8rtoLkksUPf3oO/ay K777dR9P6bc2m8cNRzMsnJ7i7pEfgEykh4ht58J8y4ADH9zTCLBN+6xd+Dnf/Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773913570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pcIeOJ5i7CsCehEfMMj5i+JyN20FYcPn4g2orSwKqus=; b=qNpQh5T9bKzhugXrh7wdz+Ja43ZLpnKeZFmYGDjFzYVU+kS1U42XNyCIUOtch74aXgUJzQ BXFPNDODft6lCjDw== To: Thorsten Blum , Petr Mladek , Steven Rostedt , Sergey Senozhatsky Cc: Thorsten Blum , Herbert Xu , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] printk: add print_hex_dump_devel() In-Reply-To: <20260319092932.208939-3-thorsten.blum@linux.dev> References: <20260319092932.208939-3-thorsten.blum@linux.dev> Date: Thu, 19 Mar 2026 10:52:09 +0106 Message-ID: <87a4w4gnj2.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On 2026-03-19, Thorsten Blum wrote: > Add print_hex_dump_devel() as the hex dump equivalent of pr_devel(), > which emits output only when DEBUG is enabled, but keeps call sites > compiled otherwise. > > Suggested-by: Herbert Xu > Signed-off-by: Thorsten Blum > --- > include/linux/printk.h | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/include/linux/printk.h b/include/linux/printk.h > index 63d516c873b4..54e3c621fec3 100644 > --- a/include/linux/printk.h > +++ b/include/linux/printk.h > @@ -801,6 +801,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, > } > #endif > > +#if defined(DEBUG) > +#define print_hex_dump_devel(prefix_str, prefix_type, rowsize, \ > + groupsize, buf, len, ascii) \ > + print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ > + groupsize, buf, len, ascii) > +#else > +static inline void print_hex_dump_devel(const char *prefix_str, int prefix_type, > + int rowsize, int groupsize, > + const void *buf, size_t len, bool ascii) > +{ > +} If you look at the implementation of pr_devel(), it is using no_printk() in the !DEBUG case. I believe this is to validate correct arg formatting, even if the code will optimized out. John Ogness