diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-12-12 08:59:58 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-01-03 08:11:58 -0500 |
commit | da49f6df726ecaaee87757e8b65a560679d32f99 (patch) | |
tree | e17afeec5a4f7aabaf7754288bfba9caafa0d13e /arch | |
parent | 7f26508bbb76ce86aad1130ef6b7f1a4bb7de0c2 (diff) |
AMD IOMMU: add stats counter for completion wait events
Impact: see number of completion wait events in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index f98f70626bc6..b21435748e0d 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -64,6 +64,8 @@ static struct dma_ops_domain *find_protection_domain(u16 devid); | |||
64 | * Initialization code for statistics collection | 64 | * Initialization code for statistics collection |
65 | */ | 65 | */ |
66 | 66 | ||
67 | DECLARE_STATS_COUNTER(compl_wait); | ||
68 | |||
67 | static struct dentry *stats_dir; | 69 | static struct dentry *stats_dir; |
68 | static struct dentry *de_isolate; | 70 | static struct dentry *de_isolate; |
69 | static struct dentry *de_fflush; | 71 | static struct dentry *de_fflush; |
@@ -88,6 +90,8 @@ static void amd_iommu_stats_init(void) | |||
88 | 90 | ||
89 | de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, | 91 | de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, |
90 | (u32 *)&amd_iommu_unmap_flush); | 92 | (u32 *)&amd_iommu_unmap_flush); |
93 | |||
94 | amd_iommu_stats_add(&compl_wait); | ||
91 | } | 95 | } |
92 | 96 | ||
93 | #endif | 97 | #endif |
@@ -249,6 +253,8 @@ static void __iommu_wait_for_completion(struct amd_iommu *iommu) | |||
249 | unsigned status = 0; | 253 | unsigned status = 0; |
250 | unsigned long i = 0; | 254 | unsigned long i = 0; |
251 | 255 | ||
256 | INC_STATS_COUNTER(compl_wait); | ||
257 | |||
252 | while (!ready && (i < EXIT_LOOP_COUNT)) { | 258 | while (!ready && (i < EXIT_LOOP_COUNT)) { |
253 | ++i; | 259 | ++i; |
254 | /* wait for the bit to become one */ | 260 | /* wait for the bit to become one */ |