[PATCH v4 4/6] drm/xe/xe_drm_client: Add per drm client reset stats
Matthew Brost
matthew.brost at intel.com
Tue Feb 25 21:11:21 UTC 2025
On Thu, Feb 20, 2025 at 08:38:30PM +0000, Jonathan Cavitt wrote:
> Add a counter to xe_drm_client that tracks the number of times the
> engine has been reset since the drm client was created.
>
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
> ---
> drivers/gpu/drm/xe/xe_drm_client.h | 2 ++
> drivers/gpu/drm/xe/xe_guc_submit.c | 4 +++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_drm_client.h b/drivers/gpu/drm/xe/xe_drm_client.h
> index b3d9b279d55f..6579c4b60ae7 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.h
> +++ b/drivers/gpu/drm/xe/xe_drm_client.h
> @@ -59,6 +59,8 @@ struct xe_drm_client {
> * @blame_len: length of @blame_list
> */
> unsigned int blame_len;
> + /** @reset_count: number of times this drm client has seen an engine reset */
> + atomic_t reset_count;
> #endif
> };
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 92de926bd505..5d899de3dd83 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1988,7 +1988,9 @@ int xe_guc_exec_queue_reset_handler(struct xe_guc *guc, u32 *msg, u32 len)
> return -EPROTO;
>
> hwe = q->hwe;
> -
> +#ifdef CONFIG_PROC_FS
> + atomic_inc(&q->xef->client->reset_count);
Make this a static inline in xe_drm_client.h which compiles out if
CONFIG_PROC_FS is not set.
Matt
> +#endif
> xe_gt_info(gt, "Engine reset: engine_class=%s, logical_mask: 0x%x, guc_id=%d",
> xe_hw_engine_class_to_str(q->class), q->logical_mask, guc_id);
>
> --
> 2.43.0
>
More information about the Intel-xe
mailing list