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 4/8] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class
Date: Fri, 25 Sep 2026 10:55:09 +0100	[thread overview]
Message-ID: <1accce61-be0a-4fbe-90e0-9503853d80d5@igalia.com> (raw)
In-Reply-To: <20260924211410.867686-5-mwen@igalia.com>


On 24/09/2026 22:10, Melissa Wen wrote:
> Don't create an amdgpu_dm_atomic_state_template event since this is just
> a template. Declare the template as an event class that will be used by
> actual event tracers.
> 
> Fixes: e8a982355f96 ("drm/amd/display: Add tracepoint for amdgpu_dm")
> Signed-off-by: Melissa Wen <mwen@igalia.com>
> ---
>   .../amd/display/amdgpu_dm/amdgpu_dm_trace.h   | 56 +++++++++----------
>   1 file changed, 26 insertions(+), 30 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 f5c2f589f691..c59ba41a9721 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
> @@ -314,36 +314,32 @@ DEFINE_EVENT(amdgpu_dm_plane_state_template, amdgpu_dm_atomic_update_cursor,
>   	     TP_PROTO(const struct drm_plane_state *state),
>   	     TP_ARGS(state));
>   
> -TRACE_EVENT(amdgpu_dm_atomic_state_template,
> -	    TP_PROTO(const struct drm_atomic_commit *state),
> -	    TP_ARGS(state),
> -
> -	    TP_STRUCT__entry(
> -			     __field(const struct drm_atomic_commit *, state)
> -			     __field(bool, allow_modeset)
> -			     __field(bool, legacy_cursor_update)
> -			     __field(bool, async_update)
> -			     __field(bool, duplicated)
> -			     __field(int, num_connector)
> -			     __field(int, num_private_objs)
> -	    ),
> -
> -	    TP_fast_assign(
> -			   __entry->state = state;
> -			   __entry->allow_modeset = state->allow_modeset;
> -			   __entry->legacy_cursor_update = state->legacy_cursor_update;
> -			   __entry->async_update = state->async_update;
> -			   __entry->duplicated = state->duplicated;
> -			   __entry->num_connector = state->num_connector;
> -			   __entry->num_private_objs = state->num_private_objs;
> -	    ),
> -
> -	    TP_printk("state=%p allow_modeset=%d legacy_cursor_update=%d "
> -		      "async_update=%d duplicated=%d num_connector=%d "
> -		      "num_private_objs=%d",
> -		      __entry->state, __entry->allow_modeset, __entry->legacy_cursor_update,
> -		      __entry->async_update, __entry->duplicated, __entry->num_connector,
> -		      __entry->num_private_objs)
> +DECLARE_EVENT_CLASS(amdgpu_dm_atomic_state_template,
> +		    TP_PROTO(const struct drm_atomic_commit *state),
> +		    TP_ARGS(state),
> +		    TP_STRUCT__entry(__field(const struct drm_atomic_commit *, state)
> +				     __field(bool, allow_modeset)
> +				     __field(bool, legacy_cursor_update)
> +				     __field(bool, async_update)
> +				     __field(bool, duplicated)
> +				     __field(int, num_connector)
> +				     __field(int, num_private_objs)
> +		    ),
> +		    TP_fast_assign(__entry->state = state;
> +				   __entry->allow_modeset = state->allow_modeset;
> +				   __entry->legacy_cursor_update = state->legacy_cursor_update;
> +				   __entry->async_update = state->async_update;
> +				   __entry->duplicated = state->duplicated;
> +				   __entry->num_connector = state->num_connector;
> +				   __entry->num_private_objs = state->num_private_objs;
> +		    ),
> +		    TP_printk("state=%p allow_modeset=%d legacy_cursor_update=%d "
> +			      "async_update=%d duplicated=%d num_connector=%d "
> +			      "num_private_objs=%d",
> +			      __entry->state, __entry->allow_modeset,
> +			      __entry->legacy_cursor_update, __entry->async_update,
> +			      __entry->duplicated, __entry->num_connector,
> +			      __entry->num_private_objs)
>   );
>   
>   DEFINE_EVENT(amdgpu_dm_atomic_state_template, amdgpu_dm_atomic_commit_tail_begin,

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>

Regards,

Tvrtko

P.S. A side question - are %p useful in these tracepoints? I imagine one 
has to know the object lifetimes really well, or make sure state init 
and free are also traced to make sense of what is what.


  reply	other threads:[~2026-09-25  9:55 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 [this message]
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

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=1accce61-be0a-4fbe-90e0-9503853d80d5@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®