[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241217175301.03d25799@gandalf.local.home>
Date: Tue, 17 Dec 2024 17:53:01 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Masami
Hiramatsu <mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, stable@...r.kernel.org
Subject: Re: [PATCH 1/3] ring-buffer: Add uname to match criteria for
persistent ring buffer
On Tue, 17 Dec 2024 14:24:08 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> (Aside: are those binary buffers actually exported to user space (that
> "u32 *bin_buf, size_t size" thing), or could we fix the binary printf
> code to really use a whole word for char/short values? The difference
> between '%hhd' and '%d' should be how it's printed out, not how the
> data is accessed)
libtraceevent is able to parse the raw trace_printk() events:
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/tree/src/event-parse.c#n5155
The format it reads is from /sys/kernel/tracing/events/ftrace/bprint/format:
name: bprint
ID: 6
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;
field:unsigned long ip; offset:8; size:8; signed:0;
field:const char * fmt; offset:16; size:8; signed:0;
field:u32 buf[]; offset:24; size:0; signed:0;
print fmt: "%ps: %s", (void *)REC->ip, REC->fmt
In this case, the "print fmt" is ignored.
Where the buf value holds the binary storage from vbin_printf() and written
in trace_vbprintk(). Yeah, it looks like it does depend on the arguments
being word aligned.
-- Steve
Powered by blists - more mailing lists