4 * Copyright (C) 2013 Shuah Khan <shuah.kh@samsung.com>
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>
17 DECLARE_EVENT_CLASS(iommu_group_event
,
19 TP_PROTO(int group_id
, struct device
*dev
),
21 TP_ARGS(group_id
, dev
),
25 __string(device
, dev_name(dev
))
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
),
60 __string(device
, dev_name(dev
))
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
),
78 DEFINE_EVENT(iommu_device_event
, detach_device_from_domain
,
80 TP_PROTO(struct device
*dev
),
87 TP_PROTO(unsigned long iova
, phys_addr_t paddr
, size_t size
),
89 TP_ARGS(iova
, paddr
, size
),
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
110 TP_PROTO(unsigned long iova
, size_t size
, size_t unmapped_size
),
112 TP_ARGS(iova
, size
, unmapped_size
),
116 __field(size_t, size
)
117 __field(size_t, unmapped_size
)
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
),
138 __string(device
, dev_name(dev
))
139 __string(driver
, dev_driver_string(dev
))
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>