freebsd-dev/usr.sbin/pmcstat
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
..
Makefile pmcstat(8): unbreak build with LDFLAGS+=-Wl,--as-needed 2017-11-03 00:12:32 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pmcpl_annotate_cg.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_annotate_cg.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_annotate.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_annotate.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_callgraph.c hwpmc: support sampling both kernel and user stacks when interrupted in kernel 2018-06-04 01:10:23 +00:00
pmcpl_callgraph.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_calltree.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_calltree.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_gprof.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcpl_gprof.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcstat_log.c pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the 2018-05-26 19:29:19 +00:00
pmcstat_log.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcstat_top.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pmcstat.8 hwpmc: support sampling both kernel and user stacks when interrupted in kernel 2018-06-04 01:10:23 +00:00
pmcstat.c hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00
pmcstat.h libpmcstat: compile in events based on json description 2018-05-24 04:30:06 +00:00