aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h')
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h b/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h
new file mode 100644
index 000000000000..144f50acc971
--- /dev/null
+++ b/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h
@@ -0,0 +1,41 @@
1#if !defined(_GPU_SCHED_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _GPU_SCHED_TRACE_H_
3
4#include <linux/stringify.h>
5#include <linux/types.h>
6#include <linux/tracepoint.h>
7
8#include <drm/drmP.h>
9
10#undef TRACE_SYSTEM
11#define TRACE_SYSTEM gpu_sched
12#define TRACE_INCLUDE_FILE gpu_sched_trace
13
14TRACE_EVENT(amd_sched_job,
15 TP_PROTO(struct amd_sched_job *sched_job),
16 TP_ARGS(sched_job),
17 TP_STRUCT__entry(
18 __field(struct amd_sched_entity *, entity)
19 __field(const char *, name)
20 __field(u32, job_count)
21 __field(int, hw_job_count)
22 ),
23
24 TP_fast_assign(
25 __entry->entity = sched_job->s_entity;
26 __entry->name = sched_job->sched->name;
27 __entry->job_count = kfifo_len(
28 &sched_job->s_entity->job_queue) / sizeof(sched_job);
29 __entry->hw_job_count = atomic_read(
30 &sched_job->sched->hw_rq_count);
31 ),
32 TP_printk("entity=%p, ring=%s, job count:%u, hw job count:%d",
33 __entry->entity, __entry->name, __entry->job_count,
34 __entry->hw_job_count)
35);
36#endif
37
38/* This part must be outside protection */
39#undef TRACE_INCLUDE_PATH
40#define TRACE_INCLUDE_PATH .
41#include <trace/define_trace.h>