aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 00:02:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 00:02:18 -0500
commit91838e2dab460ba589fb90db0fe1f504f5c04f12 (patch)
tree53974ed7a32ddd63d75e2da63f00d8308eb8d08a /include/trace/events
parentf080480488028bcc25357f85e8ae54ccc3bb7173 (diff)
parentbb51eeee5a947f61eeefaa55221c26460542654d (diff)
Merge tag 'iommu-updates-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU updates from Joerg Roedel: "This time the updates contain: - Tracepoints for certain IOMMU-API functions to make their use easier to debug - A tracepoint for IOMMU page faults to make it easier to get them in user space - Updates and fixes for the new ARM SMMU driver after the first hardware showed up - Various other fixes and cleanups in other IOMMU drivers" * tag 'iommu-updates-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (26 commits) iommu/shmobile: Enable the driver on all ARM platforms iommu/tegra-smmu: Staticize tegra_smmu_pm_ops iommu/tegra-gart: Staticize tegra_gart_pm_ops iommu/vt-d: Use list_for_each_entry_safe() for dmar_domain->devices traversal iommu/vt-d: Use for_each_drhd_unit() instead of list_for_each_entry() iommu/vt-d: Fixed interaction of VFIO_IOMMU_MAP_DMA with IOMMU address limits iommu/arm-smmu: Clear global and context bank fault status registers iommu/arm-smmu: Print context fault information iommu/arm-smmu: Check for num_context_irqs > 0 to avoid divide by zero exception iommu/arm-smmu: Refine check for proper size of mapped region iommu/arm-smmu: Switch to subsys_initcall for driver registration iommu/arm-smmu: use relaxed accessors where possible iommu/arm-smmu: replace devm_request_and_ioremap by devm_ioremap_resource iommu: Remove stack trace from broken irq remapping warning iommu: Change iommu driver to call io_page_fault trace event iommu: Add iommu_error class event to iommu trace iommu/tegra: gart: cleanup devm_* functions usage iommu/tegra: Print phys_addr_t using %pa iommu: No need to pass '0x' when '%pa' is used iommu: Change iommu driver to call unmap trace event ...
Diffstat (limited to 'include/trace/events')
-rw-r--r--include/trace/events/iommu.h162
1 files changed, 162 insertions, 0 deletions
diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h
new file mode 100644
index 000000000000..a8f5c32d174b
--- /dev/null
+++ b/include/trace/events/iommu.h
@@ -0,0 +1,162 @@
1/*
2 * iommu trace points
3 *
4 * Copyright (C) 2013 Shuah Khan <shuah.kh@samsung.com>
5 *
6 */
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM iommu
9
10#if !defined(_TRACE_IOMMU_H) || defined(TRACE_HEADER_MULTI_READ)
11#define _TRACE_IOMMU_H
12
13#include <linux/tracepoint.h>
14#include <linux/pci.h>
15
16struct device;
17
18DECLARE_EVENT_CLASS(iommu_group_event,
19
20 TP_PROTO(int group_id, struct device *dev),
21
22 TP_ARGS(group_id, dev),
23
24 TP_STRUCT__entry(
25 __field(int, gid)
26 __string(device, dev_name(dev))
27 ),
28
29 TP_fast_assign(
30 __entry->gid = group_id;
31 __assign_str(device, dev_name(dev));
32 ),
33
34 TP_printk("IOMMU: groupID=%d device=%s",
35 __entry->gid, __get_str(device)
36 )
37);
38
39DEFINE_EVENT(iommu_group_event, add_device_to_group,
40
41 TP_PROTO(int group_id, struct device *dev),
42
43 TP_ARGS(group_id, dev)
44
45);
46
47DEFINE_EVENT(iommu_group_event, remove_device_from_group,
48
49 TP_PROTO(int group_id, struct device *dev),
50
51 TP_ARGS(group_id, dev)
52);
53
54DECLARE_EVENT_CLASS(iommu_device_event,
55
56 TP_PROTO(struct device *dev),
57
58 TP_ARGS(dev),
59
60 TP_STRUCT__entry(
61 __string(device, dev_name(dev))
62 ),
63
64 TP_fast_assign(
65 __assign_str(device, dev_name(dev));
66 ),
67
68 TP_printk("IOMMU: device=%s", __get_str(device)
69 )
70);
71
72DEFINE_EVENT(iommu_device_event, attach_device_to_domain,
73
74 TP_PROTO(struct device *dev),
75
76 TP_ARGS(dev)
77);
78
79DEFINE_EVENT(iommu_device_event, detach_device_from_domain,
80
81 TP_PROTO(struct device *dev),
82
83 TP_ARGS(dev)
84);
85
86DECLARE_EVENT_CLASS(iommu_map_unmap,
87
88 TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size),
89
90 TP_ARGS(iova, paddr, size),
91
92 TP_STRUCT__entry(
93 __field(u64, iova)
94 __field(u64, paddr)
95 __field(int, size)
96 ),
97
98 TP_fast_assign(
99 __entry->iova = iova;
100 __entry->paddr = paddr;
101 __entry->size = size;
102 ),
103
104 TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=0x%x",
105 __entry->iova, __entry->paddr, __entry->size
106 )
107);
108
109DEFINE_EVENT(iommu_map_unmap, map,
110
111 TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size),
112
113 TP_ARGS(iova, paddr, size)
114);
115
116DEFINE_EVENT_PRINT(iommu_map_unmap, unmap,
117
118 TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size),
119
120 TP_ARGS(iova, paddr, size),
121
122 TP_printk("IOMMU: iova=0x%016llx size=0x%x",
123 __entry->iova, __entry->size
124 )
125);
126
127DECLARE_EVENT_CLASS(iommu_error,
128
129 TP_PROTO(struct device *dev, unsigned long iova, int flags),
130
131 TP_ARGS(dev, iova, flags),
132
133 TP_STRUCT__entry(
134 __string(device, dev_name(dev))
135 __string(driver, dev_driver_string(dev))
136 __field(u64, iova)
137 __field(int, flags)
138 ),
139
140 TP_fast_assign(
141 __assign_str(device, dev_name(dev));
142 __assign_str(driver, dev_driver_string(dev));
143 __entry->iova = iova;
144 __entry->flags = flags;
145 ),
146
147 TP_printk("IOMMU:%s %s iova=0x%016llx flags=0x%04x",
148 __get_str(driver), __get_str(device),
149 __entry->iova, __entry->flags
150 )
151);
152
153DEFINE_EVENT(iommu_error, io_page_fault,
154
155 TP_PROTO(struct device *dev, unsigned long iova, int flags),
156
157 TP_ARGS(dev, iova, flags)
158);
159#endif /* _TRACE_IOMMU_H */
160
161/* This part must be outside protection */
162#include <trace/define_trace.h>