In pfm_pmu_register(), the check for virtual read-only PMDs is not very
intuitive. Since we've already checked if the PMD is virtual, just add a
check under that if statement to see if the PMD is also read-only.
Obviously this is just a coding style issue, but Carl and I both got tripped
up a couple times trying to understand when the pmd_sread and pmd_swrite
routines are required. I think this helps make that a bit clearer. And it
also eliminates a few instructions (not that this code path is performance
sensitive).
Signed-off-by: Kevin Corry <[EMAIL PROTECTED]>
Signed-off-by: Carl Love <[EMAIL PROTECTED]>
Index: linux-2.6.20-arnd3-perfmon4/perfmon/perfmon_pmu.c
===================================================================
--- linux-2.6.20-arnd3-perfmon4.orig/perfmon/perfmon_pmu.c
+++ linux-2.6.20-arnd3-perfmon4/perfmon/perfmon_pmu.c
@@ -275,14 +275,14 @@ int pfm_pmu_register(struct pfm_pmu_conf
if (type & PFM_REG_I)
num_pmds++;
- if (type & PFM_REG_V)
+ if (type & PFM_REG_V) {
nspec++;
+ if (type & PFM_REG_RO)
+ nspec_ro++;
+ }
if (type & PFM_REG_WC)
num_wc++;
-
- if ((type & (PFM_REG_V|PFM_REG_RO)) == (PFM_REG_V|PFM_REG_RO))
- nspec_ro++;
}
if (num_wc && cfg->pmd_write_check == NULL) {
_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/