提交 8ecaf8f1 编写于 作者: J Joerg Roedel

AMD IOMMU: add statistics about total number of map requests

Impact: see total number of map requests in debugfs
Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
上级 5774f7c5
...@@ -75,6 +75,7 @@ DECLARE_STATS_COUNTER(cross_page); ...@@ -75,6 +75,7 @@ DECLARE_STATS_COUNTER(cross_page);
DECLARE_STATS_COUNTER(domain_flush_single); DECLARE_STATS_COUNTER(domain_flush_single);
DECLARE_STATS_COUNTER(domain_flush_all); DECLARE_STATS_COUNTER(domain_flush_all);
DECLARE_STATS_COUNTER(alloced_io_mem); DECLARE_STATS_COUNTER(alloced_io_mem);
DECLARE_STATS_COUNTER(total_map_requests);
static struct dentry *stats_dir; static struct dentry *stats_dir;
static struct dentry *de_isolate; static struct dentry *de_isolate;
...@@ -112,6 +113,7 @@ static void amd_iommu_stats_init(void) ...@@ -112,6 +113,7 @@ static void amd_iommu_stats_init(void)
amd_iommu_stats_add(&domain_flush_single); amd_iommu_stats_add(&domain_flush_single);
amd_iommu_stats_add(&domain_flush_all); amd_iommu_stats_add(&domain_flush_all);
amd_iommu_stats_add(&alloced_io_mem); amd_iommu_stats_add(&alloced_io_mem);
amd_iommu_stats_add(&total_map_requests);
} }
#endif #endif
...@@ -1229,6 +1231,8 @@ static dma_addr_t __map_single(struct device *dev, ...@@ -1229,6 +1231,8 @@ static dma_addr_t __map_single(struct device *dev,
pages = iommu_num_pages(paddr, size, PAGE_SIZE); pages = iommu_num_pages(paddr, size, PAGE_SIZE);
paddr &= PAGE_MASK; paddr &= PAGE_MASK;
INC_STATS_COUNTER(total_map_requests);
if (pages > 1) if (pages > 1)
INC_STATS_COUNTER(cross_page); INC_STATS_COUNTER(cross_page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册