xref: /linux/drivers/gpu/drm/lima/lima_trace.h (revision c771600c6af14749609b49565ffb4cac2959710d)
17f60c4b9SQiang Yu /* SPDX-License-Identifier: GPL-2.0 OR MIT */
27f60c4b9SQiang Yu /* Copyright 2020 Qiang Yu <yuq825@gmail.com> */
37f60c4b9SQiang Yu 
47f60c4b9SQiang Yu #if !defined(_LIMA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
57f60c4b9SQiang Yu #define _LIMA_TRACE_H_
67f60c4b9SQiang Yu 
77f60c4b9SQiang Yu #include <linux/tracepoint.h>
87f60c4b9SQiang Yu 
97f60c4b9SQiang Yu #undef TRACE_SYSTEM
107f60c4b9SQiang Yu #define TRACE_SYSTEM lima
117f60c4b9SQiang Yu #define TRACE_INCLUDE_FILE lima_trace
127f60c4b9SQiang Yu 
137f60c4b9SQiang Yu DECLARE_EVENT_CLASS(lima_task,
147f60c4b9SQiang Yu 	TP_PROTO(struct lima_sched_task *task),
157f60c4b9SQiang Yu 	TP_ARGS(task),
167f60c4b9SQiang Yu 	TP_STRUCT__entry(
177f60c4b9SQiang Yu 		__field(uint64_t, task_id)
187f60c4b9SQiang Yu 		__field(unsigned int, context)
197f60c4b9SQiang Yu 		__field(unsigned int, seqno)
207f60c4b9SQiang Yu 		__string(pipe, task->base.sched->name)
217f60c4b9SQiang Yu 		),
227f60c4b9SQiang Yu 
237f60c4b9SQiang Yu 	TP_fast_assign(
247f60c4b9SQiang Yu 		__entry->task_id = task->base.id;
257f60c4b9SQiang Yu 		__entry->context = task->base.s_fence->finished.context;
267f60c4b9SQiang Yu 		__entry->seqno = task->base.s_fence->finished.seqno;
27*2c92ca84SSteven Rostedt (Google) 		__assign_str(pipe);
287f60c4b9SQiang Yu 		),
297f60c4b9SQiang Yu 
307f60c4b9SQiang Yu 	TP_printk("task=%llu, context=%u seqno=%u pipe=%s",
317f60c4b9SQiang Yu 		  __entry->task_id, __entry->context, __entry->seqno,
327f60c4b9SQiang Yu 		  __get_str(pipe))
337f60c4b9SQiang Yu );
347f60c4b9SQiang Yu 
357f60c4b9SQiang Yu DEFINE_EVENT(lima_task, lima_task_submit,
367f60c4b9SQiang Yu 	     TP_PROTO(struct lima_sched_task *task),
377f60c4b9SQiang Yu 	     TP_ARGS(task)
387f60c4b9SQiang Yu );
397f60c4b9SQiang Yu 
407f60c4b9SQiang Yu DEFINE_EVENT(lima_task, lima_task_run,
417f60c4b9SQiang Yu 	     TP_PROTO(struct lima_sched_task *task),
427f60c4b9SQiang Yu 	     TP_ARGS(task)
437f60c4b9SQiang Yu );
447f60c4b9SQiang Yu 
457f60c4b9SQiang Yu #endif
467f60c4b9SQiang Yu 
477f60c4b9SQiang Yu /* This part must be outside protection */
487f60c4b9SQiang Yu #undef TRACE_INCLUDE_PATH
497f60c4b9SQiang Yu #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/lima
507f60c4b9SQiang Yu #include <trace/define_trace.h>
51