Skip to content

Commit

Permalink
iommu: Add iommu_error class event to iommu trace
Browse files Browse the repository at this point in the history
iommu_error class event can be enabled to trigger when an iommu
error occurs. This trace event is intended to be called to report the
error information. Trace information includes driver name, device name,
iova, and flags.

iommu_error:io_page_fault

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
  • Loading branch information
Shuah Khan authored and Joerg Roedel committed Sep 25, 2013
1 parent 3a50639 commit 04fa2f7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/iommu/iommu-traces.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(detach_device_from_domain);
/* iommu_map_unmap */
EXPORT_TRACEPOINT_SYMBOL_GPL(map);
EXPORT_TRACEPOINT_SYMBOL_GPL(unmap);

/* iommu_error */
EXPORT_TRACEPOINT_SYMBOL_GPL(io_page_fault);
33 changes: 33 additions & 0 deletions include/trace/events/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,39 @@ DEFINE_EVENT_PRINT(iommu_map_unmap, unmap,
__entry->iova, __entry->size
)
);

DECLARE_EVENT_CLASS(iommu_error,

TP_PROTO(struct device *dev, unsigned long iova, int flags),

TP_ARGS(dev, iova, flags),

TP_STRUCT__entry(
__string(device, dev_name(dev))
__string(driver, dev_driver_string(dev))
__field(u64, iova)
__field(int, flags)
),

TP_fast_assign(
__assign_str(device, dev_name(dev));
__assign_str(driver, dev_driver_string(dev));
__entry->iova = iova;
__entry->flags = flags;
),

TP_printk("IOMMU:%s %s iova=0x%016llx flags=0x%04x",
__get_str(driver), __get_str(device),
__entry->iova, __entry->flags
)
);

DEFINE_EVENT(iommu_error, io_page_fault,

TP_PROTO(struct device *dev, unsigned long iova, int flags),

TP_ARGS(dev, iova, flags)
);
#endif /* _TRACE_IOMMU_H */

/* This part must be outside protection */
Expand Down

0 comments on commit 04fa2f7

Please sign in to comment.