]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing: Add __print_dynamic_array() helper
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 22 Oct 2024 19:36:28 +0000 (19:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:46:49 +0000 (07:46 +0200)
commit480b9fc4b2401c2130c28ac4fae0cb2095465f03
tree077d0189f94526ef49d2ab1fd8b9778f4ea9ae2c
parent247feaa17419eb25b1354a3071334aac6f8e0ebd
tracing: Add __print_dynamic_array() helper

[ Upstream commit e52750fb1458ae9ea5860a08ed7a149185bc5b97 ]

When printing a dynamic array in a trace event, the method is rather ugly.
It has the format of:

  __print_array(__get_dynamic_array(array),
            __get_dynmaic_array_len(array) / el_size, el_size)

Since dynamic arrays are known to the tracing infrastructure, create a
helper macro that does the above for you.

  __print_dynamic_array(array, el_size)

Which would expand to the same output.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Link: https://lore.kernel.org/r/20241022194158.110073-3-avadhut.naik@amd.com
Stable-dep-of: ea8d7647f9dd ("tracing: Verify event formats that have "%*p.."")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/trace/stages/stage3_trace_output.h
include/trace/stages/stage7_class_define.h
samples/trace_events/trace-events-sample.h