Commit 8169b209 authored by Ashutosh Dixit's avatar Ashutosh Dixit

drm/xe/uapi: Rename xe perf layer as xe observation layer

In Xe, the perf layer allows capture of HW counter streams. These HW
counters are generally performance related but don't have to be necessarily
so. Also, the name "perf" is a carryover from i915 and is not preferred.

Here we propose the name "observation" for this common layer which allows
capture of different types of these counter streams.

v2: Rename observability layer to observation layer (Lucas/Rodrigo)
v3: Rename sysctl file to "observation_paranoid" (Jose)

Fixes: 52c2e956 ("drm/xe/perf/uapi: "Perf" layer to support multiple perf counter stream types")
Fixes: fe8929bd ("drm/xe/perf/uapi: Add perf_stream_paranoid sysctl")
Acked-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Acked-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarAshutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: default avatarUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Acked-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240703164801.2561423-1-ashutosh.dixit@intel.com
parent 627c961d
...@@ -96,10 +96,10 @@ xe-y += xe_bb.o \ ...@@ -96,10 +96,10 @@ xe-y += xe_bb.o \
xe_mocs.o \ xe_mocs.o \
xe_module.o \ xe_module.o \
xe_oa.o \ xe_oa.o \
xe_observation.o \
xe_pat.o \ xe_pat.o \
xe_pci.o \ xe_pci.o \
xe_pcode.o \ xe_pcode.o \
xe_perf.o \
xe_pm.o \ xe_pm.o \
xe_preempt_fence.o \ xe_preempt_fence.o \
xe_pt.o \ xe_pt.o \
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
#include "xe_memirq.h" #include "xe_memirq.h"
#include "xe_mmio.h" #include "xe_mmio.h"
#include "xe_module.h" #include "xe_module.h"
#include "xe_observation.h"
#include "xe_pat.h" #include "xe_pat.h"
#include "xe_pcode.h" #include "xe_pcode.h"
#include "xe_perf.h"
#include "xe_pm.h" #include "xe_pm.h"
#include "xe_query.h" #include "xe_query.h"
#include "xe_sriov.h" #include "xe_sriov.h"
...@@ -142,7 +142,7 @@ static const struct drm_ioctl_desc xe_ioctls[] = { ...@@ -142,7 +142,7 @@ static const struct drm_ioctl_desc xe_ioctls[] = {
DRM_RENDER_ALLOW), DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(XE_WAIT_USER_FENCE, xe_wait_user_fence_ioctl, DRM_IOCTL_DEF_DRV(XE_WAIT_USER_FENCE, xe_wait_user_fence_ioctl,
DRM_RENDER_ALLOW), DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(XE_PERF, xe_perf_ioctl, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(XE_OBSERVATION, xe_observation_ioctl, DRM_RENDER_ALLOW),
}; };
static long xe_drm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static long xe_drm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
......
...@@ -463,7 +463,7 @@ struct xe_device { ...@@ -463,7 +463,7 @@ struct xe_device {
/** @heci_gsc: graphics security controller */ /** @heci_gsc: graphics security controller */
struct xe_heci_gsc heci_gsc; struct xe_heci_gsc heci_gsc;
/** @oa: oa perf counter subsystem */ /** @oa: oa observation subsystem */
struct xe_oa oa; struct xe_oa oa;
/** @needs_flr_on_fini: requests function-reset on fini */ /** @needs_flr_on_fini: requests function-reset on fini */
......
...@@ -389,7 +389,7 @@ struct xe_gt { ...@@ -389,7 +389,7 @@ struct xe_gt {
u8 instances_per_class[XE_ENGINE_CLASS_MAX]; u8 instances_per_class[XE_ENGINE_CLASS_MAX];
} user_engines; } user_engines;
/** @oa: oa perf counter subsystem per gt info */ /** @oa: oa observation subsystem per gt info */
struct xe_oa_gt oa; struct xe_oa_gt oa;
}; };
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "xe_drv.h" #include "xe_drv.h"
#include "xe_hw_fence.h" #include "xe_hw_fence.h"
#include "xe_pci.h" #include "xe_pci.h"
#include "xe_perf.h" #include "xe_observation.h"
#include "xe_sched_job.h" #include "xe_sched_job.h"
struct xe_modparam xe_modparam = { struct xe_modparam xe_modparam = {
...@@ -80,8 +80,8 @@ static const struct init_funcs init_funcs[] = { ...@@ -80,8 +80,8 @@ static const struct init_funcs init_funcs[] = {
.exit = xe_unregister_pci_driver, .exit = xe_unregister_pci_driver,
}, },
{ {
.init = xe_perf_sysctl_register, .init = xe_observation_sysctl_register,
.exit = xe_perf_sysctl_unregister, .exit = xe_observation_sysctl_unregister,
}, },
}; };
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "xe_macros.h" #include "xe_macros.h"
#include "xe_mmio.h" #include "xe_mmio.h"
#include "xe_oa.h" #include "xe_oa.h"
#include "xe_perf.h" #include "xe_observation.h"
#include "xe_pm.h" #include "xe_pm.h"
#include "xe_sched_job.h" #include "xe_sched_job.h"
#include "xe_sriov.h" #include "xe_sriov.h"
...@@ -481,7 +481,7 @@ static int __xe_oa_read(struct xe_oa_stream *stream, char __user *buf, ...@@ -481,7 +481,7 @@ static int __xe_oa_read(struct xe_oa_stream *stream, char __user *buf,
OASTATUS_RELEVANT_BITS, 0); OASTATUS_RELEVANT_BITS, 0);
/* /*
* Signal to userspace that there is non-zero OA status to read via * Signal to userspace that there is non-zero OA status to read via
* @DRM_XE_PERF_IOCTL_STATUS perf fd ioctl * @DRM_XE_OBSERVATION_IOCTL_STATUS observation stream fd ioctl
*/ */
if (stream->oa_status & OASTATUS_RELEVANT_BITS) if (stream->oa_status & OASTATUS_RELEVANT_BITS)
return -EIO; return -EIO;
...@@ -1158,15 +1158,15 @@ static long xe_oa_ioctl_locked(struct xe_oa_stream *stream, ...@@ -1158,15 +1158,15 @@ static long xe_oa_ioctl_locked(struct xe_oa_stream *stream,
unsigned long arg) unsigned long arg)
{ {
switch (cmd) { switch (cmd) {
case DRM_XE_PERF_IOCTL_ENABLE: case DRM_XE_OBSERVATION_IOCTL_ENABLE:
return xe_oa_enable_locked(stream); return xe_oa_enable_locked(stream);
case DRM_XE_PERF_IOCTL_DISABLE: case DRM_XE_OBSERVATION_IOCTL_DISABLE:
return xe_oa_disable_locked(stream); return xe_oa_disable_locked(stream);
case DRM_XE_PERF_IOCTL_CONFIG: case DRM_XE_OBSERVATION_IOCTL_CONFIG:
return xe_oa_config_locked(stream, arg); return xe_oa_config_locked(stream, arg);
case DRM_XE_PERF_IOCTL_STATUS: case DRM_XE_OBSERVATION_IOCTL_STATUS:
return xe_oa_status_locked(stream, arg); return xe_oa_status_locked(stream, arg);
case DRM_XE_PERF_IOCTL_INFO: case DRM_XE_OBSERVATION_IOCTL_INFO:
return xe_oa_info_locked(stream, arg); return xe_oa_info_locked(stream, arg);
} }
...@@ -1209,7 +1209,7 @@ static int xe_oa_release(struct inode *inode, struct file *file) ...@@ -1209,7 +1209,7 @@ static int xe_oa_release(struct inode *inode, struct file *file)
xe_oa_destroy_locked(stream); xe_oa_destroy_locked(stream);
mutex_unlock(&gt->oa.gt_lock); mutex_unlock(&gt->oa.gt_lock);
/* Release the reference the perf stream kept on the driver */ /* Release the reference the OA stream kept on the driver */
drm_dev_put(&gt_to_xe(gt)->drm); drm_dev_put(&gt_to_xe(gt)->drm);
return 0; return 0;
...@@ -1222,7 +1222,7 @@ static int xe_oa_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -1222,7 +1222,7 @@ static int xe_oa_mmap(struct file *file, struct vm_area_struct *vma)
unsigned long start = vma->vm_start; unsigned long start = vma->vm_start;
int i, ret; int i, ret;
if (xe_perf_stream_paranoid && !perfmon_capable()) { if (xe_observation_paranoid && !perfmon_capable()) {
drm_dbg(&stream->oa->xe->drm, "Insufficient privilege to map OA buffer\n"); drm_dbg(&stream->oa->xe->drm, "Insufficient privilege to map OA buffer\n");
return -EACCES; return -EACCES;
} }
...@@ -1789,8 +1789,8 @@ static int xe_oa_user_extensions(struct xe_oa *oa, u64 extension, int ext_number ...@@ -1789,8 +1789,8 @@ static int xe_oa_user_extensions(struct xe_oa *oa, u64 extension, int ext_number
* @file: @drm_file * @file: @drm_file
* *
* The functions opens an OA stream. An OA stream, opened with specified * The functions opens an OA stream. An OA stream, opened with specified
* properties, enables perf counter samples to be collected, either * properties, enables OA counter samples to be collected, either
* periodically (time based sampling), or on request (using perf queries) * periodically (time based sampling), or on request (using OA queries)
*/ */
int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *file) int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *file)
{ {
...@@ -1836,8 +1836,8 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f ...@@ -1836,8 +1836,8 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
privileged_op = true; privileged_op = true;
} }
if (privileged_op && xe_perf_stream_paranoid && !perfmon_capable()) { if (privileged_op && xe_observation_paranoid && !perfmon_capable()) {
drm_dbg(&oa->xe->drm, "Insufficient privileges to open xe perf stream\n"); drm_dbg(&oa->xe->drm, "Insufficient privileges to open xe OA stream\n");
ret = -EACCES; ret = -EACCES;
goto err_exec_q; goto err_exec_q;
} }
...@@ -2097,7 +2097,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi ...@@ -2097,7 +2097,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi
return -ENODEV; return -ENODEV;
} }
if (xe_perf_stream_paranoid && !perfmon_capable()) { if (xe_observation_paranoid && !perfmon_capable()) {
drm_dbg(&oa->xe->drm, "Insufficient privileges to add xe OA config\n"); drm_dbg(&oa->xe->drm, "Insufficient privileges to add xe OA config\n");
return -EACCES; return -EACCES;
} }
...@@ -2181,7 +2181,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi ...@@ -2181,7 +2181,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi
/** /**
* xe_oa_remove_config_ioctl - Removes one OA config * xe_oa_remove_config_ioctl - Removes one OA config
* @dev: @drm_device * @dev: @drm_device
* @data: pointer to struct @drm_xe_perf_param * @data: pointer to struct @drm_xe_observation_param
* @file: @drm_file * @file: @drm_file
*/ */
int xe_oa_remove_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *file) int xe_oa_remove_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *file)
...@@ -2197,7 +2197,7 @@ int xe_oa_remove_config_ioctl(struct drm_device *dev, u64 data, struct drm_file ...@@ -2197,7 +2197,7 @@ int xe_oa_remove_config_ioctl(struct drm_device *dev, u64 data, struct drm_file
return -ENODEV; return -ENODEV;
} }
if (xe_perf_stream_paranoid && !perfmon_capable()) { if (xe_observation_paranoid && !perfmon_capable()) {
drm_dbg(&oa->xe->drm, "Insufficient privileges to remove xe OA config\n"); drm_dbg(&oa->xe->drm, "Insufficient privileges to remove xe OA config\n");
return -EACCES; return -EACCES;
} }
...@@ -2381,7 +2381,7 @@ static int xe_oa_init_gt(struct xe_gt *gt) ...@@ -2381,7 +2381,7 @@ static int xe_oa_init_gt(struct xe_gt *gt)
/* /*
* Fused off engines can result in oa_unit's with num_engines == 0. These units * Fused off engines can result in oa_unit's with num_engines == 0. These units
* will appear in OA unit query, but no perf streams can be opened on them. * will appear in OA unit query, but no OA streams can be opened on them.
*/ */
gt->oa.num_oa_units = num_oa_units; gt->oa.num_oa_units = num_oa_units;
gt->oa.oa_unit = u; gt->oa.oa_unit = u;
......
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
#include <drm/xe_drm.h> #include <drm/xe_drm.h>
#include "xe_oa.h" #include "xe_oa.h"
#include "xe_perf.h" #include "xe_observation.h"
u32 xe_perf_stream_paranoid = true; u32 xe_observation_paranoid = true;
static struct ctl_table_header *sysctl_header; static struct ctl_table_header *sysctl_header;
static int xe_oa_ioctl(struct drm_device *dev, struct drm_xe_perf_param *arg, static int xe_oa_ioctl(struct drm_device *dev, struct drm_xe_observation_param *arg,
struct drm_file *file) struct drm_file *file)
{ {
switch (arg->perf_op) { switch (arg->observation_op) {
case DRM_XE_PERF_OP_STREAM_OPEN: case DRM_XE_OBSERVATION_OP_STREAM_OPEN:
return xe_oa_stream_open_ioctl(dev, arg->param, file); return xe_oa_stream_open_ioctl(dev, arg->param, file);
case DRM_XE_PERF_OP_ADD_CONFIG: case DRM_XE_OBSERVATION_OP_ADD_CONFIG:
return xe_oa_add_config_ioctl(dev, arg->param, file); return xe_oa_add_config_ioctl(dev, arg->param, file);
case DRM_XE_PERF_OP_REMOVE_CONFIG: case DRM_XE_OBSERVATION_OP_REMOVE_CONFIG:
return xe_oa_remove_config_ioctl(dev, arg->param, file); return xe_oa_remove_config_ioctl(dev, arg->param, file);
default: default:
return -EINVAL; return -EINVAL;
...@@ -30,36 +30,37 @@ static int xe_oa_ioctl(struct drm_device *dev, struct drm_xe_perf_param *arg, ...@@ -30,36 +30,37 @@ static int xe_oa_ioctl(struct drm_device *dev, struct drm_xe_perf_param *arg,
} }
/** /**
* xe_perf_ioctl - The top level perf layer ioctl * xe_observation_ioctl - The top level observation layer ioctl
* @dev: @drm_device * @dev: @drm_device
* @data: pointer to struct @drm_xe_perf_param * @data: pointer to struct @drm_xe_observation_param
* @file: @drm_file * @file: @drm_file
* *
* The function is called for different perf streams types and allows execution * The function is called for different observation streams types and
* of different operations supported by those perf stream types. * allows execution of different operations supported by those stream
* types.
* *
* Return: 0 on success or a negative error code on failure. * Return: 0 on success or a negative error code on failure.
*/ */
int xe_perf_ioctl(struct drm_device *dev, void *data, struct drm_file *file) int xe_observation_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
{ {
struct drm_xe_perf_param *arg = data; struct drm_xe_observation_param *arg = data;
if (arg->extensions) if (arg->extensions)
return -EINVAL; return -EINVAL;
switch (arg->perf_type) { switch (arg->observation_type) {
case DRM_XE_PERF_TYPE_OA: case DRM_XE_OBSERVATION_TYPE_OA:
return xe_oa_ioctl(dev, arg, file); return xe_oa_ioctl(dev, arg, file);
default: default:
return -EINVAL; return -EINVAL;
} }
} }
static struct ctl_table perf_ctl_table[] = { static struct ctl_table observation_ctl_table[] = {
{ {
.procname = "perf_stream_paranoid", .procname = "observation_paranoid",
.data = &xe_perf_stream_paranoid, .data = &xe_observation_paranoid,
.maxlen = sizeof(xe_perf_stream_paranoid), .maxlen = sizeof(xe_observation_paranoid),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
...@@ -69,24 +70,24 @@ static struct ctl_table perf_ctl_table[] = { ...@@ -69,24 +70,24 @@ static struct ctl_table perf_ctl_table[] = {
}; };
/** /**
* xe_perf_sysctl_register - Register "perf_stream_paranoid" sysctl * xe_observation_sysctl_register - Register xe_observation_paranoid sysctl
* *
* Normally only superuser/root can access perf counter data. However, * Normally only superuser/root can access observation stream
* superuser can set perf_stream_paranoid sysctl to 0 to allow non-privileged * data. However, superuser can set xe_observation_paranoid sysctl to 0 to
* users to also access perf data. * allow non-privileged users to also access observation data.
* *
* Return: always returns 0 * Return: always returns 0
*/ */
int xe_perf_sysctl_register(void) int xe_observation_sysctl_register(void)
{ {
sysctl_header = register_sysctl("dev/xe", perf_ctl_table); sysctl_header = register_sysctl("dev/xe", observation_ctl_table);
return 0; return 0;
} }
/** /**
* xe_perf_sysctl_unregister - Unregister "perf_stream_paranoid" sysctl * xe_observation_sysctl_unregister - Unregister xe_observation_paranoid sysctl
*/ */
void xe_perf_sysctl_unregister(void) void xe_observation_sysctl_unregister(void)
{ {
unregister_sysctl_table(sysctl_header); unregister_sysctl_table(sysctl_header);
} }
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
* Copyright © 2023-2024 Intel Corporation * Copyright © 2023-2024 Intel Corporation
*/ */
#ifndef _XE_PERF_H_ #ifndef _XE_OBSERVATION_H_
#define _XE_PERF_H_ #define _XE_OBSERVATION_H_
#include <linux/types.h> #include <linux/types.h>
struct drm_device; struct drm_device;
struct drm_file; struct drm_file;
extern u32 xe_perf_stream_paranoid; extern u32 xe_observation_paranoid;
int xe_perf_ioctl(struct drm_device *dev, void *data, struct drm_file *file); int xe_observation_ioctl(struct drm_device *dev, void *data, struct drm_file *file);
int xe_perf_sysctl_register(void); int xe_observation_sysctl_register(void);
void xe_perf_sysctl_unregister(void); void xe_observation_sysctl_unregister(void);
#endif #endif
...@@ -80,7 +80,7 @@ extern "C" { ...@@ -80,7 +80,7 @@ extern "C" {
* - &DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY * - &DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY
* - &DRM_IOCTL_XE_EXEC * - &DRM_IOCTL_XE_EXEC
* - &DRM_IOCTL_XE_WAIT_USER_FENCE * - &DRM_IOCTL_XE_WAIT_USER_FENCE
* - &DRM_IOCTL_XE_PERF * - &DRM_IOCTL_XE_OBSERVATION
*/ */
/* /*
...@@ -101,7 +101,7 @@ extern "C" { ...@@ -101,7 +101,7 @@ extern "C" {
#define DRM_XE_EXEC_QUEUE_GET_PROPERTY 0x08 #define DRM_XE_EXEC_QUEUE_GET_PROPERTY 0x08
#define DRM_XE_EXEC 0x09 #define DRM_XE_EXEC 0x09
#define DRM_XE_WAIT_USER_FENCE 0x0a #define DRM_XE_WAIT_USER_FENCE 0x0a
#define DRM_XE_PERF 0x0b #define DRM_XE_OBSERVATION 0x0b
/* Must be kept compact -- no holes */ /* Must be kept compact -- no holes */
...@@ -116,7 +116,7 @@ extern "C" { ...@@ -116,7 +116,7 @@ extern "C" {
#define DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_GET_PROPERTY, struct drm_xe_exec_queue_get_property) #define DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_GET_PROPERTY, struct drm_xe_exec_queue_get_property)
#define DRM_IOCTL_XE_EXEC DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC, struct drm_xe_exec) #define DRM_IOCTL_XE_EXEC DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC, struct drm_xe_exec)
#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence) #define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
#define DRM_IOCTL_XE_PERF DRM_IOW(DRM_COMMAND_BASE + DRM_XE_PERF, struct drm_xe_perf_param) #define DRM_IOCTL_XE_OBSERVATION DRM_IOW(DRM_COMMAND_BASE + DRM_XE_OBSERVATION, struct drm_xe_observation_param)
/** /**
* DOC: Xe IOCTL Extensions * DOC: Xe IOCTL Extensions
...@@ -1376,66 +1376,67 @@ struct drm_xe_wait_user_fence { ...@@ -1376,66 +1376,67 @@ struct drm_xe_wait_user_fence {
}; };
/** /**
* enum drm_xe_perf_type - Perf stream types * enum drm_xe_observation_type - Observation stream types
*/ */
enum drm_xe_perf_type { enum drm_xe_observation_type {
/** @DRM_XE_PERF_TYPE_OA: OA perf stream type */ /** @DRM_XE_OBSERVATION_TYPE_OA: OA observation stream type */
DRM_XE_PERF_TYPE_OA, DRM_XE_OBSERVATION_TYPE_OA,
}; };
/** /**
* enum drm_xe_perf_op - Perf stream ops * enum drm_xe_observation_op - Observation stream ops
*/ */
enum drm_xe_perf_op { enum drm_xe_observation_op {
/** @DRM_XE_PERF_OP_STREAM_OPEN: Open a perf counter stream */ /** @DRM_XE_OBSERVATION_OP_STREAM_OPEN: Open an observation stream */
DRM_XE_PERF_OP_STREAM_OPEN, DRM_XE_OBSERVATION_OP_STREAM_OPEN,
/** @DRM_XE_PERF_OP_ADD_CONFIG: Add perf stream config */ /** @DRM_XE_OBSERVATION_OP_ADD_CONFIG: Add observation stream config */
DRM_XE_PERF_OP_ADD_CONFIG, DRM_XE_OBSERVATION_OP_ADD_CONFIG,
/** @DRM_XE_PERF_OP_REMOVE_CONFIG: Remove perf stream config */ /** @DRM_XE_OBSERVATION_OP_REMOVE_CONFIG: Remove observation stream config */
DRM_XE_PERF_OP_REMOVE_CONFIG, DRM_XE_OBSERVATION_OP_REMOVE_CONFIG,
}; };
/** /**
* struct drm_xe_perf_param - Input of &DRM_XE_PERF * struct drm_xe_observation_param - Input of &DRM_XE_OBSERVATION
* *
* The perf layer enables multiplexing perf counter streams of multiple * The observation layer enables multiplexing observation streams of
* types. The actual params for a particular stream operation are supplied * multiple types. The actual params for a particular stream operation are
* via the @param pointer (use __copy_from_user to get these params). * supplied via the @param pointer (use __copy_from_user to get these
* params).
*/ */
struct drm_xe_perf_param { struct drm_xe_observation_param {
/** @extensions: Pointer to the first extension struct, if any */ /** @extensions: Pointer to the first extension struct, if any */
__u64 extensions; __u64 extensions;
/** @perf_type: Perf stream type, of enum @drm_xe_perf_type */ /** @observation_type: observation stream type, of enum @drm_xe_observation_type */
__u64 perf_type; __u64 observation_type;
/** @perf_op: Perf op, of enum @drm_xe_perf_op */ /** @observation_op: observation stream op, of enum @drm_xe_observation_op */
__u64 perf_op; __u64 observation_op;
/** @param: Pointer to actual stream params */ /** @param: Pointer to actual stream params */
__u64 param; __u64 param;
}; };
/** /**
* enum drm_xe_perf_ioctls - Perf fd ioctl's * enum drm_xe_observation_ioctls - Observation stream fd ioctl's
* *
* Information exchanged between userspace and kernel for perf fd ioctl's * Information exchanged between userspace and kernel for observation fd
* is stream type specific * ioctl's is stream type specific
*/ */
enum drm_xe_perf_ioctls { enum drm_xe_observation_ioctls {
/** @DRM_XE_PERF_IOCTL_ENABLE: Enable data capture for a stream */ /** @DRM_XE_OBSERVATION_IOCTL_ENABLE: Enable data capture for an observation stream */
DRM_XE_PERF_IOCTL_ENABLE = _IO('i', 0x0), DRM_XE_OBSERVATION_IOCTL_ENABLE = _IO('i', 0x0),
/** @DRM_XE_PERF_IOCTL_DISABLE: Disable data capture for a stream */ /** @DRM_XE_OBSERVATION_IOCTL_DISABLE: Disable data capture for a observation stream */
DRM_XE_PERF_IOCTL_DISABLE = _IO('i', 0x1), DRM_XE_OBSERVATION_IOCTL_DISABLE = _IO('i', 0x1),
/** @DRM_XE_PERF_IOCTL_CONFIG: Change stream configuration */ /** @DRM_XE_OBSERVATION_IOCTL_CONFIG: Change observation stream configuration */
DRM_XE_PERF_IOCTL_CONFIG = _IO('i', 0x2), DRM_XE_OBSERVATION_IOCTL_CONFIG = _IO('i', 0x2),
/** @DRM_XE_PERF_IOCTL_STATUS: Return stream status */ /** @DRM_XE_OBSERVATION_IOCTL_STATUS: Return observation stream status */
DRM_XE_PERF_IOCTL_STATUS = _IO('i', 0x3), DRM_XE_OBSERVATION_IOCTL_STATUS = _IO('i', 0x3),
/** @DRM_XE_PERF_IOCTL_INFO: Return stream info */ /** @DRM_XE_OBSERVATION_IOCTL_INFO: Return observation stream info */
DRM_XE_PERF_IOCTL_INFO = _IO('i', 0x4), DRM_XE_OBSERVATION_IOCTL_INFO = _IO('i', 0x4),
}; };
/** /**
...@@ -1546,12 +1547,12 @@ enum drm_xe_oa_format_type { ...@@ -1546,12 +1547,12 @@ enum drm_xe_oa_format_type {
* Stream params are specified as a chain of @drm_xe_ext_set_property * Stream params are specified as a chain of @drm_xe_ext_set_property
* struct's, with @property values from enum @drm_xe_oa_property_id and * struct's, with @property values from enum @drm_xe_oa_property_id and
* @drm_xe_user_extension base.name set to @DRM_XE_OA_EXTENSION_SET_PROPERTY. * @drm_xe_user_extension base.name set to @DRM_XE_OA_EXTENSION_SET_PROPERTY.
* @param field in struct @drm_xe_perf_param points to the first * @param field in struct @drm_xe_observation_param points to the first
* @drm_xe_ext_set_property struct. * @drm_xe_ext_set_property struct.
* *
* Exactly the same mechanism is also used for stream reconfiguration using * Exactly the same mechanism is also used for stream reconfiguration using the
* the @DRM_XE_PERF_IOCTL_CONFIG perf fd ioctl, though only a subset of * @DRM_XE_OBSERVATION_IOCTL_CONFIG observation stream fd ioctl, though only a
* properties below can be specified for stream reconfiguration. * subset of properties below can be specified for stream reconfiguration.
*/ */
enum drm_xe_oa_property_id { enum drm_xe_oa_property_id {
#define DRM_XE_OA_EXTENSION_SET_PROPERTY 0 #define DRM_XE_OA_EXTENSION_SET_PROPERTY 0
...@@ -1571,11 +1572,11 @@ enum drm_xe_oa_property_id { ...@@ -1571,11 +1572,11 @@ enum drm_xe_oa_property_id {
/** /**
* @DRM_XE_OA_PROPERTY_OA_METRIC_SET: OA metrics defining contents of OA * @DRM_XE_OA_PROPERTY_OA_METRIC_SET: OA metrics defining contents of OA
* reports, previously added via @DRM_XE_PERF_OP_ADD_CONFIG. * reports, previously added via @DRM_XE_OBSERVATION_OP_ADD_CONFIG.
*/ */
DRM_XE_OA_PROPERTY_OA_METRIC_SET, DRM_XE_OA_PROPERTY_OA_METRIC_SET,
/** @DRM_XE_OA_PROPERTY_OA_FORMAT: Perf counter report format */ /** @DRM_XE_OA_PROPERTY_OA_FORMAT: OA counter report format */
DRM_XE_OA_PROPERTY_OA_FORMAT, DRM_XE_OA_PROPERTY_OA_FORMAT,
/* /*
* OA_FORMAT's are specified the same way as in PRM/Bspec 52198/60942, * OA_FORMAT's are specified the same way as in PRM/Bspec 52198/60942,
...@@ -1596,13 +1597,13 @@ enum drm_xe_oa_property_id { ...@@ -1596,13 +1597,13 @@ enum drm_xe_oa_property_id {
/** /**
* @DRM_XE_OA_PROPERTY_OA_DISABLED: A value of 1 will open the OA * @DRM_XE_OA_PROPERTY_OA_DISABLED: A value of 1 will open the OA
* stream in a DISABLED state (see @DRM_XE_PERF_IOCTL_ENABLE). * stream in a DISABLED state (see @DRM_XE_OBSERVATION_IOCTL_ENABLE).
*/ */
DRM_XE_OA_PROPERTY_OA_DISABLED, DRM_XE_OA_PROPERTY_OA_DISABLED,
/** /**
* @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID: Open the stream for a specific * @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID: Open the stream for a specific
* @exec_queue_id. Perf queries can be executed on this exec queue. * @exec_queue_id. OA queries can be executed on this exec queue.
*/ */
DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID, DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID,
...@@ -1622,7 +1623,7 @@ enum drm_xe_oa_property_id { ...@@ -1622,7 +1623,7 @@ enum drm_xe_oa_property_id {
/** /**
* struct drm_xe_oa_config - OA metric configuration * struct drm_xe_oa_config - OA metric configuration
* *
* Multiple OA configs can be added using @DRM_XE_PERF_OP_ADD_CONFIG. A * Multiple OA configs can be added using @DRM_XE_OBSERVATION_OP_ADD_CONFIG. A
* particular config can be specified when opening an OA stream using * particular config can be specified when opening an OA stream using
* @DRM_XE_OA_PROPERTY_OA_METRIC_SET property. * @DRM_XE_OA_PROPERTY_OA_METRIC_SET property.
*/ */
...@@ -1645,8 +1646,9 @@ struct drm_xe_oa_config { ...@@ -1645,8 +1646,9 @@ struct drm_xe_oa_config {
/** /**
* struct drm_xe_oa_stream_status - OA stream status returned from * struct drm_xe_oa_stream_status - OA stream status returned from
* @DRM_XE_PERF_IOCTL_STATUS perf fd ioctl. Userspace can call the ioctl to * @DRM_XE_OBSERVATION_IOCTL_STATUS observation stream fd ioctl. Userspace can
* query stream status in response to EIO errno from perf fd read(). * call the ioctl to query stream status in response to EIO errno from
* observation fd read().
*/ */
struct drm_xe_oa_stream_status { struct drm_xe_oa_stream_status {
/** @extensions: Pointer to the first extension struct, if any */ /** @extensions: Pointer to the first extension struct, if any */
...@@ -1665,7 +1667,7 @@ struct drm_xe_oa_stream_status { ...@@ -1665,7 +1667,7 @@ struct drm_xe_oa_stream_status {
/** /**
* struct drm_xe_oa_stream_info - OA stream info returned from * struct drm_xe_oa_stream_info - OA stream info returned from
* @DRM_XE_PERF_IOCTL_INFO perf fd ioctl * @DRM_XE_OBSERVATION_IOCTL_INFO observation stream fd ioctl
*/ */
struct drm_xe_oa_stream_info { struct drm_xe_oa_stream_info {
/** @extensions: Pointer to the first extension struct, if any */ /** @extensions: Pointer to the first extension struct, if any */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment