Printing total iova mapped in ptdump sysfs can help debug
memory leaks. If the total keeps increasing, then it is likely
that there is some kind of leak.
sample output:-
root@t186_int:/d/
12000000.iommu/cb000 # cat ptdump
va=0x0000000080000000 pa=0x000000027396e000 *pte=0x006000027396ef43
va=0x0000000080001000 pa=0x000000027396f000 *pte=0x006000027396ff43
total mapped iova=8KB
bug
200182275
Change-Id: Ie6bed9ee954e251a6ee80b41093cd1f577583e1a
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/
1194365
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit
pte_t *pte;
int i, j, k, l;
unsigned long addr = 0;
+ unsigned long mapped = 0;
pgd = cfg->pgd;
for (i = 0; i < PTRS_PER_PGD;
seq_printf(s,
"va=0x%016lx pa=%pap *pte=%pad\n",
addr, &pa, &(*pte));
+ mapped += PAGE_SIZE;
}
}
if ((ulong)pgd != (ulong)pud)
addr += PUD_SIZE;
}
}
+ seq_printf(s, "total mapped iova=%luKB\n", mapped / SZ_1K);
return 0;
}