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