[PATCH i-g-t v2 57/66] lib/xe_eudebug: Expose xe_eudebug_connect
Piatkowski, Dominik Karol
dominik.karol.piatkowski at intel.com
Mon Aug 5 06:48:36 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: Tuesday, July 30, 2024 1:45 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Kempczynski, Zbigniew <zbigniew.kempczynski at intel.com>; Kamil
> Konieczny <kamil.konieczny at linux.intel.com>; Grzegorzek, Dominik
> <dominik.grzegorzek at intel.com>; Patelczyk, Maciej
> <maciej.patelczyk at intel.com>; Piatkowski, Dominik Karol
> <dominik.karol.piatkowski at intel.com>; Sikora, Pawel
> <pawel.sikora at intel.com>; Hajda, Andrzej <andrzej.hajda at intel.com>;
> Kolanupaka Naveena <kolanupaka.naveena at intel.com>; Kuoppala, Mika
> <mika.kuoppala at intel.com>; Mun, Gwan-gyeong <gwan-
> gyeong.mun at intel.com>
> Subject: [PATCH i-g-t v2 57/66] lib/xe_eudebug: Expose xe_eudebug_connect
>
> From: Karolina Stolarek <karolina.stolarek at intel.com>
>
> Expose xe_eudebug_connect library function to use it directly in tests.
>
> Signed-off-by: Karolina Stolarek <karolina.stolarek at intel.com>
> Cc: Christoph Manszewski <christoph.manszewski at intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> ---
> lib/xe/xe_eudebug.c | 30 ++++++++++++++++++++----------
> lib/xe/xe_eudebug.h | 1 +
> 2 files changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/lib/xe/xe_eudebug.c b/lib/xe/xe_eudebug.c index
> 254a7261a..c9f0c63f1 100644
> --- a/lib/xe/xe_eudebug.c
> +++ b/lib/xe/xe_eudebug.c
> @@ -329,16 +329,6 @@ static int __xe_eudebug_connect(int fd, pid_t pid,
> uint32_t flags, uint64_t even
> return debugfd;
> }
>
> -static int xe_eudebug_connect(int fd, pid_t pid, uint32_t flags) -{
> - int ret;
> - uint64_t events = 0; /* events filtering not supported yet! */
> -
> - ret = __xe_eudebug_connect(fd, pid, flags, events);
> -
> - return ret;
> -}
> -
> static void event_log_write_to_fd(struct xe_eudebug_event_log *l, int fd) {
> igt_assert_eq(write(fd, &l->head, sizeof(l->head)), @@ -816,6
> +806,26 @@ static void event_log_sort(struct xe_eudebug_event_log *l)
> xe_eudebug_event_log_destroy(tmp);
> }
>
> +/**
> + * xe_eudebug_connect:
> + * @fd: Xe file descriptor
> + * @pid: client PID
> + * @flags: connection flags
> + *
> + * Opens the xe eu debugger connection to the process described by @pid
> + *
> + * Returns: 0 if the debugger was successfully attached, -errno otherwise.
> + */
> +int xe_eudebug_connect(int fd, pid_t pid, uint32_t flags) {
> + int ret;
> + uint64_t events = 0; /* events filtering not supported yet! */
> +
> + ret = __xe_eudebug_connect(fd, pid, flags, events);
> +
> + return ret;
> +}
> +
> /**
> * xe_eudebug_event_log_create:
> * @name: event log identifier
> diff --git a/lib/xe/xe_eudebug.h b/lib/xe/xe_eudebug.h index
> a499cc977..4654b462f 100644
> --- a/lib/xe/xe_eudebug.h
> +++ b/lib/xe/xe_eudebug.h
> @@ -112,6 +112,7 @@ typedef void (*xe_eudebug_trigger_fn)(struct
> xe_eudebug_debugger *,
> #define XE_EUDEUBG_FILTER_ALL
> GENMASK(DRM_XE_EUDEBUG_EVENT_MAX_EVENT, 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); struct drm_xe_eudebug_event *
> xe_eudebug_event_log_find_seqno(struct xe_eudebug_event_log *l, uint64_t
> seqno);
> --
> 2.34.1
More information about the igt-dev
mailing list