iommu/tegra: smmu: debugfs for TLB/PTC statistics
authorHiroshi Doyu <hdoyu@nvidia.com>
Thu, 2 Aug 2012 08:46:40 +0000 (11:46 +0300)
committerJoerg Roedel <joerg.roedel@amd.com>
Fri, 3 Aug 2012 15:53:55 +0000 (17:53 +0200)
commit39abf8aa7dfad0badb4741373023cda369aacc8e
treeb1e845941ab5a29f4907922a6406d2db13bc38e5
parent0d7614f09c1ebdbaa1599a5aba7593f147bf96ee
iommu/tegra: smmu: debugfs for TLB/PTC statistics

Add debugfs entries to collect TLB/PTC statistics.

  $ echo "reset" > /sys/kernel/debug/smmu/mc/{tlb,ptc}
  $ echo "on" > /sys/kernel/debug/smmu/mc/{tlb,ptc}
  $ echo "off" > /sys/kernel/debug/smmu/mc/{tlb,ptc}
  $ cat /sys/kernel/debug/smmu/mc/{tlb,ptc}
  hit:0014910c miss:00014d22

  The above format is:
  hit:<HIT count><SPC>miss:<MISS count><SPC><CR+LF>

  fscanf(fp, "hit:%lx miss:%lx", &hit, &miss);

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/tegra-smmu.c