[PATCH v5 2/7] drm/xe/eustall: Introduce API for EU stall sampling
Harish Chegondi
harish.chegondi at intel.com
Wed Nov 20 04:59:57 UTC 2024
On Mon, Nov 18, 2024 at 10:58:25AM -0800, Dixit, Ashutosh wrote:
> On Mon, 18 Nov 2024 01:07:14 -0800, Harish Chegondi wrote:
>
Hi Ashutosh,
> Hi Harish,
>
> Once again reviewing only the uapi for now.
>
> The patch title should contain uapi in it, so drm/xe/uapi, or
> drm/xe/eustall/uapi.
Will change the title in the next version of the patch series.
>
> Also, you are not recording version log for the patches. That needs to be
> added too.
I have been documenting the changes in the cover letter. In the next
patch series, I will move the change log to the individual patches.
>
> > diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> > index 4a8a4a63e99c..80aaa5b50c8a 100644
> > --- a/include/uapi/drm/xe_drm.h
> > +++ b/include/uapi/drm/xe_drm.h
> > @@ -1397,6 +1397,8 @@ struct drm_xe_wait_user_fence {
> > enum drm_xe_observation_type {
> > /** @DRM_XE_OBSERVATION_TYPE_OA: OA observation stream type */
> > DRM_XE_OBSERVATION_TYPE_OA,
> > + /** @DRM_XE_OBSERVATION_TYPE_EU_STALL: EU stall sampling observation stream type */
> > + DRM_XE_OBSERVATION_TYPE_EU_STALL,
> > };
> >
> > /**
> > @@ -1713,6 +1715,43 @@ struct drm_xe_oa_stream_info {
> > __u64 reserved[3];
> > };
> >
> > +/**
> > + * enum drm_xe_eu_stall_property_id - EU stall sampling input property ids.
> > + *
> > + * These properties are passed to the driver at open as a chain of
> > + * @drm_xe_ext_set_property structures with @property set to these
> > + * properties' enums and @value set to the corresponding values of these
> > + * properties. @drm_xe_user_extension base.name should be set to
> > + * @DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY.
> > + *
> > + * With the file descriptor obtained from open, user space must enable
> > + * the EU stall stream fd with @DRM_XE_OBSERVATION_IOCTL_ENABLE before
> > + * calling read.
>
> Good to add this. Maybe also add "EIO return from read() indicates buffer
> overflow" since EIO return is part of uapi.
Can I add a comment block on EU stall sampling above the comment block
for this structure? While it is important to document read() returning
-EIO for buffer overflow, I am wondering if this is the correct place to
add the comment since it is unrelated to the below structure?
>
> > + */
> > +enum drm_xe_eu_stall_property_id {
> > +#define DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY 0
> > + /**
> > + * @DRM_XE_EU_STALL_PROP_SAMPLE_RATE: Sampling rate
> > + * in multiples of 251 cycles. Valid values are 1 to 7.
> > + * If the value is 1, sampling interval is 251 cycles.
> > + * If the value is 7, sampling interval is 7 x 251 cycles.
> > + */
> > + DRM_XE_EU_STALL_PROP_SAMPLE_RATE = 1,
>
> There is an unaddressed comment from Umesh about this (on the previous
> version), we need to address it.
I am still working on the comment from Umesh and seeking feedback from
others including the user space folks. I think having this input as it
is in terms of cycles is more generic and more future proof as the clock
frequency can vary from GPU to GPU and even for a GPU it can vary from
time to time due to performance and power reasons?
>
> > +
> > + /**
> > + * @DRM_XE_EU_STALL_PROP_EVENT_REPORT_COUNT: Minimum number of
> > + * EU stall data rows to be present in the kernel buffer for
> > + * poll() to set POLLIN (data present).
> > + */
> > + DRM_XE_EU_STALL_PROP_EVENT_REPORT_COUNT,
> > +
> > + /**
> > + * @DRM_XE_EU_STALL_PROP_GT_ID: GT ID of the GT on which
> > + * EU stall data will be captured.
> > + */
> > + DRM_XE_EU_STALL_PROP_GT_ID,
>
> Maybe a nit, but I would make this the first property.
>
> > +};
> > +
> > #if defined(__cplusplus)
> > }
> > #endif
> > --
> > 2.45.1
> >
>
> Thanks.
> --
> Ashutosh
Thank You
Harish.
More information about the Intel-xe
mailing list