diff options
| author | Liam Mark <lmark@codeaurora.org> | 2015-06-05 17:10:00 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:12:47 -0700 |
| commit | d85c7f8f7cad50135463a6fd267d2d9a07ced00a (patch) | |
| tree | ed46fc77ef03d607bafb39ab1c4732b9ab98eba9 /include | |
| parent | 85e70599b1508526f2ac314dbeeb76e7981a12f5 (diff) | |
iommu: add ftrace profiling for map and unmap
Add ftrace start and end logging for map, iommu_map_sg and unmap
in order to facilitate performance testing.
Change-Id: I9ddf241ffa6cf519f6abece7b0820640f5ce1975
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/iommu.h | 7 | ||||
| -rw-r--r-- | include/trace/events/iommu.h | 71 |
2 files changed, 77 insertions, 1 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 2d835b7c226d..614363f84b38 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -262,7 +262,12 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova, struct scatterlist *sg, unsigned int nents, int prot) { - return domain->ops->map_sg(domain, iova, sg, nents, prot); + size_t ret; + + trace_map_sg_start(iova, nents); + ret = domain->ops->map_sg(domain, iova, sg, nents, prot); + trace_map_sg_end(iova, nents); + return ret; } extern int iommu_dma_supported(struct iommu_domain *domain, struct device *dev, diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index a8f5c32d174b..4f44a9c4a697 100644 --- a/include/trace/events/iommu.h +++ b/include/trace/events/iommu.h @@ -113,6 +113,20 @@ DEFINE_EVENT(iommu_map_unmap, map, TP_ARGS(iova, paddr, size) ); +DEFINE_EVENT(iommu_map_unmap, map_start, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size) +); + +DEFINE_EVENT(iommu_map_unmap, map_end, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size) +); + DEFINE_EVENT_PRINT(iommu_map_unmap, unmap, TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), @@ -124,6 +138,63 @@ DEFINE_EVENT_PRINT(iommu_map_unmap, unmap, ) ); +DEFINE_EVENT_PRINT(iommu_map_unmap, unmap_start, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size), + + TP_printk("IOMMU: iova=0x%016llx size=0x%x", + __entry->iova, __entry->size + ) +); + +DEFINE_EVENT_PRINT(iommu_map_unmap, unmap_end, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size), + + TP_printk("IOMMU: iova=0x%016llx size=0x%x", + __entry->iova, __entry->size + ) +); + +DECLARE_EVENT_CLASS(iommu_map_sg, + + TP_PROTO(unsigned long iova, unsigned int nents), + + TP_ARGS(iova, nents), + + TP_STRUCT__entry( + __field(u64, iova) + __field(int, nents) + ), + + TP_fast_assign( + __entry->iova = iova; + __entry->nents = nents; + ), + + TP_printk("IOMMU: iova=0x%016llx nents=%u", + __entry->iova, __entry->nents + ) +); + +DEFINE_EVENT(iommu_map_sg, map_sg_start, + + TP_PROTO(unsigned long iova, unsigned int nents), + + TP_ARGS(iova, nents) +); + +DEFINE_EVENT(iommu_map_sg, map_sg_end, + + TP_PROTO(unsigned long iova, unsigned int nents), + + TP_ARGS(iova, nents) +); + DECLARE_EVENT_CLASS(iommu_error, TP_PROTO(struct device *dev, unsigned long iova, int flags), |
