1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_MSM_GPU_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
3 #define _MSM_GPU_TRACE_H_
5 #include <linux/tracepoint.h>
8 #define TRACE_SYSTEM drm_msm_gpu
9 #define TRACE_INCLUDE_FILE msm_gpu_trace
11 TRACE_EVENT(msm_gpu_submit
,
12 TP_PROTO(pid_t pid
, u32 ringid
, u32 id
, u32 nr_bos
, u32 nr_cmds
),
13 TP_ARGS(pid
, ringid
, id
, nr_bos
, nr_cmds
),
24 __entry
->ringid
= ringid
;
25 __entry
->nr_bos
= nr_bos
;
26 __entry
->nr_cmds
= nr_cmds
28 TP_printk("id=%d pid=%d ring=%d bos=%d cmds=%d",
29 __entry
->id
, __entry
->pid
, __entry
->ringid
,
30 __entry
->nr_bos
, __entry
->nr_cmds
)
33 TRACE_EVENT(msm_gpu_submit_flush
,
34 TP_PROTO(struct msm_gem_submit
*submit
, u64 ticks
),
35 TP_ARGS(submit
, ticks
),
44 __entry
->pid
= pid_nr(submit
->pid
);
45 __entry
->id
= submit
->ident
;
46 __entry
->ringid
= submit
->ring
->id
;
47 __entry
->seqno
= submit
->seqno
;
48 __entry
->ticks
= ticks
;
50 TP_printk("id=%d pid=%d ring=%d:%d ticks=%lld",
51 __entry
->id
, __entry
->pid
, __entry
->ringid
, __entry
->seqno
,
56 TRACE_EVENT(msm_gpu_submit_retired
,
57 TP_PROTO(struct msm_gem_submit
*submit
, u64 elapsed
, u64 clock
,
59 TP_ARGS(submit
, elapsed
, clock
, start
, end
),
67 __field(u64
, start_ticks
)
68 __field(u64
, end_ticks
)
71 __entry
->pid
= pid_nr(submit
->pid
);
72 __entry
->id
= submit
->ident
;
73 __entry
->ringid
= submit
->ring
->id
;
74 __entry
->seqno
= submit
->seqno
;
75 __entry
->elapsed
= elapsed
;
76 __entry
->clock
= clock
;
77 __entry
->start_ticks
= start
;
78 __entry
->end_ticks
= end
;
80 TP_printk("id=%d pid=%d ring=%d:%d elapsed=%lld ns mhz=%lld start=%lld end=%lld",
81 __entry
->id
, __entry
->pid
, __entry
->ringid
, __entry
->seqno
,
82 __entry
->elapsed
, __entry
->clock
,
83 __entry
->start_ticks
, __entry
->end_ticks
)
87 TRACE_EVENT(msm_gpu_freq_change
,
94 /* trace freq in MHz to match intel_gpu_freq_change, to make life easier
97 __entry
->freq
= DIV_ROUND_UP(freq
, 1000000);
99 TP_printk("new_freq=%u", __entry
->freq
)
103 TRACE_EVENT(msm_gmu_freq_change
,
104 TP_PROTO(u32 freq
, u32 perf_index
),
105 TP_ARGS(freq
, perf_index
),
108 __field(u32
, perf_index
)
111 __entry
->freq
= freq
;
112 __entry
->perf_index
= perf_index
;
114 TP_printk("freq=%u, perf_index=%u", __entry
->freq
, __entry
->perf_index
)
118 TRACE_EVENT(msm_gem_purge
,
125 __entry
->bytes
= bytes
;
127 TP_printk("Purging %u bytes", __entry
->bytes
)
131 TRACE_EVENT(msm_gem_purge_vmaps
,
132 TP_PROTO(u32 unmapped
),
135 __field(u32
, unmapped
)
138 __entry
->unmapped
= unmapped
;
140 TP_printk("Purging %u vmaps", __entry
->unmapped
)
144 TRACE_EVENT(msm_gpu_suspend
,
151 __entry
->dummy
= dummy
;
153 TP_printk("%u", __entry
->dummy
)
157 TRACE_EVENT(msm_gpu_resume
,
164 __entry
->dummy
= dummy
;
166 TP_printk("%u", __entry
->dummy
)
171 #undef TRACE_INCLUDE_PATH
172 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/msm
173 #include <trace/define_trace.h>