xref: /openbmc/linux/include/trace/events/swiotlb.h (revision bc5aa3a0)
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM swiotlb
3 
4 #if !defined(_TRACE_SWIOTLB_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_SWIOTLB_H
6 
7 #include <linux/tracepoint.h>
8 
9 TRACE_EVENT(swiotlb_bounced,
10 
11 	TP_PROTO(struct device *dev,
12 		 dma_addr_t dev_addr,
13 		 size_t size,
14 		 int swiotlb_force),
15 
16 	TP_ARGS(dev, dev_addr, size, swiotlb_force),
17 
18 	TP_STRUCT__entry(
19 		__string(	dev_name,	dev_name(dev)	)
20 		__field(	u64,	dma_mask		)
21 		__field(	dma_addr_t,	dev_addr	)
22 		__field(	size_t,	size			)
23 		__field(	int,	swiotlb_force		)
24 	),
25 
26 	TP_fast_assign(
27 		__assign_str(dev_name, dev_name(dev));
28 		__entry->dma_mask = (dev->dma_mask ? *dev->dma_mask : 0);
29 		__entry->dev_addr = dev_addr;
30 		__entry->size = size;
31 		__entry->swiotlb_force = swiotlb_force;
32 	),
33 
34 	TP_printk("dev_name: %s dma_mask=%llx dev_addr=%llx "
35 		"size=%zu %s",
36 		__get_str(dev_name),
37 		__entry->dma_mask,
38 		(unsigned long long)__entry->dev_addr,
39 		__entry->size,
40 		__entry->swiotlb_force ? "swiotlb_force" : "" )
41 );
42 
43 #endif /*  _TRACE_SWIOTLB_H */
44 
45 /* This part must be outside protection */
46 #include <trace/define_trace.h>
47