summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc
Commit message (Collapse)AuthorAgeFilesLines
* Implement hwpmc(4) for Freescale e500 core.jhibbits2015-04-186-4/+837
| | | | | | | | This supports e500v1, e500v2, and e500mc. Tested only on e500v2, but the performance counters are identical across all, with e500mc having some additional events. Relnotes: Yes
* hwpmc: add initial Intel Broadwell support.rpaulo2015-04-053-1/+24
| | | | | | | The full list of aliases and events will follow in a subsequent commit. MFC after: 1 month
* Remove whitespace.rpaulo2015-04-051-9/+9
|
* Add support for the MIPS74K SoC family performance counters events.adrian2015-04-052-0/+397
| | | | | | | | | | | | | | | | | | | | | | | | | These are similar to the mips24k performance counters - some are available on perfcnt0/3, some are available on perfcnt1/4. However, the events aren't all the same. * Add the events, named the same as from Linux oprofile. * Verify they're the same as "MIPS32(R) 74KTM Processor Core Family Software User's Manual"; Document Number: MD00519; Revision 01.05. * Rename INSTRUCTIONS to something else, so it doesn't clash with the alias INSTRUCTIONS. I'll try to tidy this up later; there are a few other aliases to add and shuffle around. Tested: * QCA9558 SoC (AP135 board) - MIPS74Kc core (no FPU.) * make universe; where it didn't fail for other reasons. TODO: * It'd be nice to support the four performance counters in at least this hardware, rather than just two. Reviewed by: bsdimp ("looks good; don't break world".)
* Remove all the handcrafted assembly in hwpmc_armv7.c and use thebz2015-03-281-109/+21
| | | | | | | | | | | | common (autogenerated) versions. Removes extra vertical space, and makes it easier to grep for usage throughout the tree. Conditionally compile only for arm6 [1] (yes sounds odd but is right). Submitted by: andrew [1] Reviewed by: gnn, andrew (ian earlier version I think) Differential Revision: https://reviews.freebsd.org/D2159 Obtained from: Cambridge/L41 Sponsored by: DARPA, AFRL
* Rather than defining our own magic checks here use INKERNEL() forbz2015-03-271-0/+1
| | | | | | | | | | | the PMC_IN_KERNEL() macro definition. Add missing macros to extract the return address (LR) from the trapframe. Discussed with: andrew Obtained from: Cambridge/L41 Sponsored by: DARPA, AFRL MFC after: 2 weeks
* hwpmc: Fix event number to match enum namerstone2015-03-121-2/+2
| | | | | | Differential revision: https://reviews.freebsd.org/D1592 Reviewed by: Joseph Kong MFC after: 1 month
* You need to have the capabilities and not skip it if you arerrs2015-03-111-4/+3
| | | | | | | | | not on head.. otherwise the file pointer will be NULL and when you try to do something with it you will crash. Make the #else be the old capabilites, and then remove the erroneous ifdefs for 11. MFC after: 1 week (with the other MFC I was going to do until the panic)
* Add missing counter definitionsrstone2015-03-101-1/+6
| | | | | | Differential Revision: https://reviews.freebsd.org/D1591 MFC after: 1 month Sponsored by: Sandvine Inc
* Fix Ivy Bridge+ MEM_UOPS_RETIRED countersrstone2015-03-102-56/+38
| | | | | | | | | | | | | The MEM_UOPS_RETIRED actually work the same way as the Sandy Bridge counters, but the counters were documented in a different way and that seemed to cause the Ivy Bridge counters to be implemented incorrectly. Use the same counter definitions as Sandy Bridge. While I'm here, rename the counters to match what's documented in the datasheet. Differential Revision: https://reviews.freebsd.org/D1590 MFC after: 1 month Sponsored by: Sandvine Inc.
* Support architectural events on Haswell/Ivy Bridgerstone2015-03-101-0/+4
| | | | | | Differential Revision: https://reviews.freebsd.org/D1589 MFC after: 1 month Sponsored by: Sandvine Inc
* Fix Sandy Bridge+ hwpmc branch countersrstone2015-03-102-121/+134
| | | | | | | | | | | | | | | | | On Sandy Bridge and later, to count branch-related events you have to or together a mask indicating the type of branch instruction to count (e.g. direct jump, branch, etc) and a bits indicating whether to count taken and not-taken branches. The current counter definitions where defining this bits individually, so the counters never worked and always just counted 0. Fix the counter definitions to instead contain the proper combination of masks. Also update the man pages to reflect the new counters. Differential Revision: https://reviews.freebsd.org/D1587 MFC after: 1 month Sponsored by: Sandvine Inc.
* Fix pmc unit restrictions to match documentationrstone2015-03-101-2/+2
| | | | | | | | | | A couple of pmc counters did not work because there were being restricted to the wrong PMC unit. I've verified that these counters now work and match the documented restrictions. Differential Revision: https://reviews.freebsd.org/D1586 MFC after: 1 month Sponsored by: Sandvine Inc
* Fix various bugs in Haswell counter definitionsrstone2015-03-101-6/+6
| | | | | | | | | 1) The "WALK_COMPLETED_2M_4M" event incorrectly referenced 4K pages. 2) The umask for RING0 and RING123 events was reversed. Differential Revision: https://reviews.freebsd.org/D1585 MFC after: 1 month Sponsored by: Sandvine Inc
* The cpu_id macro was renamed in r278529, catch up with this new name.andrew2015-02-111-1/+1
|
* Add ARMv7 performance monitoring counters.br2015-01-284-3/+766
| | | | | | Differential Revision: https://reviews.freebsd.org/D1687 Reviewed by: rpaulo Sponsored by: DARPA, AFRL
* style(9) cleanuprstone2015-01-222-15/+26
|
* Update the hwpmc driver to have the new type HASWELL_XEON. Alsorrs2015-01-148-263/+609
| | | | | | | | | | | | | | | go back through HASWELL, IVY_BRIDGE, IVY_BRIDGE_XEON and SANDY_BRIDGE to straighten out all the missing PMCs. We also add a new pmc tool pmcstudy, this allows one to run the various formulas from the documents "Using Intel Vtune Amplifier XE on XXX Generation platforms" for IB/SB and Haswell. The tool also allows one to postulate your own formulas with any of the various PMC's. At some point I will enahance this to work with Brendan Gregg's flame-graphs so we can flamegraph various PMC interactions. Note the manual page also needs some work (lots of work) but gnn has committed to help me with that ;-) Reviewed by: gnn MFC after:1 month Sponsored by: Netflix Inc.
* Fix hwpmc sampling for ppc970 (G5-class) processors.jhibbits2014-11-271-17/+11
| | | | | | | With this, hwpmc sampling now works on these processors. MFC after: 3 weeks Relnotes: yes
* Fix hwpmc sampling for MPC74xxx (G4) processors.jhibbits2014-11-271-13/+11
| | | | | | | With this, hwpmc sampling now works correctly on these processors. MFC after: 3 weeks Relnotes: yes
* Clamp too-large hwpmc callchaindepth to the maximumemaste2014-11-201-2/+3
| | | | | | | If the depth requested by the user is too large, it's better to provide the maximum than the smaller default. Sponsored by: The FreeBSD Foundation
* Fix up module unload for syscall_module_handler consumers.mjg2014-11-011-1/+2
| | | | | | | | After r273707 it was registering syscalls as static. This fixes hwpmc module unload. Reported by: markj
* Use pmc_destroy_pmc_descriptor() to actually free the pmc, which ismarkj2014-10-171-13/+9
| | | | | | | | | | consistent with pmc_destroy_owner_descriptor(). Also be sure to destroy PMCs if a process exits or execs without explicitly releasing them. Reviewed by: bz, gnn MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D958
* Since introducing the extra mapping in r250103 for architectural performancebz2014-10-071-1/+1
| | | | | | | | | | | events we have actually counted 'Branch Instruction Retired' when people asked for 'Unhalted core cycles' using the 'unhalted-core-cycles' event mask mnemonic. Reviewed by: jimharris Discussed with: gnn, rwatson MFC after: 3 days Sponsored by: DARPA/AFRL
* Fix PowerPC backtraces. Since kernel and user have completely separate addressjhibbits2014-09-141-13/+27
| | | | | | | | spaces, rather than a split address, we actually can't check for being within the kernel's address range. Instead, do what other backtraces do, and use trapexit()/asttrapexit() as the stack sentinel. MFC after: 3 weeks
* Remove ia64.marcel2014-07-071-66/+0
| | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
* Fix a bug in hwpmc(4) callchain retrieval, for both user and kernel.jhibbits2014-07-031-9/+13
| | | | | | | | | The array index for the callchain is getting double-incremented -- both in the loop and the storing. It should only be incremented in one location. Also, constrain the stack pointer range check. MFC after: 2 weeks
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-282-15/+8
|
* Revert r267961, r267973:gjb2014-06-272-8/+15
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-272-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* For Xeon 7500 and 48XX (Nehalem EX and Westmere EX) variants of thekib2014-06-042-2/+17
| | | | | | | | | | | | | | Core i7 and Westmere processors, the uncore PMC subsystem is completely different from the uncore PMC on smaller versions of CPUs. Disable existing uncore hwpmc code for EX, otherwise non-existing MSRs are accessed. The cores PMCs seems to be identical for non-EX and EX, according to the SDM. Reviewed by: davide, fabient Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Add missing Ivy Bridge and Haswell events.gnn2014-06-021-0/+3
| | | | | Submitted by: Anton Rang <rang@mac.com> MFC: 2 weeks
* Remove some prototypes for undefined functions.markj2014-05-152-4/+0
| | | | MFC after: 3 days
* Enable and disable the PMC unit at load/unload time, respectively.jhibbits2014-04-182-0/+8
| | | | MFC after: 3 weeks
* Update hwpmc to support core events for Atom Silvermont microarchitecture.hiren2014-03-203-37/+202
| | | | | | | (Model 0x4D as per Intel document 330061-001 01/2014) Tested by: Olivier Cochard-Labbe <olivier@cochatrd.me> MFC after: 4 weeks
* Update kernel inclusions of capability.h to use capsicum.h instead; somerwatson2014-03-161-1/+1
| | | | | | | | further refinement is required as some device drivers intended to be portable over FreeBSD versions rely on __FreeBSD_version to decide whether to include capability.h. MFC after: 3 weeks
* Fix pointer type in call to malloceadler2014-03-131-1/+1
| | | | Submitted by: Meyer, Conrad conrad.meyer@isilon.com
* Fix pointer type in call to malloceadler2014-03-131-1/+1
| | | | Submitted by: Meyer, Conrad conrad.meyer@isilon.com
* Use correct types for sizeof() in the calculations for the malloc(9) sizes [1].kib2014-03-121-2/+1
| | | | | | | While there, remove unneeded checks for failed allocations with M_WAITOK flag. Submitted by: Conrad Meyer <cemeyer@uw.edu> [1] MFC after: 1 week
* Fix callchain capture for hwpmc(4). While here, some style(9) fixes, too.jhibbits2014-02-271-4/+24
| | | | MFC after: 2 weeks
* Add hwpmc(4) support for the PowerPC 970 class processors, direct events.jhibbits2014-02-015-17/+771
| | | | | | | | | | | This also fixes asserts on removal of the module for the mpc74xx. The PowerPC 970 processors have two different types of events: direct events and indirect events. Thus far only direct events are supported. I included some documentation in the driver on how indirect events work, but support is for the future. MFC after: 1 month
* MPC74xx should not fall through, to the error case.jhibbits2014-01-251-0/+1
| | | | MFC after: 1 week
* Move <machine/apicvar.h> to <x86/apicvar.h>.jhb2014-01-235-5/+5
|
* Add another Haswell model (0x45) to the set of supported chips.gnn2013-12-201-0/+1
| | | | | Model 0x45 appears, for example, in late 2013 Mac Book Pro models and is properly emulated by VMware.
* o Remove assertions on ipa_version as sometimes the version detectionattilio2013-12-203-18/+21
| | | | | | | | | | using cpuid can be quirky (this is the case of VMWare without the vPMC support) but fail to probe hwpmc. o Apply the fix for XEON family of processors as established by 315338-020 document (bug AJ85). Sponsored by: EMC / Isilon storage division Reviewed by: fabient
* Add userland PMC backtracing, and use the PMC trapframe macros for kerneljhibbits2013-12-141-7/+18
| | | | | | backtraces. MFC after: 1 week
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-11-301-1/+1
| | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva
* Remove local change leftover, this should never have been part ofdavide2013-09-201-2/+0
| | | | | | | r255745. Pointy-hat to: davide Approved by: re (implicit)
* Fix lc_lock/lc_unlock() support for rmlocks held in shared mode. Withdavide2013-09-201-0/+2
| | | | | | | | | | | | | | | current lock classes KPI it was really difficult because there was no way to pass an rmtracker object to the lock/unlock routines. In order to accomplish the task, modify the aforementioned functions so that they can return (or pass as argument) an uinptr_t, which is in the rm case used to hold a pointer to struct rm_priotracker for current thread. As an added bonus, this fixes rm_sleep() in the rm shared case, which right now can communicate priotracker structure between lc_unlock()/lc_lock(). Suggested by: jhb Reviewed by: jhb Approved by: re (delphij)
* Fix the build.jhibbits2013-09-051-0/+2
|
OpenPOWER on IntegriCloud