[PATCH v5 2/7] drm/xe/eustall: Introduce API for EU stall sampling
Dixit, Ashutosh
ashutosh.dixit at intel.com
Wed Nov 20 18:40:37 UTC 2024
On Tue, 19 Nov 2024 20:59:57 -0800, Harish Chegondi wrote:
>
> > > 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?
There don't seem to be any such comment blocks in this file. So no need to
overthink this, just add a line about EIO right here and be done with it.
> > > + */
> > > +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?
Will respond to this in the thread where Umesh's original comment is.
Ashutosh
More information about the Intel-xe
mailing list