162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR MIT */
262306a36Sopenharmony_ci/* Copyright 2020 Qiang Yu <yuq825@gmail.com> */
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci#if !defined(_LIMA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
562306a36Sopenharmony_ci#define _LIMA_TRACE_H_
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#include <linux/tracepoint.h>
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#undef TRACE_SYSTEM
1062306a36Sopenharmony_ci#define TRACE_SYSTEM lima
1162306a36Sopenharmony_ci#define TRACE_INCLUDE_FILE lima_trace
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciDECLARE_EVENT_CLASS(lima_task,
1462306a36Sopenharmony_ci	TP_PROTO(struct lima_sched_task *task),
1562306a36Sopenharmony_ci	TP_ARGS(task),
1662306a36Sopenharmony_ci	TP_STRUCT__entry(
1762306a36Sopenharmony_ci		__field(uint64_t, task_id)
1862306a36Sopenharmony_ci		__field(unsigned int, context)
1962306a36Sopenharmony_ci		__field(unsigned int, seqno)
2062306a36Sopenharmony_ci		__string(pipe, task->base.sched->name)
2162306a36Sopenharmony_ci		),
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci	TP_fast_assign(
2462306a36Sopenharmony_ci		__entry->task_id = task->base.id;
2562306a36Sopenharmony_ci		__entry->context = task->base.s_fence->finished.context;
2662306a36Sopenharmony_ci		__entry->seqno = task->base.s_fence->finished.seqno;
2762306a36Sopenharmony_ci		__assign_str(pipe, task->base.sched->name);
2862306a36Sopenharmony_ci		),
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci	TP_printk("task=%llu, context=%u seqno=%u pipe=%s",
3162306a36Sopenharmony_ci		  __entry->task_id, __entry->context, __entry->seqno,
3262306a36Sopenharmony_ci		  __get_str(pipe))
3362306a36Sopenharmony_ci);
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciDEFINE_EVENT(lima_task, lima_task_submit,
3662306a36Sopenharmony_ci	     TP_PROTO(struct lima_sched_task *task),
3762306a36Sopenharmony_ci	     TP_ARGS(task)
3862306a36Sopenharmony_ci);
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciDEFINE_EVENT(lima_task, lima_task_run,
4162306a36Sopenharmony_ci	     TP_PROTO(struct lima_sched_task *task),
4262306a36Sopenharmony_ci	     TP_ARGS(task)
4362306a36Sopenharmony_ci);
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#endif
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci/* This part must be outside protection */
4862306a36Sopenharmony_ci#undef TRACE_INCLUDE_PATH
4962306a36Sopenharmony_ci#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/lima
5062306a36Sopenharmony_ci#include <trace/define_trace.h>
51