summaryrefslogtreecommitdiff
path: root/benchmarks/gem_exec_tracer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-03-28 13:12:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-03-28 13:13:47 +0100
commit4bf3ca8422e2153b208b0cba791b8a45c64ac9d9 (patch)
tree93fc32597b8ac16c71c3d8af6f5c9e3b00490d54 /benchmarks/gem_exec_tracer.c
parent49e09e73460b74a56b210b804f32abbcf5eab66a (diff)
benchmarks/gem_exec_trace: Include client wait points
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks/gem_exec_tracer.c')
-rw-r--r--benchmarks/gem_exec_tracer.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/benchmarks/gem_exec_tracer.c b/benchmarks/gem_exec_tracer.c
index 9af61420..4316e218 100644
--- a/benchmarks/gem_exec_tracer.c
+++ b/benchmarks/gem_exec_tracer.c
@@ -59,6 +59,7 @@ enum {
ADD_CTX,
DEL_CTX,
EXEC,
+ WAIT,
};
static struct trace_verion {
@@ -114,6 +115,11 @@ struct trace_exec_relocation {
uint32_t write_domain;
}__attribute__((packed));
+struct trace_wait {
+ uint8_t cmd;
+ uint32_t handle;
+} __attribute__((packed));
+
static void __attribute__ ((format(__printf__, 2, 3)))
fail_if(int cond, const char *format, ...)
{
@@ -175,6 +181,13 @@ trace_exec(struct trace *trace,
}
static void
+trace_wait(struct trace *trace, uint32_t handle)
+{
+ struct trace_wait t = { WAIT, handle };
+ fwrite(&t, sizeof(t), 1, trace->file);
+}
+
+static void
trace_add(struct trace *trace, uint32_t handle, uint64_t size)
{
struct trace_add_bo t = { ADD_BO, handle, size };
@@ -314,6 +327,18 @@ ioctl(int fd, unsigned long request, ...)
trace_del_context(t, close->ctx_id);
break;
}
+
+ case DRM_IOCTL_I915_GEM_WAIT: {
+ struct drm_i915_gem_wait *w = argp;
+ trace_wait(t, w->bo_handle);
+ break;
+ }
+
+ case DRM_IOCTL_I915_GEM_SET_DOMAIN: {
+ struct drm_i915_gem_set_domain *w = argp;
+ trace_wait(t, w->handle);
+ break;
+ }
}
ret = libc_ioctl(fd, request, argp);