From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73A51C48BD4 for ; Tue, 25 Jun 2019 05:37:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5409820659 for ; Tue, 25 Jun 2019 05:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727781AbfFYFhN (ORCPT ); Tue, 25 Jun 2019 01:37:13 -0400 Received: from smtprelay0098.hostedemail.com ([216.40.44.98]:37100 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727064AbfFYFhN (ORCPT ); Tue, 25 Jun 2019 01:37:13 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id B7673180A814F; Tue, 25 Jun 2019 05:37:10 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: toy89_3b5152c3463e X-Filterd-Recvd-Size: 3596 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Tue, 25 Jun 2019 05:37:05 +0000 (UTC) Message-ID: Subject: Re: [PATCH v4 5/7] lib/hexdump.c: Allow multiple groups to be separated by lines '|' From: Joe Perches To: Alastair D'Silva , alastair@d-silva.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Dan Carpenter , Karsten Keil , Jassi Brar , Tom Lendacky , "David S. Miller" , Jose Abreu , Kalle Valo , Stanislaw Gruszka , Benson Leung , Enric Balletbo i Serra , "James E.J. Bottomley" , "Martin K. Petersen" , Greg Kroah-Hartman , Alexander Viro , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , David Laight , Andrew Morton , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-fsdevel@vger.kernel.org Date: Mon, 24 Jun 2019 22:37:03 -0700 In-Reply-To: <20190625031726.12173-6-alastair@au1.ibm.com> References: <20190625031726.12173-1-alastair@au1.ibm.com> <20190625031726.12173-6-alastair@au1.ibm.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.5-0ubuntu0.18.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, 2019-06-25 at 13:17 +1000, Alastair D'Silva wrote: > From: Alastair D'Silva > > With the wider display format, it can become hard to identify how many > bytes into the line you are looking at. > > The patch adds new flags to hex_dump_to_buffer() and print_hex_dump() to > print vertical lines to separate every N groups of bytes. > > eg. > buf:00000000: 454d414e 43415053|4e495f45 00584544 NAMESPAC|E_INDEX. > buf:00000010: 00000000 00000002|00000000 00000000 ........|........ > > Signed-off-by: Alastair D'Silva > --- > include/linux/printk.h | 3 +++ > lib/hexdump.c | 59 ++++++++++++++++++++++++++++++++++++------ > 2 files changed, 54 insertions(+), 8 deletions(-) > > diff --git a/include/linux/printk.h b/include/linux/printk.h [] > @@ -485,6 +485,9 @@ enum { > > #define HEXDUMP_ASCII BIT(0) > #define HEXDUMP_SUPPRESS_REPEATED BIT(1) > +#define HEXDUMP_2_GRP_LINES BIT(2) > +#define HEXDUMP_4_GRP_LINES BIT(3) > +#define HEXDUMP_8_GRP_LINES BIT(4) These aren't really bits as only one value should be set as 8 overrides 4 and 4 overrides 2. I would also expect this to be a value of 2 in your above example, rather than 8. It's described as groups not bytes. The example is showing a what would normally be a space ' ' separator as a vertical bar '|' every 2nd grouping.