mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
To: Melissa Wen <mwen@igalia.com>,
	airlied@gmail.com, alexander.deucher@amd.com,
	aurabindo.pillai@amd.com, christian.koenig@amd.com,
	David.Francis@amd.com, harry.wentland@amd.com, simona@ffwll.ch,
	siqueira@igalia.com, 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
Date: Fri, 25 Sep 2026 11:23:03 +0100	[thread overview]
Message-ID: <f21d5d36-9ced-4e03-a9a7-752d1f4cb9d9@igalia.com> (raw)
In-Reply-To: <20260924211410.867686-9-mwen@igalia.com>


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


      reply	other threads:[~2026-09-25 10:23 UTC|newest]

Thread overview: 17+ 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 [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=f21d5d36-9ced-4e03-a9a7-752d1f4cb9d9@igalia.com \
    --to=tvrtko.ursulin@igalia.com \
    --cc=David.Francis@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mwen@igalia.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.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®