From: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
To: Riana Tauro <riana.tauro@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4 3/8] drm/xe/uapi: Add configs for Engine busyness
Date: Wed, 3 Jan 2024 10:56:29 +0530 [thread overview]
Message-ID: <4cb7f45b-c742-4bd2-ac96-c950d5d4301b@linux.intel.com> (raw)
In-Reply-To: <20231222074602.817518-4-riana.tauro@intel.com>
On 12/22/23 13:15, Riana Tauro wrote:
> GuC provides engine busyness ticks as a 64 bit counter which count
> as clock ticks.
>
> Add configs to the uapi to expose Engine busyness via PMU.
>
> v2: add "__" prefix for internal helpers
> add a simple helper for application usage (Aravind)
>
> v3: rebase
> change internal uapi pmu config helpers (Umesh)
>
> Cc: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
> include/uapi/drm/xe_drm.h | 41 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> index 9fa3ae324731..f8456cda5cda 100644
> --- a/include/uapi/drm/xe_drm.h
> +++ b/include/uapi/drm/xe_drm.h
> @@ -1340,6 +1340,47 @@ struct drm_xe_wait_user_fence {
> __u64 reserved[2];
> };
>
> +/**
> + * DOC: XE PMU event config IDs
> + *
> + * Check 'man perf_event_open' to use the ID's DRM_XE_PMU_XXXX listed in xe_drm.h
> + * in 'struct perf_event_attr' as part of perf_event_open syscall to read a
> + * particular event.
> + *
> + */
> +
> +/**
> + * enum drm_xe_pmu_engine_sample - Supported PMU engine samples
> + */
> +enum drm_xe_pmu_engine_sample {
> + /** @DRM_XE_PMU_SAMPLE_BUSY_TICKS: Engine busy ticks */
> + DRM_XE_PMU_SAMPLE_BUSY_TICKS = 0,
> +};
> +
> +/*
> + * Top bits of every counter are GT id.
> + */
> +#define __DRM_XE_PMU_GT_SHIFT (56)
> +#define __DRM_XE_PMU_SAMPLE_BITS (4)
> +#define __DRM_XE_PMU_SAMPLE_INSTANCE_BITS (8)
> +#define __DRM_XE_PMU_CLASS_SHIFT \
> + (__DRM_XE_PMU_SAMPLE_BITS + __DRM_XE_PMU_SAMPLE_INSTANCE_BITS)
> +
> +#define __DRM_XE_PMU_GT_EVENT(gt, x) \
> + (((__u64)(x)) | ((__u64)(gt) << __DRM_XE_PMU_GT_SHIFT))
> +
> +#define __DRM_XE_PMU_ENGINE(class, instance, sample) \
> + (((class) << __DRM_XE_PMU_CLASS_SHIFT | \
> + (instance) << __DRM_XE_PMU_SAMPLE_BITS | \
> + (sample)))
> +
> +#define __DRM_XE_PMU_OTHER(gt, x) \
> + (__DRM_XE_PMU_GT_EVENT(gt, 0xfffff) + 1 + (x))
Use __DRM_XE_PMU_ENGINE(0xff, 0xff, 0xf) instead of 0xfffff so that it will be clear
that it is starting after the engine event.
But __DRM_XE_PMU_OTHER is not used any where so why to introduce in this patch.
Thanks,
Aravind.
> +
> +#define DRM_XE_PMU_ENGINE_BUSY_TICKS(gt, class, instance) \
> + __DRM_XE_PMU_GT_EVENT(gt, __DRM_XE_PMU_ENGINE(class, instance, \
> + DRM_XE_PMU_SAMPLE_BUSY_TICKS))
> +
> #if defined(__cplusplus)
> }
> #endif
next prev parent reply other threads:[~2024-01-03 5:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-22 7:45 [PATCH v4 0/8] Engine busyness Riana Tauro
2023-12-22 7:45 ` [PATCH v4 1/8] drm/xe: Move user engine class mappings to functions Riana Tauro
2024-01-04 5:04 ` Aravind Iddamsetty
2024-01-05 5:31 ` Riana Tauro
2023-12-22 7:45 ` [PATCH v4 2/8] drm/xe/guc: Add interface for engine busyness ticks Riana Tauro
2023-12-22 7:45 ` [PATCH v4 3/8] drm/xe/uapi: Add configs for Engine busyness Riana Tauro
2024-01-03 5:26 ` Aravind Iddamsetty [this message]
2024-01-03 6:40 ` Riana Tauro
2024-01-03 7:02 ` Aravind Iddamsetty
2024-01-03 7:06 ` Riana Tauro
2024-01-03 7:08 ` Riana Tauro
2023-12-22 7:45 ` [PATCH v4 4/8] drm/xe/pmu: Enable PMU interface and add engine busyness counter Riana Tauro
2024-01-03 5:03 ` Aravind Iddamsetty
[not found] ` <85zfxnrlv0.wl-ashutosh.dixit@intel.com>
2024-01-03 6:16 ` Dixit, Ashutosh
2023-12-22 7:45 ` [PATCH v4 5/8] drm/xe/guc: Add PMU counter for total active ticks Riana Tauro
2023-12-22 20:03 ` Belgaumkar, Vinay
2024-01-03 6:54 ` Aravind Iddamsetty
2023-12-22 7:46 ` [PATCH v4 6/8] drm/xe/guc: Expose engine busyness only for supported GuC version Riana Tauro
2024-01-18 6:13 ` Nilawar, Badal
2024-01-19 10:13 ` Riana Tauro
2024-01-19 12:18 ` Nilawar, Badal
2023-12-22 7:46 ` [PATCH v4 7/8] drm/xe/guc: Dynamically enable/disable engine busyness stats Riana Tauro
2023-12-22 7:46 ` [PATCH v4 8/8] drm/xe/guc: Handle runtime suspend issues for engine busyness Riana Tauro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4cb7f45b-c742-4bd2-ac96-c950d5d4301b@linux.intel.com \
--to=aravind.iddamsetty@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=riana.tauro@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox