diff options
author | Shuah Khan <shuahkh@osg.samsung.com> | 2015-01-16 22:53:17 -0500 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-01-19 09:19:31 -0500 |
commit | db8614d35bb8fc6d032792c801bd5b38ce860f19 (patch) | |
tree | fd3ed8ebd2273d0b0404909c8ca84901ea4d5f79 /include/trace | |
parent | 6fd492fd746d9858a41dc85eef44bd627b809109 (diff) |
iommu: Change trace unmap api to report unmapped size
Currently map and unmap are implemented as events under a
common trace class declaration. The common class forces
trace_unmap() to require a bogus physical address argument
that it doesn't use. Changing unmap to report unmapped size
will provide useful information for debugging. Remove common
map_unmap trace class and change map and unmap into separate
events as opposed to events under the same class to allow for
differences in the reporting information. In addition, map and
unmap are changed to handle size value as size_t instead of int
to match the passed size value and avoid overflow.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/iommu.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index a8f5c32d174b..2c7befb10f13 100644 --- a/include/trace/events/iommu.h +++ b/include/trace/events/iommu.h | |||
@@ -83,7 +83,7 @@ DEFINE_EVENT(iommu_device_event, detach_device_from_domain, | |||
83 | TP_ARGS(dev) | 83 | TP_ARGS(dev) |
84 | ); | 84 | ); |
85 | 85 | ||
86 | DECLARE_EVENT_CLASS(iommu_map_unmap, | 86 | TRACE_EVENT(map, |
87 | 87 | ||
88 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), | 88 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), |
89 | 89 | ||
@@ -92,7 +92,7 @@ DECLARE_EVENT_CLASS(iommu_map_unmap, | |||
92 | TP_STRUCT__entry( | 92 | TP_STRUCT__entry( |
93 | __field(u64, iova) | 93 | __field(u64, iova) |
94 | __field(u64, paddr) | 94 | __field(u64, paddr) |
95 | __field(int, size) | 95 | __field(size_t, size) |
96 | ), | 96 | ), |
97 | 97 | ||
98 | TP_fast_assign( | 98 | TP_fast_assign( |
@@ -101,26 +101,31 @@ DECLARE_EVENT_CLASS(iommu_map_unmap, | |||
101 | __entry->size = size; | 101 | __entry->size = size; |
102 | ), | 102 | ), |
103 | 103 | ||
104 | TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=0x%x", | 104 | TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=%zu", |
105 | __entry->iova, __entry->paddr, __entry->size | 105 | __entry->iova, __entry->paddr, __entry->size |
106 | ) | 106 | ) |
107 | ); | 107 | ); |
108 | 108 | ||
109 | DEFINE_EVENT(iommu_map_unmap, map, | 109 | TRACE_EVENT(unmap, |
110 | 110 | ||
111 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), | 111 | TP_PROTO(unsigned long iova, size_t size, size_t unmapped_size), |
112 | |||
113 | TP_ARGS(iova, paddr, size) | ||
114 | ); | ||
115 | 112 | ||
116 | DEFINE_EVENT_PRINT(iommu_map_unmap, unmap, | 113 | TP_ARGS(iova, size, unmapped_size), |
117 | 114 | ||
118 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), | 115 | TP_STRUCT__entry( |
116 | __field(u64, iova) | ||
117 | __field(size_t, size) | ||
118 | __field(size_t, unmapped_size) | ||
119 | ), | ||
119 | 120 | ||
120 | TP_ARGS(iova, paddr, size), | 121 | TP_fast_assign( |
122 | __entry->iova = iova; | ||
123 | __entry->size = size; | ||
124 | __entry->unmapped_size = unmapped_size; | ||
125 | ), | ||
121 | 126 | ||
122 | TP_printk("IOMMU: iova=0x%016llx size=0x%x", | 127 | TP_printk("IOMMU: iova=0x%016llx size=%zu unmapped_size=%zu", |
123 | __entry->iova, __entry->size | 128 | __entry->iova, __entry->size, __entry->unmapped_size |
124 | ) | 129 | ) |
125 | ); | 130 | ); |
126 | 131 | ||