Message ID | 20230805072116.1260-1-thunder.leizhen@huaweicloud.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp341543vqr; Sat, 5 Aug 2023 01:41:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFs0uoG/W67BqFYo+ZNQIysfh9/juDJZg4Plm41le2uJCLcad2plKN1bQWmjwIYhdkEk5aG X-Received: by 2002:a05:6a20:4308:b0:13f:b3b4:1986 with SMTP id h8-20020a056a20430800b0013fb3b41986mr2294528pzk.12.1691224877455; Sat, 05 Aug 2023 01:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691224877; cv=none; d=google.com; s=arc-20160816; b=kPkNHk9PoracPtYN/2Lu4yHFLpBc8li3NECmfNnZFw7ri+92O+4e7MAi63mpYsyniv yp/e7Ep+BlnUMsqw1R5GWp2tZRQgcPbM8iNrk+Lu+CAjDgVVP/JltvFKmaLwzPkP3AVM pcuhCzyMzfcSvp7g+Sibpl2FtOpPZBC3BU3/6xufttnjn6BSDwHQiKG/hCOFxkL+1Ip/ yDcZglpURQLhy+Gbq0OuVH7J6/6V+fHELhYXUwOARJMZvbtNyGD6CAkVrFulve5Fs0eh efhnGDtvngpapXXwCHXRqffrEnucfeXdcBuGJKsJmK/5a4mXvKh/60DmN/aYgqlKsnVQ bDAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GUrMJo5QDrTr3EydvNNb8VV9Fw7A6GgGI6z7lu1WZ98=; fh=4XMCVqELsHQeLXPR8wfY+nEap6vsUBU0MIzBtyzMdg4=; b=RfEURq7Tv7cR0OQO3riJfJNxU2hZkev7yjjVxTYlBv9/hAsS0eY5YtQ8RPqFpL6coo mw1yrfjEzzg40k7J6ls4XVW2UuK3Ss2Dqyby3u/nkQkiph2u+TzJ2oIynmeLrrGVpcXi bf4otJMSPG8OQmMfORuhByb08UI/vQnOEMLBKQc2J18Jb+DP3vJCAX50y+ryWbo78QvV 2iOAMgLM2Uyotg71q+N8lTdvsXE0LjesUuqW0MVM9ulF6aWSK7aqzDu8E8F1pTfe4k2t G6MazPWvThhNULyAh8d4WVkqvXmeD69Agc1/ZkDZz6Btms5n7SER4rwRqud32djU5TPk 4wdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p16-20020a056a000a1000b006797c2c00besi3021164pfh.144.2023.08.05.01.41.04; Sat, 05 Aug 2023 01:41:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbjHEHWN (ORCPT <rfc822;liqunnana@gmail.com> + 99 others); Sat, 5 Aug 2023 03:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbjHEHVn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 5 Aug 2023 03:21:43 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FD6C4EC4 for <linux-kernel@vger.kernel.org>; Sat, 5 Aug 2023 00:21:41 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RHvCP0Qnwz4f3m7s for <linux-kernel@vger.kernel.org>; Sat, 5 Aug 2023 15:21:37 +0800 (CST) Received: from huaweicloud.com (unknown [10.174.178.55]) by APP4 (Coremail) with SMTP id gCh0CgAHoZR_+M1kFAdsPg--.4573S4; Sat, 05 Aug 2023 15:21:37 +0800 (CST) From: thunder.leizhen@huaweicloud.com To: Petr Mladek <pmladek@suse.com>, Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, John Ogness <john.ogness@linutronix.de>, linux-kernel@vger.kernel.org Cc: Zhen Lei <thunder.leizhen@huawei.com> Subject: [PATCH 0/2] hexdump: minimize the output width of address and offset Date: Sat, 5 Aug 2023 15:21:14 +0800 Message-Id: <20230805072116.1260-1-thunder.leizhen@huaweicloud.com> X-Mailer: git-send-email 2.37.3.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgAHoZR_+M1kFAdsPg--.4573S4 X-Coremail-Antispam: 1UD129KBjvdXoWruF13AFWrurWDuF48JryfXrb_yoW3Kwc_Xa s2qrykCa1UXF95AFW7AFn8ZrykCa1xCr1xZFnrXrnrJFWrJr1UWw4DWF98Xr18XrnxJa4D Xw1qq393Arn5KjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbwAYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_JFC_Wr1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwV A0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x02 67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxV AFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2 j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7x kEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwAKzVCY07xG64k0F24l42xK82IYc2Ij64vIr41l 4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67 AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8I cVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI 8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAF wI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07UuVbkUUUUU= X-CM-SenderInfo: hwkx0vthuozvpl2kv046kxt4xhlfz01xgou0bp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773377817040494760 X-GMAIL-MSGID: 1773377817040494760 |
Series |
hexdump: minimize the output width of address and offset
|
|
Message
Leizhen (ThunderTown)
Aug. 5, 2023, 7:21 a.m. UTC
From: Zhen Lei <thunder.leizhen@huawei.com>
The dump prefix is added to facilitate the reading of the dumped memory.
However, if the prefix content is too repeated or redundant, the readability
is reduced, and the ring buffer becomes full quickly and other prints are
overwritten.
For example: (DUMP_PREFIX_OFFSET)
Before:
dump_size=36:
00000000: c0 ba 8c 80 00 80 ff ff 6c 93 ee 2f ee bf ff ff
00000010: 00 50 1e 98 ff 27 ff ff 01 00 00 00 00 00 00 00
00000020: 80 ca 2f 98
After:
dump_size=36:
00: c0 3a 91 80 00 80 ff ff 6c 93 ae 76 30 ce ff ff
10: 00 60 cd 60 7d 4e ff ff 01 00 00 00 00 00 00 00
20: 40 9e 29 40
Zhen Lei (2):
hexdump: minimize the output width of the offset
hexdump: add a new dump prefix DUMP_PREFIX_ADDRESS_LOW16
include/linux/printk.h | 1 +
lib/hexdump.c | 17 +++++++++++++++--
2 files changed, 16 insertions(+), 2 deletions(-)