summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a number of style issues in the MALLOC / FREE commit. I've tried todes2008-10-232-15/+13
| | | | | be careful not to fix anything that was already broken; the NFSv4 code is particularly bad in this respect.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-236-55/+50
| | | | MFC after: 3 months
* - Sparsely number enumerations 'pmc_cputype' and 'pmc_event' in order tojkoshy2008-10-091-443/+373
| | | | | | | | | | | reduce ABI disruptions when new cpu types and new PMC events are added in the future. - Support alternate spellings for PMC events. Derive the canonical spelling of an event name from its enumeration name in 'enum pmc_event'. - Provide a way for users to disambiguate between identically named events supported by multiple classes of PMCs in a CPU. - Change libpmc's machine-dependent event specifier parsing code to better support CPUs containing two or more classes of PMC resources.
* Rework pmc-dependent flag handling.jkoshy2008-10-091-14/+22
|
* Correct a typo.jkoshy2008-10-061-1/+1
|
* Fix a typo.jkoshy2008-10-041-1/+1
|
* Correct misspellings.jkoshy2008-10-021-2/+2
|
* Support sparsely numbered CPUs.jkoshy2008-09-224-71/+77
| | | | Requested by: obrien, alfred (long ago)
* Correct a callchain capture bug on the i386.jkoshy2008-09-151-3/+3
| | | | | | | | | | | | | On the i386 architecture, the processor only saves the current value of `%esp' on stack if a privilege switch is necessary when entering the interrupt handler. Thus, `frame->tf_esp' is only valid for an entry from user mode. For interrupts taken in kernel mode, we need to determine the top-of-stack for the interrupted kernel procedure by adding the appropriate offset to the current frame pointer. Reported by: kris, Fabien Thomas Tested by: Fabien Thomas <fabien.thomas at netasq dot com>
* - Provide kernelname as the name for process with P_KTHREAD set asjeff2008-07-251-1/+5
| | | | | | | otherwise their textvp is NULL. Reviewed by: jkoshy Sponsored by: Nokia
* Sign-extend the 48-bit AMD PMC counter before treating it to a 64-bitadrian2008-03-181-5/+8
| | | | | | | | | | | | | | 2's compliment. The 2's compliment transform is done so a "count down" sampling interval can be converted into a "count up" PMC value. a 2's complimented 'count down' value is written to the PMC counter; then the read-back counter is reverted via another 2's compliment. PR: kern/121660 Reviewed by: jkoshy Approved by: jkoshy MFC after: 1 week
* Fix the debugging output - the '0x' was duplicated from the %p option.adrian2008-03-181-1/+1
|
* Correct a typo.jkoshy2008-03-141-2/+6
|
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-131-4/+2
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-101-1/+1
| | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* Add stub functions to unbreak LINT.jkoshy2007-12-074-0/+80
|
* Kernel and hwpmc(4) support for callchain capture.jkoshy2007-12-076-112/+547
| | | | Sponsored by: FreeBSD Foundation and Google Inc.
* Revert revision 1.4.jkoshy2007-11-291-1/+1
| | | | | | | | | | Intel CPUs with family 0x6, model 0xE and later (i.e., Intel Core(TM)) have a PMC architecture that differs somewhat from previous CPUs in family 0x6. Even though the basic programming model is similar, the documented set of legal values that may be loaded into their PMC MSRs differs from that of the previous PMCs in family 0x6 and reusing bit values valid for the older PMCs could result in undefined behaviour in the general case.
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-2/+2
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Commit 14/14 of sched_lock decomposition.jeff2007-06-051-6/+6
| | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Fix witness(4) warnings about mutex use.jkoshy2007-04-193-20/+30
| | | | | | | | | | | | | | | | | | Group mutexes used in hwpmc(4) into 3 "types" in the sense of witness(4): - leaf spin mutexes---only one of these should be held at a time, so these mutexes are specified as belonging to a single witness type "pmc-leaf". - `struct pmc_owner' descriptors are protected by a spin mutex of witness type "pmc-owner-proc". Since we call wakeup_one() while holding these mutexes, the witness type of these mutexes needs to dominate that of "sleepq chain" mutexes. - logger threads use a sleep mutex, of type "pmc-sleep". Submitted by: wkoszek (earlier patch)
* Use pause() rather than tsleep() on stack variables and function pointers.jhb2007-02-271-4/+4
|
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-7/+12
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Declare security and security.bsd sysctl hierarchies in sysctl.h alongrwatson2006-09-171-2/+0
| | | | | | | | with other commonly used sysctl name spaces, rather than declaring them all over the place. MFC after: 1 month Sponsored by: nCircle Network Security, Inc.
* First pass at removing Alpha kernel support.jhb2006-05-111-40/+0
|
* Change msleep() and tsleep() to not alter the calling thread's priorityjhb2006-04-171-8/+1
| | | | | | | | | | | | if the specified priority is zero. This avoids a race where the calling thread could read a snapshot of it's current priority, then a different thread could change the first thread's priority, then the original thread would call sched_prio() inside msleep() undoing the change made by the second thread. I used a priority of zero as no thread that calls msleep() or tsleep() should be specifying a priority of zero anyway. The various places that passed 'curthread->td_priority' or some variant as the priority now pass 0.
* Fix a cut-n-paste bug that crept in.jkoshy2006-04-111-2/+2
| | | | Reported by: "Pawel Worach" pawel.worach at gmail.com
* Add support for Intel cpu model's 5 & 6.ps2006-04-041-1/+1
| | | | Approved by: jkoshy
* Forcibly turn off all PMCs at module unload time.jkoshy2006-03-281-0/+6
| | | | MFC after: 1 week
* MFP4: Support for profiling dynamically loaded objects.jkoshy2006-03-262-16/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel changes: Inform hwpmc of executable objects brought into the system by kldload() and mmap(), and of their removal by kldunload() and munmap(). A helper function linker_hwpmc_list_objects() has been added to "sys/kern/kern_linker.c" and is used by hwpmc to retrieve the list of currently loaded kernel modules. The unused `MAPPINGCHANGE' event has been deprecated in favour of separate `MAP_IN' and `MAP_OUT' events; this change reduces space wastage in the log. Bump the hwpmc's ABI version to "2.0.00". Teach hwpmc(4) to handle the map change callbacks. Change the default per-cpu sample buffer size to hold 32 samples (up from 16). Increment __FreeBSD_version. libpmc(3) changes: Update libpmc(3) to deal with the new events in the log file; bring the pmclog(3) manual page in sync with the code. pmcstat(8) changes: Introduce new options to pmcstat(8): "-r" (root fs path), "-M" (mapfile name), "-q"/"-v" (verbosity control). Option "-k" now takes a kernel directory as its argument but will also work with the older invocation syntax. Rework string handling in pmcstat(8) to use an opaque type for interned strings. Clean up ELF parsing code and add support for tracking dynamic object mappings reported by a v2.0.00 hwpmc(4). Report statistics at the end of a log conversion run depending on the requested verbosity level. Reviewed by: jhb, dds (kernel parts of an earlier patch) Tested by: gallatin (earlier patch)
* When deconfiguring a log, only stop PMCs that are in the RUNNINGjkoshy2006-03-181-1/+2
| | | | state.
* When compiled with -DDEBUG, only print the old value of a PMC in ajkoshy2006-03-161-1/+1
| | | | | | | | | debugging message if the flag PMC_F_OLDVALUE was specified in the PMC_OP_RW request being acted upon. This should fix Coverity bug CID 671. Found by: Coverity Prevent MFC after: 3 weeks
* When a process is de-configuring a log file, also stop all of itsjkoshy2006-03-092-5/+8
| | | | | | | | PMCs that require a log file to operate. This change should fix PR 90269. PR: kern/90269 MFC after: 1 week
* Fix a memory leak.jkoshy2006-01-171-5/+7
| | | | Found by: Coverity
* - Plug a memory leak: free up per-cpu sample buffers at module unload time.jkoshy2005-12-261-3/+14
| | | | - Correct a few style nits.
* Wrap comment lines to be under 80 characters wide.jkoshy2005-12-261-2/+3
| | | | MFC after: 3 days
* Fix -Wundef warnings found when compiling i386 LINT, GENERIC andru2005-12-054-27/+27
| | | | custom kernels.
* Add support for a new/unreleased Pentium-M.ps2005-11-181-1/+1
| | | | Reviewed by: jkoshy
* Bug fix initialization on multi-core HTT CPUs.jkoshy2005-10-101-46/+59
| | | | | Reported by: ps Tested by: ps
* Process one NMI interrupt per handler invocation as the processorjkoshy2005-09-121-4/+9
| | | | | | | | 'buffers' pending NMIs from multiple interrupting PMCs and delivers them serially. Reported by: Olivier Crameri <olivier.crameri@epfl.ch> MFC after: 3 days
* Re-enable sampling on the AMD64.jkoshy2005-08-271-5/+0
|
* On x86 processors, turn off any 'INTERRUPT' capabilities on PMCsjkoshy2005-08-221-3/+13
| | | | | | if the CPU does not have its local APIC enabled. MFC after: 3 days
* Return EOPNOTSUPP instead of EINVAL if a PMC allocation requestjkoshy2005-08-221-1/+15
| | | | | | | | specifies a PMC capability (e.g., sampling) that is not supported by hardware. Return EINVAL early if the PMC class passed in is not recognized. MFC after: 3 days
* Print PMC capabilities at module load time.jkoshy2005-08-221-3/+9
| | | | MFC after: 3 days
* Turn off sampling modes on the AMD64 till the time I can track downjkoshy2005-08-221-0/+5
| | | | | | the reason for the double fault seen when sampling under load. MFC after: 3 days
* Fail the module loading process if the currently executing kerneljkoshy2005-07-301-0/+12
| | | | | | | | was not compiled with 'options HWPMC_HOOKS' or if the compiled-in version numbers of the kernel and module are out of sync. Reported by: cracauer MFC after: 3 days
* Use LK_CANRECURSE since when a PMC-owning process performs an exec,jkoshy2005-07-171-1/+1
| | | | | | the new text vnode is already locked by itself. MFC after: 3 days
* Convert the atomic_ptr() operations over to operating on uintptr_tjhb2005-07-151-1/+2
| | | | | | | | | | variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm
* Fix breakage introduced in rev 1.7.jkoshy2005-07-141-1/+1
| | | | MFC after: 3 days
* sys/dev/hwpmc/hwpmc_{amd,piv,ppro}.c:jkoshy2005-07-095-34/+44
| | | | | | | | | | | | | | | | | | - Update driver interrupt statistics correctly. sys/sys/pmc.h, sys/dev/hwpmc/hwpmc_mod.c: - Fix a bug affecting debug printfs. - Move the 'stalled' flag from being in a bit in the 'pm_flags' field of a 'struct pmc' to a field of its own in the same structure. This flag is updated from the NMI handler and keeping it separate makes it easier to avoid races with other parts of the code. sys/dev/hwpmc/hwpmc_logging.c: - Do arithmetic with 'uintptr_t' types rather that casting to and from 'char *'. Approved by: re (scottl)
OpenPOWER on IntegriCloud