First cut at hwpmc support on MIPS

Joseph Koshy jkoshy at FreeBSD.org
Mon Mar 1 17:32:55 UTC 2010


> FYI, latest patch is here:
> 
> http://people.freebsd.org/~gnn/mipshwpmc_4.diff
> 
> This should address all the issues identified.  I ran a simple test of running ls
> under each event in both system and process modes and that worked like a charm.

These PMCs appear to have the ability to discriminate between 'USER',
'SUPER' and 'KERNEL' CPU modes, but the proposed code in libpmc
does not allow a user to select one or more of these.

[libpmc.c]
+static int
+mips24k_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
+                 struct pmc_op_pmcallocate *pmc_config __unused)
+{
+       switch (pe) {
+       default:
+               break;
+       }
+       
+       return (0);
+}

If you wish to implement these qualifiers, function iaf_allocate_pmc()
in libpmc.c would be useful as a template.  If not, it would be prudent
to add a sentence in the manual page so that users know exactly what is
being measured.

The patch looks fine otherwise.  Nice work!

Koshy


More information about the freebsd-embedded mailing list