xref: /openbmc/linux/include/trace/events/swiotlb.h (revision b78412b8)
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 		 enum swiotlb_force 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(	enum swiotlb_force,	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 		__print_symbolic(__entry->swiotlb_force,
41 			{ SWIOTLB_NORMAL,	"NORMAL" },
42 			{ SWIOTLB_FORCE,	"FORCE" },
43 			{ SWIOTLB_NO_FORCE,	"NO_FORCE" }))
44 );
45 
46 #endif /*  _TRACE_SWIOTLB_H */
47 
48 /* This part must be outside protection */
49 #include <trace/define_trace.h>
50