| 1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 |
#undef TRACE_SYSTEM |
| 3 |
#define TRACE_SYSTEM dma_fence |
| 4 |
|
| 5 |
#if !defined(_TRACE_DMA_FENCE_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 |
#define _TRACE_DMA_FENCE_H |
| 7 |
|
| 8 |
#include <linux/tracepoint.h> |
| 9 |
|
| 10 |
struct dma_fence; |
| 11 |
|
| 12 |
DECLARE_EVENT_CLASS(dma_fence, |
| 13 |
|
| 14 |
TP_PROTO(struct dma_fence *fence), |
| 15 |
|
| 16 |
TP_ARGS(fence), |
| 17 |
|
| 18 |
TP_STRUCT__entry( |
| 19 |
__string(driver, dma_fence_driver_name(fence)) |
| 20 |
__string(timeline, dma_fence_timeline_name(fence)) |
| 21 |
__field(unsigned int, context) |
| 22 |
__field(unsigned int, seqno) |
| 23 |
), |
| 24 |
|
| 25 |
TP_fast_assign( |
| 26 |
__assign_str(driver); |
| 27 |
__assign_str(timeline); |
| 28 |
__entry->context = fence->context; |
| 29 |
__entry->seqno = fence->seqno; |
| 30 |
), |
| 31 |
|
| 32 |
TP_printk("driver=%s timeline=%s context=%u seqno=%u", |
| 33 |
__get_str(driver), __get_str(timeline), __entry->context, |
| 34 |
__entry->seqno) |
| 35 |
); |
| 36 |
|
| 37 |
/* |
| 38 |
* Safe only for call sites which are guaranteed to not race with fence |
| 39 |
* signaling,holding the fence->lock and having checked for not signaled, or the |
| 40 |
* signaling path itself. |
| 41 |
*/ |
| 42 |
DECLARE_EVENT_CLASS(dma_fence_unsignaled, |
| 43 |
|
| 44 |
TP_PROTO(struct dma_fence *fence), |
| 45 |
|
| 46 |
TP_ARGS(fence), |
| 47 |
|
| 48 |
TP_STRUCT__entry( |
| 49 |
__string(driver, fence->ops->get_driver_name(fence)) |
| 50 |
__string(timeline, fence->ops->get_timeline_name(fence)) |
| 51 |
__field(unsigned int, context) |
| 52 |
__field(unsigned int, seqno) |
| 53 |
), |
| 54 |
|
| 55 |
TP_fast_assign( |
| 56 |
__assign_str(driver); |
| 57 |
__assign_str(timeline); |
| 58 |
__entry->context = fence->context; |
| 59 |
__entry->seqno = fence->seqno; |
| 60 |
), |
| 61 |
|
| 62 |
TP_printk("driver=%s timeline=%s context=%u seqno=%u", |
| 63 |
__get_str(driver), __get_str(timeline), __entry->context, |
| 64 |
__entry->seqno) |
| 65 |
); |
| 66 |
|
| 67 |
DEFINE_EVENT(dma_fence_unsignaled, dma_fence_emit, |
| 68 |
|
| 69 |
TP_PROTO(struct dma_fence *fence), |
| 70 |
|
| 71 |
TP_ARGS(fence) |
| 72 |
); |
| 73 |
|
| 74 |
DEFINE_EVENT(dma_fence_unsignaled, dma_fence_init, |
| 75 |
|
| 76 |
TP_PROTO(struct dma_fence *fence), |
| 77 |
|
| 78 |
TP_ARGS(fence) |
| 79 |
); |
| 80 |
|
| 81 |
DEFINE_EVENT(dma_fence, dma_fence_destroy, |
| 82 |
|
| 83 |
TP_PROTO(struct dma_fence *fence), |
| 84 |
|
| 85 |
TP_ARGS(fence) |
| 86 |
); |
| 87 |
|
| 88 |
DEFINE_EVENT(dma_fence_unsignaled, dma_fence_enable_signal, |
| 89 |
|
| 90 |
TP_PROTO(struct dma_fence *fence), |
| 91 |
|
| 92 |
TP_ARGS(fence) |
| 93 |
); |
| 94 |
|
| 95 |
DEFINE_EVENT(dma_fence_unsignaled, dma_fence_signaled, |
| 96 |
|
| 97 |
TP_PROTO(struct dma_fence *fence), |
| 98 |
|
| 99 |
TP_ARGS(fence) |
| 100 |
); |
| 101 |
|
| 102 |
DEFINE_EVENT(dma_fence, dma_fence_wait_start, |
| 103 |
|
| 104 |
TP_PROTO(struct dma_fence *fence), |
| 105 |
|
| 106 |
TP_ARGS(fence) |
| 107 |
); |
| 108 |
|
| 109 |
DEFINE_EVENT(dma_fence, dma_fence_wait_end, |
| 110 |
|
| 111 |
TP_PROTO(struct dma_fence *fence), |
| 112 |
|
| 113 |
TP_ARGS(fence) |
| 114 |
); |
| 115 |
|
| 116 |
#endif /* _TRACE_DMA_FENCE_H */ |
| 117 |
|
| 118 |
/* This part must be outside protection */ |
| 119 |
#include <trace/define_trace.h> |