Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / include / trace / events / iommu.h
blob99254ed89212b0036c7afecb1fcd318d6cac3b8b
1 /*
2 * iommu trace points
4 * Copyright (C) 2013 Shuah Khan <shuah.kh@samsung.com>
6 */
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM iommu
10 #if !defined(_TRACE_IOMMU_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_IOMMU_H
13 #include <linux/tracepoint.h>
15 struct device;
17 DECLARE_EVENT_CLASS(iommu_group_event,
19 TP_PROTO(int group_id, struct device *dev),
21 TP_ARGS(group_id, dev),
23 TP_STRUCT__entry(
24 __field(int, gid)
25 __string(device, dev_name(dev))
28 TP_fast_assign(
29 __entry->gid = group_id;
30 __assign_str(device, dev_name(dev));
33 TP_printk("IOMMU: groupID=%d device=%s",
34 __entry->gid, __get_str(device)
38 DEFINE_EVENT(iommu_group_event, add_device_to_group,
40 TP_PROTO(int group_id, struct device *dev),
42 TP_ARGS(group_id, dev)
46 DEFINE_EVENT(iommu_group_event, remove_device_from_group,
48 TP_PROTO(int group_id, struct device *dev),
50 TP_ARGS(group_id, dev)
53 DECLARE_EVENT_CLASS(iommu_device_event,
55 TP_PROTO(struct device *dev),
57 TP_ARGS(dev),
59 TP_STRUCT__entry(
60 __string(device, dev_name(dev))
63 TP_fast_assign(
64 __assign_str(device, dev_name(dev));
67 TP_printk("IOMMU: device=%s", __get_str(device)
71 DEFINE_EVENT(iommu_device_event, attach_device_to_domain,
73 TP_PROTO(struct device *dev),
75 TP_ARGS(dev)
78 DEFINE_EVENT(iommu_device_event, detach_device_from_domain,
80 TP_PROTO(struct device *dev),
82 TP_ARGS(dev)
85 TRACE_EVENT(map,
87 TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size),
89 TP_ARGS(iova, paddr, size),
91 TP_STRUCT__entry(
92 __field(u64, iova)
93 __field(u64, paddr)
94 __field(size_t, size)
97 TP_fast_assign(
98 __entry->iova = iova;
99 __entry->paddr = paddr;
100 __entry->size = size;
103 TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=%zu",
104 __entry->iova, __entry->paddr, __entry->size
108 TRACE_EVENT(unmap,
110 TP_PROTO(unsigned long iova, size_t size, size_t unmapped_size),
112 TP_ARGS(iova, size, unmapped_size),
114 TP_STRUCT__entry(
115 __field(u64, iova)
116 __field(size_t, size)
117 __field(size_t, unmapped_size)
120 TP_fast_assign(
121 __entry->iova = iova;
122 __entry->size = size;
123 __entry->unmapped_size = unmapped_size;
126 TP_printk("IOMMU: iova=0x%016llx size=%zu unmapped_size=%zu",
127 __entry->iova, __entry->size, __entry->unmapped_size
131 DECLARE_EVENT_CLASS(iommu_error,
133 TP_PROTO(struct device *dev, unsigned long iova, int flags),
135 TP_ARGS(dev, iova, flags),
137 TP_STRUCT__entry(
138 __string(device, dev_name(dev))
139 __string(driver, dev_driver_string(dev))
140 __field(u64, iova)
141 __field(int, flags)
144 TP_fast_assign(
145 __assign_str(device, dev_name(dev));
146 __assign_str(driver, dev_driver_string(dev));
147 __entry->iova = iova;
148 __entry->flags = flags;
151 TP_printk("IOMMU:%s %s iova=0x%016llx flags=0x%04x",
152 __get_str(driver), __get_str(device),
153 __entry->iova, __entry->flags
157 DEFINE_EVENT(iommu_error, io_page_fault,
159 TP_PROTO(struct device *dev, unsigned long iova, int flags),
161 TP_ARGS(dev, iova, flags)
163 #endif /* _TRACE_IOMMU_H */
165 /* This part must be outside protection */
166 #include <trace/define_trace.h>