xref: /openbmc/linux/include/trace/events/swiotlb.h (revision 55eb9a6c)
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 	TP_PROTO(struct device *dev, dma_addr_t dev_addr, size_t size),
12 	TP_ARGS(dev, dev_addr, size),
13 
14 	TP_STRUCT__entry(
15 		__string(dev_name, dev_name(dev))
16 		__field(u64, dma_mask)
17 		__field(dma_addr_t, dev_addr)
18 		__field(size_t, size)
19 		__field(bool, force)
20 	),
21 
22 	TP_fast_assign(
23 		__assign_str(dev_name, dev_name(dev));
24 		__entry->dma_mask = (dev->dma_mask ? *dev->dma_mask : 0);
25 		__entry->dev_addr = dev_addr;
26 		__entry->size = size;
27 		__entry->force = is_swiotlb_force_bounce(dev);
28 	),
29 
30 	TP_printk("dev_name: %s dma_mask=%llx dev_addr=%llx size=%zu %s",
31 		__get_str(dev_name),
32 		__entry->dma_mask,
33 		(unsigned long long)__entry->dev_addr,
34 		__entry->size,
35 		__entry->force ? "FORCE" : "NORMAL")
36 );
37 
38 #endif /*  _TRACE_SWIOTLB_H */
39 
40 /* This part must be outside protection */
41 #include <trace/define_trace.h>
42