mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Li, Roman" <Roman.Li@amd.com>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
	Melissa Wen <mwen@igalia.com>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Pillai, Aurabindo" <Aurabindo.Pillai@amd.com>,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	"Francis, David" <David.Francis@amd.com>,
	"Wentland, Harry" <Harry.Wentland@amd.com>,
	"simona@ffwll.ch" <simona@ffwll.ch>,
	"siqueira@igalia.com" <siqueira@igalia.com>,
	"Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>
Cc: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"kernel-dev@igalia.com" <kernel-dev@igalia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 8/8] drm/amd/display: copy function name into dcn_optc_lock_unlock_state trace event
Date: Mon, 5 Oct 2026 01:25:09 +0000	[thread overview]
Message-ID: <DSWPR12MB9991270405E033D4C1F2F49B5C89962@DSWPR12MB999127.namprd12.prod.outlook.com> (raw)
In-Reply-To: <f21d5d36-9ced-4e03-a9a7-752d1f4cb9d9@igalia.com>

Public

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Tvrtko
> Ursulin
> Sent: Friday, September 25, 2026 6:23 AM
> To: Melissa Wen <mwen@igalia.com>; airlied@gmail.com; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>;
> Koenig, Christian <Christian.Koenig@amd.com>; Francis, David
> <David.Francis@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>;
> simona@ffwll.ch; siqueira@igalia.com; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>
> Cc: amd-gfx@lists.freedesktop.org; kernel-dev@igalia.com; linux-
> kernel@vger.kernel.org
> 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 <mwen@igalia.com>
> > ---
> >   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 <roman.li@amd.com>



      reply	other threads:[~2026-10-05  1:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 21:10 [PATCH 0/8] drm/amd/display: DM trace event cleanups Melissa Wen
2026-09-24 21:10 ` [PATCH 1/8] drm/amd/display: assign missing trace entry in amdgpu_dm_dc_clocks_state Melissa Wen
2026-09-25  9:45   ` Tvrtko Ursulin
2026-09-24 21:10 ` [PATCH 2/8] drm/amd/display: remove duplicated prev_p_state_change_support assignment Melissa Wen
2026-09-25  9:45   ` Tvrtko Ursulin
2026-09-24 21:10 ` [PATCH 3/8] drm/amd/display: fix vready offset assignment in dcn_optc_lock_unlock_state Melissa Wen
2026-09-25  9:47   ` Tvrtko Ursulin
2026-09-24 21:10 ` [PATCH 4/8] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class Melissa Wen
2026-09-25  9:55   ` Tvrtko Ursulin
2026-09-24 21:10 ` [PATCH 5/8] drm/amd/display: use right type for amdgpu_dc_performance event entries Melissa Wen
2026-09-25 10:03   ` Tvrtko Ursulin
2026-09-24 21:10 ` [PATCH 6/8] drm/amd/display: remove redundant cast on amdgpu_dc_reg_template printk Melissa Wen
2026-09-25 10:05   ` Tvrtko Ursulin
2026-09-24 21:10 ` [PATCH 7/8] drm/amd/display: copy function name into dcn_fpu trace event Melissa Wen
2026-09-25 10:17   ` Tvrtko Ursulin
2026-09-24 21:10 ` [PATCH 8/8] drm/amd/display: copy function name into dcn_optc_lock_unlock_state " Melissa Wen
2026-09-25 10:23   ` Tvrtko Ursulin
2026-10-05  1:25     ` Li, Roman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DSWPR12MB9991270405E033D4C1F2F49B5C89962@DSWPR12MB999127.namprd12.prod.outlook.com \
    --to=roman.li@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=David.Francis@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=airlied@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mwen@igalia.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=tvrtko.ursulin@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®