On Wed 2024-10-30 11:51:54, 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 ? > > 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, ...). You like to print it similar way like "gdb" or other debugging tools do. Do I get it correctly, please? > Any idea to do that in a generic way ? > (potentially using debug info ?) I am afraid that a generic solution would really need to work with a debuginfo. That said, there exists some generic approaches for printing various values in the trace code, for example, see Documentation/trace/kprobetrace.rst Documentation/trace/events.rst Best Regards, Petr