Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3336099ybd; Tue, 25 Jun 2019 00:28:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwh3ygvTVQZyRiWStgAdmTeBV9kPvIRg0iTPkto/fa0lvcNd4pKLkwtiHSi4oxa0gvixTRw X-Received: by 2002:a17:902:ac88:: with SMTP id h8mr75571713plr.12.1561447724470; Tue, 25 Jun 2019 00:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561447724; cv=none; d=google.com; s=arc-20160816; b=pYWxFcqPsq8BhzMtzs3vQJL1x5XRkKoldNpxJP3/p3s4JU8hsnYPULjPEJ4x1hPK1e ne6ycbmzu/8tVEnFiGYELT2mn/bu3JjTADtDGqRPiB/KXhXW5CuKAb4zQ60h3bAofbp7 uWBCSNDWmv3FmOQuScjf9JqE2gGoJIkqq/mquWHeahS7ib/oNzLhjaOqXCWkUd0/7k7y AmDxjiBT77Tr/98U2bY6MGu/PJQyPHaB7c40VtHTyUXBJkv1N/g2dH/GzdMoGjiZcFsP sTTNjn8ioCRi2MTY/0u6+0vk1hZE6gsL5i3hZH4mSjakS8CLd1+MzLuho5Gi1FeodWxR xyqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=sfZ6MM+CKJTwawGs+9Q66yrN9ADVg/QmQ74Ph81foqA=; b=zaXRfUGBfEraHQEdJh2txjXA7+TsOO8SnnXpxpr1OnFkvx/A36tq/XLMmjVt+HnhxM zinr8Ib53n0uNTozV/095U1NUJMl73ATUOTfh4btL+hQAmilm8yDxFu6GdWm4880ycOw hMsStd3LVDxb0w5JLw0VJFmuN5EnZl2Di+kcHXv3BEkD7Uni+5AivOOJlCzbypJJcakP YKdfDpO3vJAY3nDoZdbQWRxCfGIYqDIaGvdDH9hdE8LaHJHVHgfHDQ6xVrv0DplQgvSK Ye8xfF2gbdIPT7fVUgKy860zT37TTgFICvS4uti3Ad+41FMT2TtB1iVinQOLn1q5QnOJ KNHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si13867844pfe.275.2019.06.25.00.28.28; Tue, 25 Jun 2019 00:28:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728303AbfFYFhN (ORCPT + 99 others); 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-Spam-Summary: 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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.