summaryrefslogtreecommitdiff
path: root/lib/libpmc
Commit message (Collapse)AuthorAgeFilesLines
...
* Put in temporary hacks for jevents.Bryan Drewery2018-06-151-3/+5
| | | | | | | | | | - Handle 'make clean' - Don't try building it locally, just fail instead. jevents should really be merged into lib/libpmc/Makefile. Notes: svn path=/head/; revision=335233
* pmc gcc fixupsRyan Libby2018-06-111-0/+1
| | | | | | | | | | | Fix the build of lib/libpmc and usr.sbin/pmc for gcc on amd64. Reviewed by: mmacy Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15723 Notes: svn path=/head/; revision=334957
* libpmc: add missed (uintmax_t) castsMatt Macy2018-06-071-4/+4
| | | | Notes: svn path=/head/; revision=334753
* pmc: convert native to jsonl and track TSC value of samplesMatt Macy2018-06-075-11/+445
| | | | | | | | | | | | | | | | | | - add '-j' options to filter to enable converting native pmc log format to json lines format to enable the use of scripts and external tooling % pmc filter -j pmc.log pmc.jsonl - Record the tsc value in sampling interrupts as opposed to recording nanotime when the sample is copied to a global log in hardclock - potentially many milliseconds later. - At initialize record the tsc_freq and the time of day to give us an offset for translating the tsc values in callchain records Notes: svn path=/head/; revision=334749
* libpmc: simplify lookup by idxMatt Macy2018-06-071-4/+3
| | | | Notes: svn path=/head/; revision=334748
* hwpmc: add summary command and further metadata extensionsMatt Macy2018-06-065-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=334701
* hwpmc: log name->pid, name->tid mappingsMatt Macy2018-06-052-0/+31
| | | | | | | | | | | | | | By logging all threads and processes 'pmc filter' can now filter on process or thread name, relieving the user of the burden of determining which tid or pid was which when the sample was taken. % pmc filter -T if_io_tqg -P nginx pmc.log pmc-iflib.log % pmc filter -x -T idle pmc.log pmc-noidle.log Notes: svn path=/head/; revision=334647
* libpmc: improve arg checkingMatt Macy2018-06-041-7/+12
| | | | Notes: svn path=/head/; revision=334639
* libpmc / stat: use westmere supported counterMatt Macy2018-06-041-1/+1
| | | | Notes: svn path=/head/; revision=334638
* update pmc_pmu_idx_get_by_event signature for !x86Matt Macy2018-06-041-1/+1
| | | | Notes: svn path=/head/; revision=334602
* pmc: add filter commandMatt Macy2018-06-044-47/+74
| | | | | | | | | | | | | | pmc filter allows the user to select event types, threads, and processes from a sample. % pmcstat -S unhalted_core_cycles -S llc-misses -S -S resource_stalls.any -O pmc.log % pmc filter -e llc-misses pmc.log pmc-llc-misses.log % pmc filter -e unhalted_core_cycles -t 100339 pmc.log pmc-core-cycles.log etc... % pmcstat -R pmc-core-cycles.log -G pmc-core-cycles.stacks Notes: svn path=/head/; revision=334601
* hwpmc: ABI fixesMatt Macy2018-06-043-32/+23
| | | | | | | | | | | | | - increase pmc cpuid field from 8 to 12 bits - add cpuid version string to initialize entry in the log so that filter can identify which counter index an event name maps to - GC unused config flags - make fixed counter assignment more robust as well as the changes needed to be properly identified for filter Notes: svn path=/head/; revision=334596
* libpmc: allow substring for list and add function for printing event detailsMatt Macy2018-06-012-3/+49
| | | | Notes: svn path=/head/; revision=334464
* libpmc: Intel doesn't require runtime counter table initMatt Macy2018-06-011-0/+3
| | | | Notes: svn path=/head/; revision=334463
* libpmc/pmu: update aliases tableMatt Macy2018-06-011-12/+6
| | | | Notes: svn path=/head/; revision=334462
* hwpmc: remove unused pre-table driven bits for intelMatt Macy2018-05-311-2097/+1
| | | | | | | | | | | | | | | | | | | Intel now provides comprehensive tables for all performance counters and the various valid configuration permutations as text .json files. Libpmc has been converted to use these and hwpmc_core has been greatly simplified by moving to passthrough of the table values. The one gotcha is that said tables don't support pentium pro and and pentium IV. There's very few users of hwpmc on _amd64_ kernels on new hardware. It is unlikely that anyone is doing low level optimization on 15 year old Intel hardware. Nonetheless, if someone feels strongly enough to populate the corresponding tables for p4 and ppro I will reinstate the files in to the build. Code for the K8 counters and !x86 architectures remains unchanged. Notes: svn path=/head/; revision=334456
* libpmc/pmu: enable for i386 as wellMatt Macy2018-05-312-5/+5
| | | | Notes: svn path=/head/; revision=334455
* libpmc: add pmu support for uncore eventsMatt Macy2018-05-311-4/+20
| | | | Notes: svn path=/head/; revision=334454
* libpmc: squelch valgrind warningsMatt Macy2018-05-301-1/+2
| | | | Notes: svn path=/head/; revision=334371
* libpmc: bring pmu_util closer in line with style(9)Matt Macy2018-05-301-39/+73
| | | | Notes: svn path=/head/; revision=334369
* libpmc: silence scan-build warningsMatt Macy2018-05-292-3/+4
| | | | Notes: svn path=/head/; revision=334354
* pmc_annotate: adhere to the APIEric van Gyzen2018-05-291-1/+2
| | | | | | | | | | If the 'mode' parameter was invalid, pmc_annotate() would return EINVAL instead of setting errno and returning -1. Sponsored by: Dell EMC Notes: svn path=/head/; revision=334351
* libpmc: don't return -1 on success in pmc_allocateMatt Macy2018-05-291-1/+1
| | | | Notes: svn path=/head/; revision=334349
* libpmc: don't leak string in error case eitherMatt Macy2018-05-291-4/+5
| | | | | | | Reported by: vangyzen@ Notes: svn path=/head/; revision=334347
* libpmc: remove fixed counter diagnosticMatt Macy2018-05-291-3/+1
| | | | Notes: svn path=/head/; revision=334346
* libpmc: free allocated string on return from pmc_allocateMatt Macy2018-05-291-0/+1
| | | | | | | | Reported by: Coverity CID: 1391359 Notes: svn path=/head/; revision=334345
* libpmc: add support for using fixed function countersMatt Macy2018-05-291-3/+39
| | | | Notes: svn path=/head/; revision=334313
* libpmc: export names of counters for stat mode, make get_by_idx name ↵Matt Macy2018-05-293-4/+27
| | | | | | | consistent with others Notes: svn path=/head/; revision=334312
* pmc(3)/hwpmc(4): update supported Intel processors to rely fully on theMatt Macy2018-05-26242-28/+111819
| | | | | | | | | | | | | | | | | | vendor provided pmu-events tables and sundry cleanups. The vendor pmu-events tables provide counter descriptions, default sample rates, event, umask, and flag values for all the counter configuration permutations. Using this gives us: - much simpler kernel code for the MD component - helpful long and short event descriptions - simpler user code - sample rates that won't overload the system Update man page with newer sample types and remove unused sample type. Notes: svn path=/head/; revision=334244
* Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely ↵Matt Macy2018-05-26242-111819/+28
| | | | | | | | | fully on the" because of squash commit messages Notes: svn path=/head/; revision=334243
* pmc(3)/hwpmc(4): update supported Intel processors to rely fully on theMatt Macy2018-05-26242-28/+111819
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vendor provided pmu-events tables and sundry cleanups. The vendor pmu-events tables provide counter descriptions, default sample rates, event, umask, and flag values for all the counter configuration permutations. Using this gives us: - much simpler kernel code for the MD component - helpful long and short event descriptions - simpler user code - sample rates that won't overload the system Update man page with newer sample types and remove unused sample type. Squashed commit of the following: commit 4459d43eff815bec08ccc5533dbe5de846f03128 Author: Matt Macy <mmacy@mattmacy.io> Date: Sat May 26 00:06:31 2018 -0700 libpmc: fix pmu function signatures for non amd64 commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:38:11 2018 -0700 pmcstat: fix indentation of usage commit f686954b15ff56a833ac80404898977cb80a265b Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:19:49 2018 -0700 pmclog(3): add callchain and pmcallocatedyn, remove pcsample commit 73e13a0d2e9498c81c150d14d022050cee7511bb Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:19:00 2018 -0700 pmclog.h: GC pcsample field commit 3e93ffd65da641fa657539dad3c48e281f8b5798 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:05:57 2018 -0700 hwpmc: make Intel core CPUs use external event tables commit 634f5fae1e1644ac324003136c66cd9c619d1c93 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:00:06 2018 -0700 pmclog: update log record types, bump PMC_MAJOR - explicitly make log record types a multiple of 8 bytes - hook in pmu event types for pmc_allocate records - remove references to no longer PCSAMPLE record commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 21:52:10 2018 -0700 libpmc: add support for having vendor table driven pmc_allocate commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 19:11:33 2018 -0700 hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user commit 859dceb93daa6419a48c794db99b6758e5b041c9 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 19:09:45 2018 -0700 pmcstat: update usage and man page as well as make -L consistent with pmccontrol commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 18:07:03 2018 -0700 pmu_util: add support for all current intel event keywords commit d8089c7f6a6c8527f38324252b1ffb47004694c6 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 17:45:00 2018 -0700 add description for new arguments commit 058336740bab53c62ec88a3a026ea848cf3878c6 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 17:38:15 2018 -0700 libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate commit 049b66b382e2f833c3f47bc8df9e750cb265709f Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:12:41 2018 -0700 pmcstat: hook pmu_events counter description utility routines in commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:11:59 2018 -0700 pmu_events: add utility routines for listing counters and their descriptions commit cba4d4f8907f772279f86f18f915e0d74d33ac56 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:09:50 2018 -0700 pmu-events: expand out skylake regex to simplify string matches Notes: svn path=/head/; revision=334242
* hwpmc: add thread id field to callchain and context switch records to allow ↵Matt Macy2018-05-232-0/+9
| | | | | | | | | | | | | | | filtering on thread in post-processing. To generate stacks for just ${THREADID}: pmcstat -R ${PREFIX}.pmcstat -L ${THREADID} -z100 -G ${PREFIX}.stacks Sponsored by: Limelight Networks Notes: svn path=/head/; revision=334108
* Fix pmcstat exit from kernel introduced by r325275.Fabien Thomas2018-01-171-0/+2
| | | | | | | | | | | | | pmcstat request for close will generate a close event. This event will be in turn received by pmcstat to close the file. Reviewed by: kib Tested by: pho MFC after: 1 week Sponsored by: Stormshield Notes: svn path=/head/; revision=328087
* Replace the PMC class struct copy with an explicit memcpy()Justin Hibbits2018-01-131-1/+2
| | | | | | | | | | | | | This should be effectively a nop for all archs, but for some reason the codegen difference on the PowerPC 970 is such that the struct assignment doesn't work (unless a printf() using one of the elements in the copied struct follows it), while the memcpy() succeeds. On all archs the memcpy() should be expanded to an inline copy, since the copy is bounded to ~16 bytes. MFC after: 3 weeks Notes: svn path=/head/; revision=327911
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-265-0/+10
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Skylake server core PMC support for hwpmc(4).Konstantin Belousov2017-09-061-1/+23
| | | | | | | | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation Hardware provided by: Intel MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12221 Notes: svn path=/head/; revision=323230
* Minor style changes to make forthcoming code stand out less.Konstantin Belousov2017-09-061-5/+6
| | | | | | | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D12221 Notes: svn path=/head/; revision=323229
* Don't end up manpage titles with a full stop.Edward Tomasz Napierala2017-05-241-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=318816
* pmc_read(3): fix manlint errorEnji Cooper2017-04-071-1/+1
| | | | | | | | | | Remove spurious trailing comma from last .Nm entry in NAME section. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316602
* pmc.atomsilvermont(3): fix manlint warningsEnji Cooper2017-04-071-43/+45
| | | | | | | | | | | | | Start new sentences on new lines. Sentences affected by the change are wrapped at <80 columns. Other potentially offending lines have been left alone to reduce churn. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316601
* pmc(3): add additional references for libpmc functions in the SEE ALSO sectionEnji Cooper2017-04-071-1/+14
| | | | | | | | | | | These functions are already referenced throughout the manpage -- this makes their presence more apparent. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316600
* Fix typo.Edward Tomasz Napierala2017-04-031-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=316468
* lib: minor spelling fixes in comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298896
* MFHGlen Barber2016-03-021-0/+1
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296318
| * Connect pmc.haswellxeon(3) to the build; looks like it was missed in r279829.Edward Tomasz Napierala2016-03-011-0/+1
| | | | | | | | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=296263
* | First pass through library packaging.Glen Barber2016-02-041-0/+1
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* Add support for Intel Skylake and Intel Broadwell PMC's. The Broadwell PMC's ↵Randall Stewart2015-11-301-1/+117
| | | | | | | | | | | | | | | have been tested on the Broadwell-Xeon with a hacked up version of pmcstudy -T. I still need to circle back and add in to pmcstudy all the new tests from the Broadwell Vtune guide (for the hacked up version I just made it so I could run the -T option). The Skylake CPU is not yet available (even though Intel is advertising it .. imagine that). The Skylake PMC's will need to be tested once we can get a sample skylake CPU :-) Sponsored by: Netflix Inc. Notes: svn path=/head/; revision=291494
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.Bryan Drewery2015-11-251-1/+0
| | | | | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291307
* Change the driver stats to what they really are: unsigned values.Jonathan T. Looney2015-11-161-8/+9
| | | | | | | | | | | | | | When pmcstat exits after some samples were dropped, give the user an idea of how many were lost. (Granted, these are global numbers, but they may still help quantify the scope of the loss.) Differential Revision: https://reviews.freebsd.org/D4123 Approved by: gnn (mentor) MFC after: 1 month Sponsored by: Juniper Networks Notes: svn path=/head/; revision=290929