On 24/09/2026 22:10, Melissa Wen wrote:
Userspace trace tools that use libtraceevent to read binary buffer only see a kernel address when printing const char *. Use string macros in dcn_fpu to copy the function name into the trace event. Fixes: 96ee63730fa3 ("drm/amd/display: Add control mechanism for FPU") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Melissa Wen <[email protected]> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h index 7de4fe355c5d..b2f38654e489 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h @@ -637,20 +637,20 @@ TRACE_EVENT(dcn_fpu,TP_STRUCT__entry(__field(bool, begin) - __field(const char *, function) + __string(function, function) __field(int, line) __field(int, recursion_depth) ), TP_fast_assign( __entry->begin = begin; - __entry->function = function; + __assign_str(function); __entry->line = line; __entry->recursion_depth = recursion_depth; ), TP_printk("%s: recursion_depth: %d: %s()+%d:", __entry->begin ? "begin" : "end", __entry->recursion_depth, - __entry->function, + __get_str(function), __entry->line ) );
The approach taken by TRACE_DCN_FPU is a bit over the top. Macro calling a function, calling a macro, calling a function.
Tracepoints are supposed to be ABI (said Linus, for better or worse) and tying kernel function names to ABI is a bad idea. Even line numbers. All very questionable IMO.
But as your patch fixes an obvious fail: Reviewed-by: Tvrtko Ursulin <[email protected]> Regards, Tvrtko
