dma_fence.h 2.9 KB
Newer Older
1
#undef TRACE_SYSTEM
2
#define TRACE_SYSTEM dma_fence
3 4

#if !defined(_TRACE_FENCE_H) || defined(TRACE_HEADER_MULTI_READ)
5
#define _TRACE_DMA_FENCE_H
6 7 8

#include <linux/tracepoint.h>

9
struct dma_fence;
10

11
TRACE_EVENT(dma_fence_annotate_wait_on,
12 13

	/* fence: the fence waiting on f1, f1: the fence to be waited on. */
14
	TP_PROTO(struct dma_fence *fence, struct dma_fence *f1),
15 16 17 18 19

	TP_ARGS(fence, f1),

	TP_STRUCT__entry(
		__string(driver, fence->ops->get_driver_name(fence))
20
		__string(timeline, fence->ops->get_timeline_name(fence))
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
		__field(unsigned int, context)
		__field(unsigned int, seqno)

		__string(waiting_driver, f1->ops->get_driver_name(f1))
		__string(waiting_timeline, f1->ops->get_timeline_name(f1))
		__field(unsigned int, waiting_context)
		__field(unsigned int, waiting_seqno)
	),

	TP_fast_assign(
		__assign_str(driver, fence->ops->get_driver_name(fence))
		__assign_str(timeline, fence->ops->get_timeline_name(fence))
		__entry->context = fence->context;
		__entry->seqno = fence->seqno;

		__assign_str(waiting_driver, f1->ops->get_driver_name(f1))
		__assign_str(waiting_timeline, f1->ops->get_timeline_name(f1))
		__entry->waiting_context = f1->context;
		__entry->waiting_seqno = f1->seqno;

	),

	TP_printk("driver=%s timeline=%s context=%u seqno=%u "	\
		  "waits on driver=%s timeline=%s context=%u seqno=%u",
		  __get_str(driver), __get_str(timeline), __entry->context,
		  __entry->seqno,
		  __get_str(waiting_driver), __get_str(waiting_timeline),
		  __entry->waiting_context, __entry->waiting_seqno)
);

51
DECLARE_EVENT_CLASS(dma_fence,
52

53
	TP_PROTO(struct dma_fence *fence),
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

	TP_ARGS(fence),

	TP_STRUCT__entry(
		__string(driver, fence->ops->get_driver_name(fence))
		__string(timeline, fence->ops->get_timeline_name(fence))
		__field(unsigned int, context)
		__field(unsigned int, seqno)
	),

	TP_fast_assign(
		__assign_str(driver, fence->ops->get_driver_name(fence))
		__assign_str(timeline, fence->ops->get_timeline_name(fence))
		__entry->context = fence->context;
		__entry->seqno = fence->seqno;
	),

	TP_printk("driver=%s timeline=%s context=%u seqno=%u",
		  __get_str(driver), __get_str(timeline), __entry->context,
		  __entry->seqno)
);

76
DEFINE_EVENT(dma_fence, dma_fence_emit,
77

78
	TP_PROTO(struct dma_fence *fence),
79 80 81 82

	TP_ARGS(fence)
);

83
DEFINE_EVENT(dma_fence, dma_fence_init,
84

85
	TP_PROTO(struct dma_fence *fence),
86 87 88 89

	TP_ARGS(fence)
);

90
DEFINE_EVENT(dma_fence, dma_fence_destroy,
91

92
	TP_PROTO(struct dma_fence *fence),
93 94 95 96

	TP_ARGS(fence)
);

97
DEFINE_EVENT(dma_fence, dma_fence_enable_signal,
98

99
	TP_PROTO(struct dma_fence *fence),
100 101 102 103

	TP_ARGS(fence)
);

104
DEFINE_EVENT(dma_fence, dma_fence_signaled,
105

106
	TP_PROTO(struct dma_fence *fence),
107 108 109 110

	TP_ARGS(fence)
);

111
DEFINE_EVENT(dma_fence, dma_fence_wait_start,
112

113
	TP_PROTO(struct dma_fence *fence),
114 115 116 117

	TP_ARGS(fence)
);

118
DEFINE_EVENT(dma_fence, dma_fence_wait_end,
119

120
	TP_PROTO(struct dma_fence *fence),
121 122 123 124

	TP_ARGS(fence)
);

125
#endif /*  _TRACE_DMA_FENCE_H */
126 127 128

/* This part must be outside protection */
#include <trace/define_trace.h>