summaryrefslogtreecommitdiff
path: root/lib/libpmc
Commit message (Collapse)AuthorAgeFilesLines
* libpmc: add support for POWER8/9 PMCsLeandro Lupori2020-11-051-0/+20
| | | | | | | | | | | This change adds support for POWER8/9 performance counters. Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26113 Notes: svn path=/head/; revision=367391
* Fix a few mandoc issuesGordon Bergling2020-10-092-2/+2
| | | | | | | | | | - skipping paragraph macro: Pp after Sh - sections out of conventional order: Sh EXAMPLES - whitespace at end of input line - normalizing date format Notes: svn path=/head/; revision=366583
* Fix additional memory leak in process_mapfileEric van Gyzen2020-09-171-0/+2
| | | | | | | | | | | | | | Additional Coverity detected memory leak fix. Submitted by: bret_ketchum@dell.com Reported by: Coverity Reviewed by: cem, emaste MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26462 Notes: svn path=/head/; revision=365845
* Use MACHINE_CPUARCH when checking for arm64Andrew Turner2020-09-141-2/+2
| | | | | | | | | | | | | | | Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run on any 64-bit Arm instruction set. This will simplify checks in downstream consumers targeting prototype instruction sets. The only place we check for MACHINE_ARCH == aarch64 is when building the device tree blobs. As these are targeting current generation ISAs. Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D26370 Notes: svn path=/head/; revision=365726
* libpmc: Fix memory leak in process_mapfileEric van Gyzen2020-08-311-0/+3
| | | | | | | | | | | | | | Coverity detected memory leak fix. Submitted by: bret_ketchum@dell.com Reported by: Coverity Reviewed by: cem MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26230 Notes: svn path=/head/; revision=364996
* Add support for Cortex-A76/Neoverse-N1 to hwpmcAndrew Turner2020-08-121-0/+22
| | | | | | | | | | | | | | This adds support for the Cortex-A76 and Neoverse-N1 PMU counters to pmc. While here add more PMCR_IDCODE values and check the implementers code is correct before setting the PMU type. Reviewed by: bz, emaste (looks reasonable to me) Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25959 Notes: svn path=/head/; revision=364153
* libpmc: Use known pmc_cpuid buffer sizeRyan Moeller2020-07-281-17/+7
| | | | | | | | | | | | | | | | | Use the existing PMC_CPUID_LEN to size pmc_cpuid in the kernel and various buffers for reading it in libpmc. This avoids some extra syscalls and malloc/frees. While in here, use strlcpy to copy a user-provided cpuid string instead of memcpy, to make sure we terminate the buffer. Reviewed by: mav MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25679 Notes: svn path=/head/; revision=363630
* Avoid rebuilding libpmc in every incremental rebuildAlex Richardson2020-07-151-3/+7
| | | | | | | | | | | | | Generate libpmc_events.c in a temporary file first and only overwrite it if the files are actually different. This avoids compiling and relinking the different variants of libpmc on every incremental build. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D24784 Notes: svn path=/head/; revision=363216
* Add stepping to the kern.hwpmc.cpuid string on x86.Alexander Motin2020-07-141-3/+3
| | | | | | | | | | | | It follows the equivalent Linux change to be able to differentiate skylakex and cascadelakex, sharing the same model but not stepping. This fixes skylakex handling broken by r363144. MFC after: 6 days Notes: svn path=/head/; revision=363188
* Update AMD Zen1 and add Zen2 events mapping.Alexander Motin2020-07-1320-938/+2025
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=363157
* Minor textual fixes.Alexander Motin2020-07-131-6/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=363144
* Map family 0x5F (Denverton) to goldmont.Alexander Motin2020-04-241-0/+1
| | | | | | | | | According to the 325462-071US document, they should be the same. MFC after: 1 week Notes: svn path=/head/; revision=360269
* Update x86 countersMatt Macy2020-04-0395-6707/+46804
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=359622
* libpmc: Always add the full include path for libpmcstatEmmanuel Vadot2020-03-251-2/+2
| | | | | | | Previously it was only added for aarch64, amd64 and i386 Notes: svn path=/head/; revision=359295
* pmc: Add include path for libpmcstat as it is an internallibEmmanuel Vadot2020-03-251-1/+2
| | | | | | | | Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D24173 Notes: svn path=/head/; revision=359292
* pmc: Add Hygon Dhyana support.Konstantin Belousov2020-02-072-1/+3
| | | | | | | | | | | | | To make the PMC tool pmcstat working properly on Hygon platform, add support for Hygon Dhyana family 18h by using the PMC initialization code path of AMD family 17h. Submitted by: Pu Wen <puwen@hygon.cn> MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23562 Notes: svn path=/head/; revision=357670
* libpmc: jevents: Go ahead and use snprintf(3)Conrad Meyer2020-01-291-6/+3
| | | | | | | | Reported by: Coverity CID: 1391362 Notes: svn path=/head/; revision=357243
* libpmc: jevents: Partial style(9) passConrad Meyer2020-01-291-49/+74
| | | | | | | | Sort headers, move includes up to the top of the file, function return types on their own line; no functional change. Notes: svn path=/head/; revision=357241
* Revert r353140: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it aroundKyle Evans2020-01-141-2/+0
| | | | | | | | | arichardson has an actual fix for the same issue that this was working around; given that we don't build with llvm today, go ahead and revert the workaround in advance. Notes: svn path=/head/; revision=356735
* Tweaks for DIRDEPS_BUILDSimon J. Gerraty2019-12-191-1/+1
| | | | | | | | | | | | | | libmagic only depend on mkmagic if not DIRDEPS_BUILD libpmc fix -I for libpmcstat local.dirdeps.mk be even more careful about adding gnu/lib/csu to DIRDEPS Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D22872 Notes: svn path=/head/; revision=355904
* libpmc: add MIT SPDX tag to header fileEd Maste2019-12-121-0/+1
| | | | | | | | | | | The jevents tool includes a copy of the jsmn json parser which is MIT licensed. Upstream the MIT license appears in the jsmn.c source and a standalone LICENSE file, but the latter is not included in the copy contained in libpmc and the jsmn.h header carried no license information. Add an SPDX tag to clarify the situation. Notes: svn path=/head/; revision=355671
* libpmc: convert s390 events data to proper jsonEd Maste2019-12-1215-15/+15
| | | | Notes: svn path=/head/; revision=355668
* libpmc: convert powerpc event files to proper jsonEd Maste2019-12-1218-1963/+1963
| | | | Notes: svn path=/head/; revision=355667
* libpmc: sort some amdfam17h entries to make valid jsonEd Maste2019-12-122-4/+4
| | | | Notes: svn path=/head/; revision=355666
* libpmc: remove undesired prefix from two s390 countersEd Maste2019-12-122-2/+2
| | | | | | | | | | | Two counters included a prefix 'Counter:###\tName:XXX' in their descriptions that appears to be a leftover from some conversion process. Remove them. Found because a json validator tripped over the tab in the description. Notes: svn path=/head/; revision=355654
* libpmc: build json event support also on arm64Ed Maste2019-12-121-1/+2
| | | | Notes: svn path=/head/; revision=355635
* libpmc: convert arm64 data files to proper jsonEd Maste2019-12-116-124/+124
| | | | | | | | | | | | jevents includes a very permissive json parser that accepts invalid json, of which there are many examples in libpmc (typically extra or missing commas). Convert the arm64 files to proper json so other tools can parse them. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355630
* Update dirdeps.mk and gendirdeps.mkSimon J. Gerraty2019-12-111-0/+8
| | | | | | | | | | | | | | | | | | | The env space consumed by exporting all libc's .meta files left little room for command line, so unexport when done. Update dirdeps.mk to latest and add dirdeps-targets.mk to simplify/update targets/Makefile Makefile changes to go with Makefile.depend changes in D22494 Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22495 Notes: svn path=/head/; revision=355618
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-1/+4
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* libpmc: Forgot regex.hEmmanuel Vadot2019-11-081-0/+1
| | | | | | | | | Reported by: ci MFC after: 1 week X-MFC-With: r354549 Notes: svn path=/head/; revision=354550
* libpmc: Match on the cpuid with a regexEmmanuel Vadot2019-11-081-4/+18
| | | | | | | | | | | The CPUID is, or can be, a regex to be matched. Use regex from libc instead of strcmp Tested-by: gallatin MFC after: 1 week Notes: svn path=/head/; revision=354549
* libpmc: jevents: handle empty descriptoinEd Maste2019-11-041-1/+1
| | | | | | | | | | PR: 241258 Reported by: sigsys @ gmail.com Obtained from: github.com/andikleen/pmu-tools commit bb3c77ed61 MFC after: 3 days Notes: svn path=/head/; revision=354342
* Merge ^/head r352764 through r353315.Dimitry Andric2019-10-081-0/+2
|\ | | | | | | Notes: svn path=/projects/clang900-import/; revision=353316
| * Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it aroundKyle Evans2019-10-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Diff partially stolen from CheriBSD; these bits need -Wl,-z,notext in order to build in an LLVM world. They are needed for all flavors/sizes of MIPS. This will eventually get fixed in LLVM, but it's unclear when. Reported by: arichardson, emaste Differential Revision: https://reviews.freebsd.org/D21696 Notes: svn path=/head/; revision=353140
* | Merge ^/head r352436 through r352536.Dimitry Andric2019-09-191-0/+19
|\| | | | | | | Notes: svn path=/projects/clang900-import/; revision=352537
| * Add support for BERI statcounters.Ruslan Bukin2019-09-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BERI stands for Bluespec Extensible RISC Implementation, based on MIPS. BERI has not implemented standard MIPS perfomance monitoring counters, instead it provides statistical counters. BERI statcounters have a several limitations: - They can't be written - They don't support start/stop operation - None of hardware interrupt is provided on a counter overflow. So make it separate to hwpmc_mips module and support process/system counting mode only. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=352487
* | Another round of attempting to squelch -Wdeprecated-declarations, whichDimitry Andric2019-09-171-0/+3
|/ | | | | | | | | | | | has become very trigger-happy with libc++ 9.0.0. It does not help that gcc's implementation of this warning is even more trigger-happy, in the sense that it already warns on the declaration itself, not when you are using it. This is very annoying with our use of -Wsystem-headers. That should really be disabled for gcc. Notes: svn path=/projects/clang900-import/; revision=352435
* pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot2019-09-051-1/+0
| | | | | | | | | | | | | The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
* pmc: restore "unhalted-cycles" aliasMatt Macy2019-08-151-0/+1
| | | | | | | Reported by: mav@ Notes: svn path=/head/; revision=351104
* Fix warnings with lib/libpmcEnji Cooper2019-04-145-31/+28
| | | | | | | | | | | | | | | | | | | | | | | * Use `MIN` instead of similar hand rolled macro. * Sort headers. * Use `errno.h` instead of `sys/errno.h`. * Wrap the argument to sizeof in parentheses for clarity. * Remove `__BSD_VISIBLE` and `_XOPEN_SOURCE` #defines to mute warnings about incompatible snprintf definitions. This fixes a number of warnings I've been seeing lately in my builds. Sort makefile variables per style.Makefile(9) (`CFLAGS`/`CWARNFLAG.gcc`) and bump `WARNS` to 3. MFC after: 2 weeks Reviewed by: jtl Approved by: jtl (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19851 Notes: svn path=/head/; revision=346196
* Fix deterministic builds by sorting input to fts in jeventsMatt Macy2019-02-051-2/+93
| | | | | | | Reported by: emaste@ Notes: svn path=/head/; revision=343758
* Add aditional counter descriptions to AMD 0x17Matt Macy2018-11-044-16/+8120
| | | | | | | | | Submitted by: Somalapuram Amaranath MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17401 Notes: svn path=/head/; revision=340108
* Fix get_maxfds() in jeventsAlex Richardson2018-10-291-7/+8
| | | | | | | | | | | | | | | | | If RLIM_INFINITY == -1ULL (such as on macOS) the min() call will result in a value of less than 1 being returned. This causes nftw() to fail with EINVAL. While touching this file also fix includes to work on Linux/macOS and don't declare snprintf since it may have different attributes in the system headers there. Reviewed By: mmacy Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17682 Notes: svn path=/head/; revision=339880
* hwpmc: set default rate if event description lacks one / filter rate against ↵Matt Macy2018-09-141-0/+1
| | | | | | | | | | | | | | | | | | misuse Not all event descriptions have a sample rate (such as inst_retired.any) this will restore the legacy behavior of using 65536 in that case. It also prevents accidental API misuse that could lead to panic. PR: 230985 Reported by: markj Reviewed by: markj Approved by: re (gjb) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D16958 Notes: svn path=/head/; revision=338677
* re-enable pmcstat, pmccontrol, and pmcannotate for gcc4 buildsMatt Macy2018-09-141-1/+1
| | | | | | | | | | | | I had disabled building of the aforementioned targets due to warnings breaking tinderbox. This silences the warning and restores them to the build. Reported by: jhibbits Reviewed by: jhibbits Approved by: re (gjb) Notes: svn path=/head/; revision=338676
* Add library and kernel support for AMD Family 17h countersMatt Macy2018-08-144-34/+150
| | | | | | | NB: lacks default sample rate for most counters Notes: svn path=/head/; revision=337735
* pmc amd17h: fix inputs to jeventsMatt Macy2018-08-136-4625/+5
| | | | Notes: svn path=/head/; revision=337730
* Add PMC support for AMD Family CPUsMatt Macy2018-08-136-0/+5549
| | | | Notes: svn path=/head/; revision=337729
* Revert r336773: it removed too much.Warner Losh2018-07-274-0/+202
| | | | | | | | | | r336773 removed all things xscale. However, some things xscale are really armv5. Revert that entirely. A more modest removal will follow. Noticed by: andrew@ Notes: svn path=/head/; revision=336783
* Remove xscale supportWarner Losh2018-07-274-202/+0
| | | | | | | | | | | | | The OLD XSCALE stuff hasn't been useful in a while. The original committer (cognet@) was the only one that had boards for it. He's blessed this removal. Newer XSCALE (GUMSTIX) is for hardware that's quite old. After discussion on arm@, it was clear there was no support for keeping it. Differential Review: https://reviews.freebsd.org/D16313 Notes: svn path=/head/; revision=336773