tools/latency-collector: Use correct size when writing queue_full_warning
authorViktor Rosendahl <Viktor.Rosendahl@bmw.de>
Tue, 19 Oct 2021 16:07:01 +0000 (18:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:19 +0000 (19:16 +0100)
commit85a1da3d7a842944af9888c65c4a9f1ac9e0be0a
tree806832b28e8fbc556e193282e598bccee4c8540f
parent0db6161eacdac8bdda0a614b52dae073dc8cc34a
tools/latency-collector: Use correct size when writing queue_full_warning

[ Upstream commit f604de20c0a47e0e9518940a1810193678c92fa8 ]

queue_full_warning is a pointer, so it is wrong to use sizeof to calculate
the number of characters of the string it points to. The effect is that we
only print out the first few characters of the warning string.

The correct way is to use strlen(). We don't need to add 1 to the strlen()
because we don't want to write the terminating null character to stdout.

Link: https://lkml.kernel.org/r/20211019160701.15587-1-Viktor.Rosendahl@bmw.de
Link: https://lore.kernel.org/r/8fd4bb65ef3da67feac9ce3258cdbe9824752cf1.1629198502.git.jing.yangyang@zte.com.cn
Link: https://lore.kernel.org/r/20211012025424.180781-1-davidcomponentone@gmail.com
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/tracing/latency/latency-collector.c