[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200723105735.mqfkfbljjda7qz7n@axis.com>
Date: Thu, 23 Jul 2020 12:57:35 +0200
From: Vincent Whitchurch <vincent.whitchurch@...s.com>
To: Steven Rostedt <rostedt@...dmis.org>
CC: John Ogness <john.ogness@...utronix.de>,
"jbaron@...mai.com" <jbaron@...mai.com>,
"mingo@...hat.com" <mingo@...hat.com>, kernel <kernel@...s.com>,
"corbet@....net" <corbet@....net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [PATCH] dynamic debug: allow printing to trace event
On Wed, Jul 22, 2020 at 05:28:23PM +0200, Steven Rostedt wrote:
> For you, I made this quick patch. If this works for you, I can make it
> into a formal patch. It includes a test use case in do_sys_openat2() to
> show the file name and file descriptor. Obviously, that wont be part of
> the final patch.
Thank you. I had to replace the inline with an __attribute__((unused))
because otherwise my GCC errors out with "error: function
'find_vprintk_len' can never be inlined because it uses variable
argument lists".
Apart from that it works fine, but the several calls to vsnprintf() take
their toll and this method is twice as slow as the buffer-on-stack
implementation (and ftrace_vprintk()). If I pass in a fixed size for
the __dynamic_array I get the same performance as the buffer-on-stack
method, but that's probably not surprising.
I know a dedicated trace event or a binary trace_printk() at the call
site of pr_debug() is always going to be more performant, but it would
be nice to avoid the extra slowdown if possible.
It's hard to guarantee that 256 bytes on the stack is safe on all
systems since these functions are called from lots of places.
Would it be acceptable to just use a fixed size for the event? At least
for my own debugging use cases it's preferable to just have to increase
the trace buffer size in case it's insufficient, rather than to have to
restort to one-off debugging code.
Powered by blists - more mailing lists