[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6723f7e664470_7b1f129430@iweiny-mobl.notmuch>
Date: Thu, 31 Oct 2024 16:34:30 -0500
From: Ira Weiny <ira.weiny@...el.com>
To: metux <metux@....de>, Ira Weiny <ira.weiny@...el.com>, Andrew Morton
<akpm@...ux-foundation.org>, Petr Mladek <pmladek@...e.com>, Steven Rostedt
<rostedt@...dmis.org>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>, Sergey Senozhatsky
<senozhatsky@...omium.org>, Jonathan Corbet <corbet@....net>, Davidlohr Bueso
<dave@...olabs.net>, Jonathan Cameron <jonathan.cameron@...wei.com>, "Dave
Jiang" <dave.jiang@...el.com>, Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>, Dan Williams
<dan.j.williams@...el.com>
CC: Fan Ni <fan.ni@...sung.com>, Bagas Sanjaya <bagasdotme@...il.com>,
<linux-kernel@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-cxl@...r.kernel.org>
Subject: Re: [PATCH v2 0/4] printf: Add struct range print specifier
metux wrote:
> On 26.10.24 02:46, Ira Weiny wrote:
> > Support for the Compute Express Link (CXL) Dynamic Capacity Devices
> > (DCD) have grown a number of uses to print struct range.[1] Support for
> > a printf specifier '%pra' was being worked within a large series and has
> > garnered a number of comments and discussion.
>
> This is just printing out hex dump of a memory range, correct ?
No. This prints the struct range values not the data.
>
> What I'm looking for quite some time is a sane way for dumping structs
> in a human readable form (field: value pairs, using their actual types
> eg. int vs string, ...).
>
> Any idea to do that in a generic way ?
> (potentially using debug info ?)
>
For printing buffers less than 64 bytes look at:[1]
%*ph
or bigger buffers
print_hex_dump()
Ira
[1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html
Powered by blists - more mailing lists