1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2f54d1867SChris Wilson #undef TRACE_SYSTEM 3f54d1867SChris Wilson #define TRACE_SYSTEM dma_fence 4f54d1867SChris Wilson 5f54d1867SChris Wilson #if !defined(_TRACE_FENCE_H) || defined(TRACE_HEADER_MULTI_READ) 6f54d1867SChris Wilson #define _TRACE_DMA_FENCE_H 7f54d1867SChris Wilson 8f54d1867SChris Wilson #include <linux/tracepoint.h> 9f54d1867SChris Wilson 10f54d1867SChris Wilson struct dma_fence; 11f54d1867SChris Wilson 12f54d1867SChris Wilson TRACE_EVENT(dma_fence_annotate_wait_on, 13f54d1867SChris Wilson 14f54d1867SChris Wilson /* fence: the fence waiting on f1, f1: the fence to be waited on. */ 15f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence, struct dma_fence *f1), 16f54d1867SChris Wilson 17f54d1867SChris Wilson TP_ARGS(fence, f1), 18f54d1867SChris Wilson 19f54d1867SChris Wilson TP_STRUCT__entry( 20f54d1867SChris Wilson __string(driver, fence->ops->get_driver_name(fence)) 21f54d1867SChris Wilson __string(timeline, fence->ops->get_timeline_name(fence)) 22f54d1867SChris Wilson __field(unsigned int, context) 23f54d1867SChris Wilson __field(unsigned int, seqno) 24f54d1867SChris Wilson 25f54d1867SChris Wilson __string(waiting_driver, f1->ops->get_driver_name(f1)) 26f54d1867SChris Wilson __string(waiting_timeline, f1->ops->get_timeline_name(f1)) 27f54d1867SChris Wilson __field(unsigned int, waiting_context) 28f54d1867SChris Wilson __field(unsigned int, waiting_seqno) 29f54d1867SChris Wilson ), 30f54d1867SChris Wilson 31f54d1867SChris Wilson TP_fast_assign( 32f54d1867SChris Wilson __assign_str(driver, fence->ops->get_driver_name(fence)) 33f54d1867SChris Wilson __assign_str(timeline, fence->ops->get_timeline_name(fence)) 34f54d1867SChris Wilson __entry->context = fence->context; 35f54d1867SChris Wilson __entry->seqno = fence->seqno; 36f54d1867SChris Wilson 37f54d1867SChris Wilson __assign_str(waiting_driver, f1->ops->get_driver_name(f1)) 38f54d1867SChris Wilson __assign_str(waiting_timeline, f1->ops->get_timeline_name(f1)) 39f54d1867SChris Wilson __entry->waiting_context = f1->context; 40f54d1867SChris Wilson __entry->waiting_seqno = f1->seqno; 41f54d1867SChris Wilson 42f54d1867SChris Wilson ), 43f54d1867SChris Wilson 44f54d1867SChris Wilson TP_printk("driver=%s timeline=%s context=%u seqno=%u " \ 45f54d1867SChris Wilson "waits on driver=%s timeline=%s context=%u seqno=%u", 46f54d1867SChris Wilson __get_str(driver), __get_str(timeline), __entry->context, 47f54d1867SChris Wilson __entry->seqno, 48f54d1867SChris Wilson __get_str(waiting_driver), __get_str(waiting_timeline), 49f54d1867SChris Wilson __entry->waiting_context, __entry->waiting_seqno) 50f54d1867SChris Wilson ); 51f54d1867SChris Wilson 52f54d1867SChris Wilson DECLARE_EVENT_CLASS(dma_fence, 53f54d1867SChris Wilson 54f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 55f54d1867SChris Wilson 56f54d1867SChris Wilson TP_ARGS(fence), 57f54d1867SChris Wilson 58f54d1867SChris Wilson TP_STRUCT__entry( 59f54d1867SChris Wilson __string(driver, fence->ops->get_driver_name(fence)) 60f54d1867SChris Wilson __string(timeline, fence->ops->get_timeline_name(fence)) 61f54d1867SChris Wilson __field(unsigned int, context) 62f54d1867SChris Wilson __field(unsigned int, seqno) 63f54d1867SChris Wilson ), 64f54d1867SChris Wilson 65f54d1867SChris Wilson TP_fast_assign( 66f54d1867SChris Wilson __assign_str(driver, fence->ops->get_driver_name(fence)) 67f54d1867SChris Wilson __assign_str(timeline, fence->ops->get_timeline_name(fence)) 68f54d1867SChris Wilson __entry->context = fence->context; 69f54d1867SChris Wilson __entry->seqno = fence->seqno; 70f54d1867SChris Wilson ), 71f54d1867SChris Wilson 72f54d1867SChris Wilson TP_printk("driver=%s timeline=%s context=%u seqno=%u", 73f54d1867SChris Wilson __get_str(driver), __get_str(timeline), __entry->context, 74f54d1867SChris Wilson __entry->seqno) 75f54d1867SChris Wilson ); 76f54d1867SChris Wilson 77f54d1867SChris Wilson DEFINE_EVENT(dma_fence, dma_fence_emit, 78f54d1867SChris Wilson 79f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 80f54d1867SChris Wilson 81f54d1867SChris Wilson TP_ARGS(fence) 82f54d1867SChris Wilson ); 83f54d1867SChris Wilson 84f54d1867SChris Wilson DEFINE_EVENT(dma_fence, dma_fence_init, 85f54d1867SChris Wilson 86f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 87f54d1867SChris Wilson 88f54d1867SChris Wilson TP_ARGS(fence) 89f54d1867SChris Wilson ); 90f54d1867SChris Wilson 91f54d1867SChris Wilson DEFINE_EVENT(dma_fence, dma_fence_destroy, 92f54d1867SChris Wilson 93f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 94f54d1867SChris Wilson 95f54d1867SChris Wilson TP_ARGS(fence) 96f54d1867SChris Wilson ); 97f54d1867SChris Wilson 98f54d1867SChris Wilson DEFINE_EVENT(dma_fence, dma_fence_enable_signal, 99f54d1867SChris Wilson 100f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 101f54d1867SChris Wilson 102f54d1867SChris Wilson TP_ARGS(fence) 103f54d1867SChris Wilson ); 104f54d1867SChris Wilson 105f54d1867SChris Wilson DEFINE_EVENT(dma_fence, dma_fence_signaled, 106f54d1867SChris Wilson 107f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 108f54d1867SChris Wilson 109f54d1867SChris Wilson TP_ARGS(fence) 110f54d1867SChris Wilson ); 111f54d1867SChris Wilson 112f54d1867SChris Wilson DEFINE_EVENT(dma_fence, dma_fence_wait_start, 113f54d1867SChris Wilson 114f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 115f54d1867SChris Wilson 116f54d1867SChris Wilson TP_ARGS(fence) 117f54d1867SChris Wilson ); 118f54d1867SChris Wilson 119f54d1867SChris Wilson DEFINE_EVENT(dma_fence, dma_fence_wait_end, 120f54d1867SChris Wilson 121f54d1867SChris Wilson TP_PROTO(struct dma_fence *fence), 122f54d1867SChris Wilson 123f54d1867SChris Wilson TP_ARGS(fence) 124f54d1867SChris Wilson ); 125f54d1867SChris Wilson 126f54d1867SChris Wilson #endif /* _TRACE_DMA_FENCE_H */ 127f54d1867SChris Wilson 128f54d1867SChris Wilson /* This part must be outside protection */ 129f54d1867SChris Wilson #include <trace/define_trace.h> 130