1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #if !defined(_GPU_SCHED_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
25 #define _GPU_SCHED_TRACE_H_
26
27 #include <linux/stringify.h>
28 #include <linux/types.h>
29 #include <linux/tracepoint.h>
30
31 #undef TRACE_SYSTEM
32 #define TRACE_SYSTEM gpu_scheduler
33 #define TRACE_INCLUDE_FILE gpu_scheduler_trace
34
35 TRACE_EVENT(drm_sched_job,
36 TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity),
37 TP_ARGS(sched_job, entity),
38 TP_STRUCT__entry(
39 __field(struct drm_sched_entity *, entity)
40 __field(struct dma_fence *, fence)
41 __field(const char *, name)
42 __field(uint64_t, id)
43 __field(u32, job_count)
44 __field(int, hw_job_count)
45 ),
46
47 TP_fast_assign(
48 __entry->entity = entity;
49 __entry->id = sched_job->id;
50 __entry->fence = &sched_job->s_fence->finished;
51 __entry->name = sched_job->sched->name;
52 __entry->job_count = spsc_queue_count(&entity->job_queue);
53 __entry->hw_job_count = atomic_read(
54 &sched_job->sched->hw_rq_count);
55 ),
56 TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d",
57 __entry->entity, __entry->id,
58 __entry->fence, __entry->name,
59 __entry->job_count, __entry->hw_job_count)
60 );
61
62 TRACE_EVENT(drm_sched_process_job,
63 TP_PROTO(struct drm_sched_fence *fence),
64 TP_ARGS(fence),
65 TP_STRUCT__entry(
66 __field(struct dma_fence *, fence)
67 ),
68
69 TP_fast_assign(
70 __entry->fence = &fence->finished;
71 ),
72 TP_printk("fence=%p signaled", __entry->fence)
73 );
74
75 TRACE_EVENT(drm_sched_job_wait_dep,
76 TP_PROTO(struct drm_sched_job *sched_job, struct dma_fence *fence),
77 TP_ARGS(sched_job, fence),
78 TP_STRUCT__entry(
79 __field(const char *,name)
80 __field(uint64_t, id)
81 __field(struct dma_fence *, fence)
82 __field(uint64_t, ctx)
83 __field(unsigned, seqno)
84 ),
85
86 TP_fast_assign(
87 __entry->name = sched_job->sched->name;
88 __entry->id = sched_job->id;
89 __entry->fence = fence;
90 __entry->ctx = fence->context;
91 __entry->seqno = fence->seqno;
92 ),
93 TP_printk("job ring=%s, id=%llu, depends fence=%p, context=%llu, seq=%u",
94 __entry->name, __entry->id,
95 __entry->fence, __entry->ctx,
96 __entry->seqno)
97 );
98
99 #endif
100
101
102 #undef TRACE_INCLUDE_PATH
103 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/scheduler
104 #include <trace/define_trace.h>