1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/lib/libpmc
Matt Macy b2ca2e50b9 hwpmc: add summary command and further metadata extensions
metadata changes:
- log pmc sample rate with pmcallocate
- log proc flags with thread / process logging
  to identify user vs kernel threads

fixes:
- use log cpuid to translate event id to event name

Implement rudimentary summary command to track sample
counts by thread and process name within a pmc log.

% make -j4 buildkernel >& /dev/null &
% sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15
% pmc summary foo
cpu_clk_unhalted.thread_p_any:
        idle: 138108207162
        clang-6.0: 105336158004
        sh: 72340108510
        make: 8642012963
        kernel: 7754011631
longest_lat_cache.miss:
        clang-6.0: 87502625
        sh: 40901227
        make: 5500165
        kernel: 3300099
        awk: 2000060

%  pmc summary -f ~/foo
idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003
idle: 69054
clang-6.0: 52668
sh: 36170
make: 4321
kernel: 3877
hwpmc: proc(7445): 3319
awk: 1289
xargs: 357
rand_harvestq: 181
mtree: 102
intr: 53
zfskern: 31
usb: 7
pagedaemon: 4
ntpd: 3
syslogd: 1
acpi_thermal: 1
logger: 1
syncer: 1
snmptrapd: 1
sleep: 1
idx: 17 name: longest_lat_cache.miss rate: 100003
clang-6.0: 875
sh: 409
make: 55
kernel: 33
awk: 20
hwpmc: proc(7445): 14
xargs: 9
idle: 8
intr: 3
zfskern: 2
2018-06-06 02:48:09 +00:00
..
pmu-events pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the 2018-05-26 19:29:19 +00:00
libpmc_pmu_util.c hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00
libpmc.c hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00
libpmcinternal.h lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
Makefile libpmc/pmu: enable for i386 as well 2018-05-31 22:26:55 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pmc_allocate.3
pmc_attach.3
pmc_capabilities.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmc_configure_logfile.3
pmc_disable.3
pmc_event_names_of_class.3 Don't end up manpage titles with a full stop. 2017-05-24 21:02:53 +00:00
pmc_get_driver_stats.3
pmc_get_msr.3
pmc_init.3
pmc_name_of_capability.3
pmc_read.3 pmc_read(3): fix manlint error 2017-04-07 06:06:55 +00:00
pmc_set.3
pmc_start.3
pmc.3 pmc(3): add additional references for libpmc functions in the SEE ALSO section 2017-04-07 05:46:45 +00:00
pmc.atom.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.atomsilvermont.3 pmc.atomsilvermont(3): fix manlint warnings 2017-04-07 06:00:19 +00:00
pmc.core2.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.core.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.corei7.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmc.corei7uc.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmc.h hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00
pmc.haswell.3 Fix typo. 2017-04-03 20:35:17 +00:00
pmc.haswelluc.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.haswellxeon.3 Minor mdoc fixes. 2015-04-20 21:19:26 +00:00
pmc.iaf.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.ivybridge.3 Fix Ivy Bridge+ MEM_UOPS_RETIRED counters 2015-03-10 01:24:08 +00:00
pmc.ivybridgexeon.3 Fix Ivy Bridge+ MEM_UOPS_RETIRED counters 2015-03-10 01:24:08 +00:00
pmc.k7.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.k8.3 mdoc: remove superfluous paragraph macros. 2014-06-23 18:40:21 +00:00
pmc.mips24k.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.octeon.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.p4.3 mdoc: remove superfluous paragraph macros. 2014-06-23 18:40:21 +00:00
pmc.p5.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.p6.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.sandybridge.3 Fix Sandy Bridge+ hwpmc branch counters 2015-03-10 01:23:47 +00:00
pmc.sandybridgeuc.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.sandybridgexeon.3 Fix Sandy Bridge+ hwpmc branch counters 2015-03-10 01:23:47 +00:00
pmc.soft.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmc.tsc.3 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
pmc.ucf.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmc.westmere.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmc.westmereuc.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmc.xscale.3 mdoc: sort SEE ALSO. 2015-01-04 12:38:00 +00:00
pmclog.3 pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the 2018-05-26 19:29:19 +00:00
pmclog.c hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00
pmclog.h hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00