linux/include/trace/stages
Steven Rostedt 0b603e7759 tracing: Add __print_dynamic_array() helper
[ Upstream commit e52750fb14 ]

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: ea8d7647f9 ("tracing: Verify event formats that have "%*p.."")
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-05-02 07:58:51 +02:00
..
init.h tracing: Move the defines to create TRACE_EVENTS into their own files 2022-03-11 11:49:23 -05:00
stage1_struct_define.h tracing: Add __cpumask to denote a trace event field that is a cpumask_t 2022-11-23 19:08:30 -05:00
stage2_data_offsets.h tracing: Rework __assign_str() and __string() to not duplicate getting the string 2024-03-18 10:32:27 -04:00
stage3_trace_output.h tracing: Add __print_dynamic_array() helper 2025-05-02 07:58:51 +02:00
stage4_event_fields.h tracing: Fix TASK_COMM_LEN in trace event format file 2023-02-12 10:23:39 -05:00
stage5_get_offsets.h tracing: Add __string_src() helper to help compilers not to get confused 2024-03-18 10:33:06 -04:00
stage6_event_callback.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
stage7_class_define.h tracing: Add __print_dynamic_array() helper 2025-05-02 07:58:51 +02:00