Whamcloud - gitweb
LU-14428 libcfs: discard cfs_trace_console_buffers[] 89/41489/4
authorMr NeilBrown <neilb@suse.de>
Tue, 9 Feb 2021 00:28:45 +0000 (11:28 +1100)
committerOleg Drokin <green@whamcloud.com>
Mon, 22 Mar 2021 16:26:07 +0000 (16:26 +0000)
commit95aa713f78e7acf992abda2fbb7242a6d0cc753d
tree0f576d71cfed7a525cec516290c839293d3f5910
parent5b09f471e5e22466a59e64168d21898c73167c4f
LU-14428 libcfs: discard cfs_trace_console_buffers[]

cfs_trace_console_buffers[] is a collection of buffers into which
various messages are formatted - with vscnprintf or similar - and
which are then passed to cfs_print_to_console which adds more
formatted information.

The two levels of formatting can instead be achieved using the "%pV"
format which takes a format-and-args.  If we do this, we don't need
cfs_trace_console_buffers[] and more.

One minor drawback is that cfs_tty_write_message() requires a final
string to print, not a format plus arguments.  This is only minor
because there is precisely one message that is ever sent to
cfs_tty_write_message(), and it contains no formatting.  So we now
generate a warning if the string passed with D_TTY ever contains
formatting, and just print that string ignoring any formatting.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ic78ac3703e5b6321dade8c367753c0aec1cae60b
Reviewed-on: https://review.whamcloud.com/41489
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/tracefile.c