1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /* Copyright 2020 Qiang Yu <yuq825@gmail.com> */
3 
4 #if !defined(_LIMA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _LIMA_TRACE_H_
6 
7 #include <linux/tracepoint.h>
8 
9 #undef TRACE_SYSTEM
10 #define TRACE_SYSTEM lima
11 #define TRACE_INCLUDE_FILE lima_trace
12 
13 DECLARE_EVENT_CLASS(lima_task,
14 	TP_PROTO(struct lima_sched_task *task),
15 	TP_ARGS(task),
16 	TP_STRUCT__entry(
17 		__field(uint64_t, task_id)
18 		__field(unsigned int, context)
19 		__field(unsigned int, seqno)
20 		__string(pipe, task->base.sched->name)
21 		),
22 
23 	TP_fast_assign(
24 		__entry->task_id = task->base.id;
25 		__entry->context = task->base.s_fence->finished.context;
26 		__entry->seqno = task->base.s_fence->finished.seqno;
27 		__assign_str(pipe, task->base.sched->name);
28 		),
29 
30 	TP_printk("task=%llu, context=%u seqno=%u pipe=%s",
31 		  __entry->task_id, __entry->context, __entry->seqno,
32 		  __get_str(pipe))
33 );
34 
35 DEFINE_EVENT(lima_task, lima_task_submit,
36 	     TP_PROTO(struct lima_sched_task *task),
37 	     TP_ARGS(task)
38 );
39 
40 DEFINE_EVENT(lima_task, lima_task_run,
41 	     TP_PROTO(struct lima_sched_task *task),
42 	     TP_ARGS(task)
43 );
44 
45 #endif
46 
47 /* This part must be outside protection */
48 #undef TRACE_INCLUDE_PATH
49 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/lima
50 #include <trace/define_trace.h>
51