diff options
author | Fabien Thomas <fabient@FreeBSD.org> | 2012-03-28 20:58:30 +0000 |
---|---|---|
committer | Fabien Thomas <fabient@FreeBSD.org> | 2012-03-28 20:58:30 +0000 |
commit | f5f9340b9807d44d200658ba1bbbbbb57ab72e07 (patch) | |
tree | fadff08d26576c3d5c1cef9d47abd784602b237a /usr.sbin/pmcstat | |
parent | 1faacf5d0925fb593d0d5a17dbd3b0d705bdd478 (diff) | |
download | src-f5f9340b9807d44d200658ba1bbbbbb57ab72e07.tar.gz src-f5f9340b9807d44d200658ba1bbbbbb57ab72e07.zip |
Add software PMC support.
New kernel events can be added at various location for sampling or counting.
This will for example allow easy system profiling whatever the processor is
with known tools like pmcstat(8).
Simultaneous usage of software PMC and hardware PMC is possible, for example
looking at the lock acquire failure, page fault while sampling on
instructions.
Sponsored by: NETASQ
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=233628
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r-- | usr.sbin/pmcstat/pmcstat_log.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c index 1a9ddc616ec6..2ac52da58f8a 100644 --- a/usr.sbin/pmcstat/pmcstat_log.c +++ b/usr.sbin/pmcstat/pmcstat_log.c @@ -1491,6 +1491,15 @@ pmcstat_analyze_log(void) pmcstat_string_intern(ev.pl_u.pl_a.pl_evname)); break; + case PMCLOG_TYPE_PMCALLOCATEDYN: + /* + * Record the association pmc id between this + * PMC and its name. + */ + pmcstat_pmcid_add(ev.pl_u.pl_ad.pl_pmcid, + pmcstat_string_intern(ev.pl_u.pl_ad.pl_evname)); + break; + case PMCLOG_TYPE_PROCEXEC: /* @@ -1641,6 +1650,12 @@ pmcstat_print_log(void) ev.pl_u.pl_a.pl_evname, ev.pl_u.pl_a.pl_flags); break; + case PMCLOG_TYPE_PMCALLOCATEDYN: + PMCSTAT_PRINT_ENTRY("allocatedyn","0x%x \"%s\" 0x%x", + ev.pl_u.pl_ad.pl_pmcid, + ev.pl_u.pl_ad.pl_evname, + ev.pl_u.pl_ad.pl_flags); + break; case PMCLOG_TYPE_PMCATTACH: PMCSTAT_PRINT_ENTRY("attach","0x%x %d \"%s\"", ev.pl_u.pl_t.pl_pmcid, |