From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (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 615453B27D0 for ; Thu, 19 Mar 2026 09:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773912597; cv=none; b=J7g75aoF0debNbFs+GzpI0aB2GUzrmdJ9Yqhq4DmzcikVlrLCOZlUJCB9qvF2ENGN8UEWukZDgX0aKKPk25FKXFxgiLrRKW5dxUEfUjPyQsrYbKobQGvwituo0mQ+K5Lzd8CP0JOIbOLHw3Jsb+nZKTJ4XVeFGnulq5sgdgYJfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773912597; c=relaxed/simple; bh=ax4HFZcmFjMNDGuU9pX8+5uiw8vri6ckell9mnCzzfw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=U4jWUwcxIg41LdQsEG9B9I8b/81RdeM4oGP0oGe1MNbiYnVpS0DJL6wOS+Ig2VQZ7LQ0hG7IKGl2W1+r/lFXe1njIW9+4ox2QOnsOt677gP4OXEuLMyCTqLpGHz/thTnJ1zK06WviEuyeKGRzudE53f+TlTxeSccjKEdY/kd/Ts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=BHHE5l/r; arc=none smtp.client-ip=91.218.175.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="BHHE5l/r" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1773912593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jfuU2tIasHBzSZouKvA4Aci7YVpJaQpLq+qFtobjLqw=; b=BHHE5l/rZtVjcraSBASBKbAF6dy0dhVFsd72cWANYkGMTd0cVvJF97g8YWoqOUxKMmdcaU Fm0bCjaHLoRTiv9QWlURnqys5KBwjIps6nyrcEI7i+TY11begBWKI5N+FPoDNft4D0JDOy Xrs/NxPDK8iCVCp/FDHpWusUJYHgYmo= From: Thorsten Blum To: Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky Cc: Thorsten Blum , Herbert Xu , linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] printk: add print_hex_dump_devel() Date: Thu, 19 Mar 2026 10:29:32 +0100 Message-ID: <20260319092932.208939-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1211; i=thorsten.blum@linux.dev; h=from:subject; bh=ax4HFZcmFjMNDGuU9pX8+5uiw8vri6ckell9mnCzzfw=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJm7D/7xMg1M+X96o29Mr5H5gsBXc3jK1A6fa5l7QtRfd cp3dXWWjlIWBjEuBlkxRZYHs37M8C2tqdxkErETZg4rE8gQBi5OAZjIy9OMDM9MJpkJtLnqC31M +fH13n/n1z4mBvVrd1fbvs1wXKhabMbwz8jMWPSTnYOax8Z5lRa//x3L8tyw4PzZvVdaLby/9NV KcwMA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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) +{ +} +#endif + /** * print_hex_dump_bytes - shorthand form of print_hex_dump() with default params * @prefix_str: string to prefix each line with;