2 * Copyright 2017 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
24 #if !defined(_GPU_SCHED_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
25 #define _GPU_SCHED_TRACE_H_
27 #include <linux/stringify.h>
28 #include <linux/types.h>
29 #include <linux/tracepoint.h>
34 #define TRACE_SYSTEM gpu_scheduler
35 #define TRACE_INCLUDE_FILE gpu_scheduler_trace
37 TRACE_EVENT(drm_sched_job
,
38 TP_PROTO(struct drm_sched_job
*sched_job
, struct drm_sched_entity
*entity
),
39 TP_ARGS(sched_job
, entity
),
41 __field(struct drm_sched_entity
*, entity
)
42 __field(struct dma_fence
*, fence
)
43 __field(const char *, name
)
45 __field(u32
, job_count
)
46 __field(int, hw_job_count
)
50 __entry
->entity
= entity
;
51 __entry
->id
= sched_job
->id
;
52 __entry
->fence
= &sched_job
->s_fence
->finished
;
53 __entry
->name
= sched_job
->sched
->name
;
54 __entry
->job_count
= spsc_queue_count(&entity
->job_queue
);
55 __entry
->hw_job_count
= atomic_read(
56 &sched_job
->sched
->hw_rq_count
);
58 TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d",
59 __entry
->entity
, __entry
->id
,
60 __entry
->fence
, __entry
->name
,
61 __entry
->job_count
, __entry
->hw_job_count
)
64 TRACE_EVENT(drm_sched_process_job
,
65 TP_PROTO(struct drm_sched_fence
*fence
),
68 __field(struct dma_fence
*, fence
)
72 __entry
->fence
= &fence
->finished
;
74 TP_printk("fence=%p signaled", __entry
->fence
)
79 /* This part must be outside protection */
80 #undef TRACE_INCLUDE_PATH
81 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/scheduler
82 #include <trace/define_trace.h>