summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pmcstat
diff options
context:
space:
mode:
authorfabient <fabient@FreeBSD.org>2012-03-28 20:58:30 +0000
committerfabient <fabient@FreeBSD.org>2012-03-28 20:58:30 +0000
commit5edfb77dd3a164bb9d2d40c6604faa6c9f3dce15 (patch)
treefadff08d26576c3d5c1cef9d47abd784602b237a /usr.sbin/pmcstat
parent9a7982e5a0267c0421856f3a43a1ae75880058f3 (diff)
downloadFreeBSD-src-5edfb77dd3a164bb9d2d40c6604faa6c9f3dce15.zip
FreeBSD-src-5edfb77dd3a164bb9d2d40c6604faa6c9f3dce15.tar.gz
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
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r--usr.sbin/pmcstat/pmcstat_log.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c
index 1a9ddc6..2ac52da 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,
OpenPOWER on IntegriCloud