diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2010-12-22 08:57:30 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-03-14 11:17:11 -0400 |
commit | 2222e71bd6eff7b2ad026d4ee663b6327c5a49f5 (patch) | |
tree | 4c6f6c29e0d879ea0222a7294fa8c03b6af8ce24 /arch/x86/xen/mmu.c | |
parent | 68df0da7f42be6ae017fe9f48ac414c43a7b9d32 (diff) |
xen/debugfs: Add 'p2m' file for printing out the P2M layout.
We walk over the whole P2M tree and construct a simplified view of
which PFN regions belong to what level and what type they are.
Only enabled if CONFIG_XEN_DEBUG_FS is set.
[v2: UNKN->UNKNOWN, use uninitialized_var]
[v3: Rebased on top of mmu->p2m code split]
[v4: Fixed the else if]
Reviewed-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r-- | arch/x86/xen/mmu.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 9c9e07615139..b13b6ca9052a 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
47 | #include <linux/gfp.h> | 47 | #include <linux/gfp.h> |
48 | #include <linux/memblock.h> | 48 | #include <linux/memblock.h> |
49 | #include <linux/seq_file.h> | ||
49 | 50 | ||
50 | #include <asm/pgtable.h> | 51 | #include <asm/pgtable.h> |
51 | #include <asm/tlbflush.h> | 52 | #include <asm/tlbflush.h> |
@@ -2367,6 +2368,18 @@ EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); | |||
2367 | 2368 | ||
2368 | #ifdef CONFIG_XEN_DEBUG_FS | 2369 | #ifdef CONFIG_XEN_DEBUG_FS |
2369 | 2370 | ||
2371 | static int p2m_dump_open(struct inode *inode, struct file *filp) | ||
2372 | { | ||
2373 | return single_open(filp, p2m_dump_show, NULL); | ||
2374 | } | ||
2375 | |||
2376 | static const struct file_operations p2m_dump_fops = { | ||
2377 | .open = p2m_dump_open, | ||
2378 | .read = seq_read, | ||
2379 | .llseek = seq_lseek, | ||
2380 | .release = single_release, | ||
2381 | }; | ||
2382 | |||
2370 | static struct dentry *d_mmu_debug; | 2383 | static struct dentry *d_mmu_debug; |
2371 | 2384 | ||
2372 | static int __init xen_mmu_debugfs(void) | 2385 | static int __init xen_mmu_debugfs(void) |
@@ -2422,6 +2435,7 @@ static int __init xen_mmu_debugfs(void) | |||
2422 | debugfs_create_u32("prot_commit_batched", 0444, d_mmu_debug, | 2435 | debugfs_create_u32("prot_commit_batched", 0444, d_mmu_debug, |
2423 | &mmu_stats.prot_commit_batched); | 2436 | &mmu_stats.prot_commit_batched); |
2424 | 2437 | ||
2438 | debugfs_create_file("p2m", 0600, d_mmu_debug, NULL, &p2m_dump_fops); | ||
2425 | return 0; | 2439 | return 0; |
2426 | } | 2440 | } |
2427 | fs_initcall(xen_mmu_debugfs); | 2441 | fs_initcall(xen_mmu_debugfs); |