blob: 705be43b71ab06fff70a449f37bff840abbfac28 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Zoltan Kiss2b2b6142013-09-04 21:11:05 +01002#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
10TRACE_EVENT(swiotlb_bounced,
11
12 TP_PROTO(struct device *dev,
13 dma_addr_t dev_addr,
14 size_t size,
Geert Uytterhoevenae7871b2016-12-16 14:28:41 +010015 enum swiotlb_force swiotlb_force),
Zoltan Kiss2b2b6142013-09-04 21:11:05 +010016
17 TP_ARGS(dev, dev_addr, size, swiotlb_force),
18
19 TP_STRUCT__entry(
Geert Uytterhoevenae7871b2016-12-16 14:28:41 +010020 __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 Kiss2b2b6142013-09-04 21:11:05 +010025 ),
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 Uytterhoevenae7871b2016-12-16 14:28:41 +010041 __print_symbolic(__entry->swiotlb_force,
42 { SWIOTLB_NORMAL, "NORMAL" },
Geert Uytterhoevenfff5d992016-12-16 14:28:42 +010043 { SWIOTLB_FORCE, "FORCE" },
44 { SWIOTLB_NO_FORCE, "NO_FORCE" }))
Zoltan Kiss2b2b6142013-09-04 21:11:05 +010045);
46
47#endif /* _TRACE_SWIOTLB_H */
48
49/* This part must be outside protection */
50#include <trace/define_trace.h>