Skip to content

Commit a63c357

Browse files
isaacmanjarresjoergroedel
authored andcommitted
iommu/dma: Trace bounce buffer usage when mapping buffers
When commit 82612d6 ("iommu: Allow the dma-iommu api to use bounce buffers") was introduced, it did not add the logic for tracing the bounce buffer usage from iommu_dma_map_page(). All of the users of swiotlb_tbl_map_single() trace their bounce buffer usage, except iommu_dma_map_page(). This makes it difficult to track SWIOTLB usage from that function. Thus, trace bounce buffer usage from iommu_dma_map_page(). Fixes: 82612d6 ("iommu: Allow the dma-iommu api to use bounce buffers") Cc: stable@vger.kernel.org # v5.15+ Cc: Tom Murphy <murphyt7@tcd.ie> Cc: Lu Baolu <baolu.lu@linux.intel.com> Cc: Saravana Kannan <saravanak@google.com> Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com> Link: https://lore.kernel.org/r/20231208234141.2356157-1-isaacmanjarres@google.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent bf9cd9f commit a63c357

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/iommu/dma-iommu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/spinlock.h>
3030
#include <linux/swiotlb.h>
3131
#include <linux/vmalloc.h>
32+
#include <trace/events/swiotlb.h>
3233

3334
#include "dma-iommu.h"
3435

@@ -1156,6 +1157,8 @@ static dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
11561157
return DMA_MAPPING_ERROR;
11571158
}
11581159

1160+
trace_swiotlb_bounced(dev, phys, size);
1161+
11591162
aligned_size = iova_align(iovad, size);
11601163
phys = swiotlb_tbl_map_single(dev, phys, size, aligned_size,
11611164
iova_mask(iovad), dir, attrs);

0 commit comments

Comments
 (0)