[PATCH i-g-t 2/2] lib/xe_eudebug: Fix and update event filters

Piatkowski, Dominik Karol dominik.karol.piatkowski at intel.com
Thu Dec 12 08:50:27 UTC 2024


Reviewed-by: Dominik Karol Piątkowski <dominik.karol.piatkowski at intel.com>

> -----Original Message-----
> From: Manszewski, Christoph <christoph.manszewski at intel.com>
> Sent: Wednesday, December 11, 2024 8:18 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Piatkowski, Dominik Karol <dominik.karol.piatkowski at intel.com>;
> Grzegorzek, Dominik <dominik.grzegorzek at intel.com>; Manszewski,
> Christoph <christoph.manszewski at intel.com>
> Subject: [PATCH i-g-t 2/2] lib/xe_eudebug: Fix and update event filters
> 
> At some point (before upstreaming) the eudebug uapi changed and
> the 'DRM_XE_EUDEBUG_EVENT_MAX_EVENT' definition was dropped. Use an
> existing event number for filtering out all events and add missing
> filters for events introduced along the way.
> 
> Signed-off-by: Christoph Manszewski <christoph.manszewski at intel.com>
> ---
>  lib/xe/xe_eudebug.h | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/lib/xe/xe_eudebug.h b/lib/xe/xe_eudebug.h
> index 9aadbe847..823c7f6ea 100644
> --- a/lib/xe/xe_eudebug.h
> +++ b/lib/xe/xe_eudebug.h
> @@ -114,17 +114,21 @@ typedef void (*xe_eudebug_trigger_fn)(struct
> xe_eudebug_debugger *,
>   */
>  #define XE_EUDEBUG_DEFAULT_TIMEOUT_SEC		60ULL
> 
> -#define XE_EUDEBUG_FILTER_EVENT_NONE
> 	BIT(DRM_XE_EUDEBUG_EVENT_NONE)
> -#define XE_EUDEBUG_FILTER_EVENT_READ
> 	BIT(DRM_XE_EUDEBUG_EVENT_READ)
> -#define XE_EUDEBUG_FILTER_EVENT_OPEN
> 	BIT(DRM_XE_EUDEBUG_EVENT_OPEN)
> -#define XE_EUDEBUG_FILTER_EVENT_VM
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM)
> -#define XE_EUDEBUG_FILTER_EVENT_EXEC_QUEUE
> 	BIT(DRM_XE_EUDEBUG_EVENT_EXEC_QUEUE)
> -#define XE_EUDEBUG_FILTER_EVENT_EU_ATTENTION
> 	BIT(DRM_XE_EUDEBUG_EVENT_EU_ATTENTION)
> -#define XE_EUDEBUG_FILTER_EVENT_VM_BIND
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM_BIND)
> -#define XE_EUDEBUG_FILTER_EVENT_VM_BIND_OP
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM_BIND_OP)
> -#define XE_EUDEBUG_FILTER_EVENT_VM_BIND_UFENCE
> BIT(DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE)
> -#define XE_EUDEBUG_FILTER_ALL
> 	GENMASK(DRM_XE_EUDEBUG_EVENT_MAX_EVENT, 0)
> -#define XE_EUDEBUG_EVENT_IS_FILTERED(_e, _f)	((1UL << (_e)) & (_f))
> +#define XE_EUDEBUG_FILTER_EVENT_NONE
> 	BIT(DRM_XE_EUDEBUG_EVENT_NONE)
> +#define XE_EUDEBUG_FILTER_EVENT_READ
> 	BIT(DRM_XE_EUDEBUG_EVENT_READ)
> +#define XE_EUDEBUG_FILTER_EVENT_OPEN
> 	BIT(DRM_XE_EUDEBUG_EVENT_OPEN)
> +#define XE_EUDEBUG_FILTER_EVENT_VM
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM)
> +#define XE_EUDEBUG_FILTER_EVENT_EXEC_QUEUE
> 	BIT(DRM_XE_EUDEBUG_EVENT_EXEC_QUEUE)
> +#define XE_EUDEBUG_FILTER_EVENT_EXEC_QUEUE_PLACEMENTS
> 	BIT(DRM_XE_EUDEBUG_EVENT_EXEC_QUEUE_PLACEMENTS)
> +#define XE_EUDEBUG_FILTER_EVENT_EU_ATTENTION
> 	BIT(DRM_XE_EUDEBUG_EVENT_EU_ATTENTION)
> +#define XE_EUDEBUG_FILTER_EVENT_VM_BIND
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM_BIND)
> +#define XE_EUDEBUG_FILTER_EVENT_VM_BIND_OP
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM_BIND_OP)
> +#define XE_EUDEBUG_FILTER_EVENT_VM_BIND_UFENCE
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE)
> +#define XE_EUDEBUG_FILTER_EVENT_METADATA
> 	BIT(DRM_XE_EUDEBUG_EVENT_METADATA)
> +#define XE_EUDEBUG_FILTER_EVENT_VM_BIND_OP_METADATA
> 	BIT(DRM_XE_EUDEBUG_EVENT_VM_BIND_OP_METADATA)
> +#define XE_EUDEBUG_FILTER_EVENT_PAGEFAULT
> 	BIT(DRM_XE_EUDEBUG_EVENT_PAGEFAULT)
> +#define XE_EUDEBUG_FILTER_ALL
> 	GENMASK(DRM_XE_EUDEBUG_EVENT_PAGEFAULT, 0)
> +#define XE_EUDEBUG_EVENT_IS_FILTERED(_e, _f)		((1UL << (_e))
> & (_f))
> 
>  int xe_eudebug_connect(int fd, pid_t pid, uint32_t flags);
>  const char *xe_eudebug_event_to_str(struct drm_xe_eudebug_event *e,
> char *buf, size_t len);
> --
> 2.34.1



More information about the igt-dev mailing list