Public

> -----Original Message-----
> From: amd-gfx <[email protected]> On Behalf Of Tvrtko
> Ursulin
> Sent: Friday, September 25, 2026 6:23 AM
> To: Melissa Wen <[email protected]>; [email protected]; Deucher, Alexander
> <[email protected]>; Pillai, Aurabindo <[email protected]>;
> Koenig, Christian <[email protected]>; Francis, David
> <[email protected]>; Wentland, Harry <[email protected]>;
> [email protected]; [email protected]; Li, Sun peng (Leo) <[email protected]>
> Cc: [email protected]; [email protected]; linux-
> [email protected]
> Subject: Re: [PATCH 8/8] drm/amd/display: copy function name into
> dcn_optc_lock_unlock_state trace event
>
>
> 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


Splitting the tracepoint and reconsidering the line number could be handled as 
a follow-up.
This patch fixes function-name decoding in userspace while keeping the existing 
tracepoint.
Thank you, Melissa and Tvrtko!
For all eight patches in this series:

Reviewed-by: Roman Li <[email protected]>


Reply via email to