Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Zoltan Kiss | 2b2b614 | 2013-09-04 21:11:05 +0100 | [diff] [blame] | 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, |
Geert Uytterhoeven | ae7871b | 2016-12-16 14:28:41 +0100 | [diff] [blame] | 15 | enum swiotlb_force swiotlb_force), |
Zoltan Kiss | 2b2b614 | 2013-09-04 21:11:05 +0100 | [diff] [blame] | 16 | |
| 17 | TP_ARGS(dev, dev_addr, size, swiotlb_force), |
| 18 | |
| 19 | TP_STRUCT__entry( |
Geert Uytterhoeven | ae7871b | 2016-12-16 14:28:41 +0100 | [diff] [blame] | 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 ) |
Zoltan Kiss | 2b2b614 | 2013-09-04 21:11:05 +0100 | [diff] [blame] | 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, |
Geert Uytterhoeven | ae7871b | 2016-12-16 14:28:41 +0100 | [diff] [blame] | 41 | __print_symbolic(__entry->swiotlb_force, |
| 42 | { SWIOTLB_NORMAL, "NORMAL" }, |
Geert Uytterhoeven | fff5d99 | 2016-12-16 14:28:42 +0100 | [diff] [blame] | 43 | { SWIOTLB_FORCE, "FORCE" }, |
| 44 | { SWIOTLB_NO_FORCE, "NO_FORCE" })) |
Zoltan Kiss | 2b2b614 | 2013-09-04 21:11:05 +0100 | [diff] [blame] | 45 | ); |
| 46 | |
| 47 | #endif /* _TRACE_SWIOTLB_H */ |
| 48 | |
| 49 | /* This part must be outside protection */ |
| 50 | #include <trace/define_trace.h> |