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_optc_lock_unlock_state to copy the function name into the trace
event.

Fixes: f1943a51f0f9 ("drm/amd/display: Add events log to trace OPTC lock and 
unlock")
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 b2f38654e489..7f05f73e5b33 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
@@ -660,7 +660,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
            TP_ARGS(optc_state, instance, lock, function, line),
TP_STRUCT__entry(
-                            __field(const char *, function)
+                            __string(function, function)
                             __field(int, instance)
                             __field(bool, lock)
                             __field(int, line)
@@ -678,7 +678,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
                             __field(int, vready_offset)
            ),
            TP_fast_assign(
-                          __entry->function = function;
+                          __assign_str(function);
                           __entry->instance = instance;
                           __entry->lock = lock;
                           __entry->line = line;
@@ -700,7 +700,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
                      "min_v_blank_interlace=%d vstartup_start=%d vupdate_offset=%d 
vupdate_width=%d "
                      "vready_offset=%d",
                      __entry->lock ? "Lock" : "Unlock",
-                     __entry->function,
+                     __get_str(function),
                      __entry->line,
                      __entry->instance,
                      __entry->opp_count,

Hmm this one does have the macro->function->macro->function trick unlike the previous patch so unless I am wrong function name and line number are always the same? Ie. it could be converted to two separate tracepoints and would just lose the (questionable) line number.

Regards,

Tvrtko

Reply via email to