History

drm/vmwgfx: Introduce VMware mks-guest-stats

VMware mks-guest-stats mechanism allows the collection of performance stats from guest userland GL contexts, as well as from vmwgfx kernelspace, via a set of sw- defined performance counters. The userspace performance counters are (de)registerd with vmware-vmx-stats hypervisor via new iocts. The vmwgfx kernelspace counters are controlled at build-time via a new config DRM_VMWGFX_MKSSTATS. * Add vmw_mksstat_{add|remove|reset}_ioctl controlling the tracking of mks-guest-stats in guest winsys contexts * Add DRM_VMWGFX_MKSSTATS config to drivers/gpu/drm/vmwgfx/Kconfig controlling the instrumentation of vmwgfx for kernelspace mks-guest-stats counters * Instrument vmwgfx vmw_execbuf_ioctl to collect mks-guest-stats according to DRM_VMWGFX_MKSSTATS

Martin Krastev committed 5 years ago

Commit 7a7a9331 parent d92223e9 files · +919 −27Browse files

Showing the changes to include/uapi (1 of 9 files). Show all

Unified · Split

include/uapi/drm/vmwgfx_drm.h+41−0
@@ -72,6 +72,9 @@ extern "C" { · 71 unmodified lines
7272 #define DRM_VMW_GB_SURFACE_CREATE_EXT 27
7373 #define DRM_VMW_GB_SURFACE_REF_EXT 28
7474 #define DRM_VMW_MSG 29
75+#define DRM_VMW_MKSSTAT_RESET 30
76+#define DRM_VMW_MKSSTAT_ADD 31
77+#define DRM_VMW_MKSSTAT_REMOVE 32
7578
7679 /*************************************************************************/
7780 /**
@@ -1236,6 +1239,44 @@ struct drm_vmw_msg_arg { · 1158 unmodified lines
12361239 __u32 receive_len;
12371240 };
12381241
1242+/**
1243+ * struct drm_vmw_mksstat_add_arg
1244+ *
1245+ * @stat: Pointer to user-space stat-counters array, page-aligned.
1246+ * @info: Pointer to user-space counter-infos array, page-aligned.
1247+ * @strs: Pointer to user-space stat strings, page-aligned.
1248+ * @stat_len: Length in bytes of stat-counters array.
1249+ * @info_len: Length in bytes of counter-infos array.
1250+ * @strs_len: Length in bytes of the stat strings, terminators included.
1251+ * @description: Pointer to instance descriptor string; will be truncated
1252+ * to MKS_GUEST_STAT_INSTANCE_DESC_LENGTH chars.
1253+ * @id: Output identifier of the produced record; -1 if error.
1254+ *
1255+ * Argument to the DRM_VMW_MKSSTAT_ADD ioctl.
1256+ */
1257+struct drm_vmw_mksstat_add_arg {
1258+ __u64 stat;
1259+ __u64 info;
1260+ __u64 strs;
1261+ __u64 stat_len;
1262+ __u64 info_len;
1263+ __u64 strs_len;
1264+ __u64 description;
1265+ __u64 id;
1266+};
1267+
1268+/**
1269+ * struct drm_vmw_mksstat_remove_arg
1270+ *
1271+ * @id: Identifier of the record being disposed, originally obtained through
1272+ * DRM_VMW_MKSSTAT_ADD ioctl.
1273+ *
1274+ * Argument to the DRM_VMW_MKSSTAT_REMOVE ioctl.
1275+ */
1276+struct drm_vmw_mksstat_remove_arg {
1277+ __u64 id;
1278+};
1279+
12391280 #if defined(__cplusplus)
12401281 }
12411282 #endif