summaryrefslogtreecommitdiffstats
path: root/lib/libpmc
Commit message (Collapse)AuthorAgeFilesLines
* MFC r290811:jtl2016-01-141-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix hwpmc "stalled" behavior Currently, there is a single pm_stalled flag that tracks whether a performance monitor was "stalled" due to insufficent ring buffer space for samples. However, because the same performance monitor can run on multiple processes or threads at the same time, a single pm_stalled flag that impacts them all seems insufficient. In particular, you can hit corner cases where the code fails to stop performance monitors during a context switch out, because it thinks the performance monitor is already stopped. However, in reality, it may be that only the monitor running on a different CPU was stalled. This patch attempts to fix that behavior by tracking on a per-CPU basis whether a PM desires to run and whether it is "stalled". This lets the code make better decisions about when to stop PMs and when to try to restart them. Ideally, we should avoid the case where the code fails to stop a PM during a context switch out. MFC r290813: Optimizations to the way hwpmc gathers user callchains Changes to the code to gather user stacks: * Delay setting pmc_cpumask until we actually have the stack. * When recording user stack traces, only walk the portion of the ring that should have samples for us. MFC r290929: Change the driver stats to what they really are: unsigned values. 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.) MFC r290930: Improve accuracy of PMC sampling frequency The code tracks a counter which is the number of events until the next sample. On context switch in, it loads the saved counter. On context switch out, it tries to calculate a new saved counter. Problems: 1. The saved counter was shared by all threads in a process. However, this means that all threads would be initially loaded with the same saved counter. However, that could result in sampling more often than once every X number of events. 2. The calculation to determine a new saved counter was backwards. It added when it should have subtracted, and subtracted when it should have added. Assume a single-threaded process with a reload count of 1000 events. Assuming the counter on context switch in was 100 and the counter on context switch out was 50 (meaning the thread has "consumed" 50 more events), the code would calculate a new saved counter of 150 (instead of the proper 50). Fix: 1. As soon as the saved counter is used to initialize a monitor for a thread on context switch in, set the saved counter to the reload count. That way, subsequent threads to use the saved counter will get the full reload count, assuring we sample at least once every X number of events (across all threads). 2. Change the calculation of the saved counter. Due to the change to the saved counter in #1, we simply need to add (modulo the reload count) the remaining counter time we retrieve from the CPU when a thread is context switched out. MFC r291016: Support a wider history counter in pmcstat(8) gmon output pmcstat(8) contains an option to output sampling data in a gmon format compatible with gprof(1). Currently, it uses the default histcounter, which is an (unsigned short). With large sets of sampling data, it is possible to overflow the maximum value provided by an (unsigned short). This change adds the -e argument to pmcstat. If -e and -g are both specified, pmcstat will use a histcounter type of uint64_t. MFC r291017: Fix the date on the pmcstat(8) man page from r291016.
* MFC of r277177 and r279894 with the fixes for the PMC for Haswell.rrs2015-03-241-1/+24
| | | | Sponsored by: Netflix Inc.
* MFC r267062:kib2014-06-181-1/+45
| | | | Disable existing uncore hwpmc code for Nehalem and Westmere EX.
* MFC r263446hiren2014-05-314-1/+560
| | | | | Update hwpmc to support core events for Atom Silvermont microarchitecture. (Model 0x4D as per Intel document 330061-001 01/2014)
* MFC r261342jhibbits2014-03-141-10/+32
| | | | | | | | | | Add hwpmc(4) support for the PowerPC 970 class processors, direct events. 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.
* Always install pmc.foo(3) manpages.uqs2013-05-031-12/+8
| | | | | | | | There is no point in hiding, e.g. pmc.xscale(3) from a developer running on amd64, when the target arch in question will probably never have manual pages installed at all. Reviewed by: sbruno, hiren
* Remove EOL whitespace.joel2013-03-292-156/+156
|
* Update hwpmc to support Haswell class processors.sbruno2013-03-284-0/+1276
| | | | | | | | | | | | 0x3C: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. Submitted by: hiren panchasara <hiren.panchasara@gmail.com> Reviewed by: jimharris, sbruno Obtained from: Yahoo! Inc. MFC after: 2 weeks
* Add missing spacebryanv2013-03-271-1/+1
| | | | MFC after: 3 days
* Add support for good old 8192Hz profiling clock to software PMC.mav2013-02-261-1/+3
| | | | Reviewed by: fabient
* Update hwpmc to support the Xeon class of Ivybridge processors.sbruno2013-01-316-1/+938
| | | | | | | | | | | | | | case 0x3E: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. No support for uncore events at this time. Submitted by: hiren panchasara <hiren.panchasara@gmail.com> Reviewed by: davide, jimharris, sbruno Obtained from: Yahoo! Inc. MFC after: 2 weeks
* Fix a few warnings from newer clang 3.2 in libpmc, about comparing enumdim2012-11-051-2/+2
| | | | | | | | pmc_event values against integer constants which fall outside the enum range. Reviewed by: fabient, sbruno MFC after: 3 days
* Cleanup and rename some variables in libpmc and hwpmc.sbruno2012-10-244-4/+4
| | | | | | | Submitted by: hiren panchasara <hiren.panchasara@gmail.com> Reviewed by: jimharris@ sbruno@ Obtained from: Yahoo! Inc. MFC after: 2 weeks
* Remove trailing whitespace.joel2012-10-191-159/+159
|
* Update man page crossreferences to sandybridge xeon classsbruno2012-10-193-3/+6
| | | | MFC after: 2 weeks
* Update hwpmc to support the Xeon class of Sandybridge processors.sbruno2012-10-193-3/+1048
| | | | | | | | | | | | | | (Model 0x2D /* Per Intel document 253669-044US 08/2012. */) Add manpage to document all the goodness that is available in this processor model. No support for uncore events at this time. Submitted by: hiren panchasara <hiren.panchasara@gmail.com> Reviewed by: jimharris@ fabient@ Obtained from: Yahoo! Inc. MFC after: 2 weeks
* Fix "make install"kientzle2012-10-061-1/+1
| | | | | Also make arm the same as other platforms: Install man pages for all CPUs in the family.
* Remove trailing whitespace.joel2012-09-061-53/+53
|
* Minor mdoc fix.joel2012-09-061-1/+0
|
* Add Intel Ivy Bridge support to hwpmc(9).fabient2012-09-064-52/+1017
| | | | | | | | | | Update offcore RSP token for Sandy Bridge. Note: No uncore support. Will works on Family 6 Model 3a. MFC after: 1 month Tested by: bapt, grehan
* mdoc: minor Bl improvements.joel2012-06-021-9/+13
|
* mdoc: sort prologue macros.joel2012-03-291-1/+1
|
* Remove trailing whitespace per mdoc lint warningeadler2012-03-293-5/+5
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* Add software PMC support.fabient2012-03-2826-26/+234
| | | | | | | | | | | | | New kernel events can be added at various location for sampling or counting. This will for example allow easy system profiling whatever the processor is with known tools like pmcstat(8). Simultaneous usage of software PMC and hardware PMC is possible, for example looking at the lock acquire failure, page fault while sampling on instructions. Sponsored by: NETASQ MFC after: 1 month
* Remove useless Ta macro.joel2012-03-273-14/+14
|
* Remove superfluous paragraph macro.joel2012-03-255-5/+0
|
* Update manual pages for MIPS-related CPUs:gonzo2012-03-253-6/+261
| | | | | | | | - Rename pmc.mips to pmc.mips24k since it covers just one CPU, no whole architecture - Add documetnations for Octeon's PMC counters - Remove CAVEATS section from pmc.mips24k page: PMC for MIPS supports sampling now.
* Add Octeon-related parts to libpmcgonzo2012-03-231-0/+21
|
* Correct a function prototype.jkoshy2012-03-221-1/+1
| | | | Submitted by: "Anders Magnusson" <ragge at ludd.ltu.se>, via joel
* Make reusable part of code have mips prefix, not mips24gonzo2012-03-221-9/+10
|
* Kill EoL whitespaces, and minor lint.pluknet2012-03-022-297/+295
|
* - Add support for the Intel Sandy Bridge microarchitecture (both core and ↵davide2012-03-014-0/+1203
| | | | | | | | | | | uncore counting events) - New manpages with event lists. - Add MSRs for the Intel Sandy Bridge microarchitecture Reviewed by: attilio, brueffer, fabient Approved by: gnn (mentor) MFC after: 3 weeks
* Whitespace cleanup:gjb2012-02-251-151/+220
| | | | | | | | | | o Wrap sentences on to new lines o Rewrap lines where possible while trying to keep the diff to a minimum Found with: textproc/igor MFC after: 1 week X-MFC-With: r232157
* Whitespace cleanup:gjb2012-02-251-15/+19
| | | | | | | | | o Wrap sentences on to new lines o Cleanup trailing whitespace Found with: textproc/igor MFC after: 1 week X-MFC-With: r232157
* Fix various typos in manual pages.gjb2012-02-252-4/+4
| | | | | | Submitted by: amdmi3 PR: 165431 MFC after: 1 week
* Switch the license boilerplates to our standard one.brueffer2012-02-1732-352/+352
| | | | | | | | | | | Advantages: - Reduces the number of different license versions in the tree - Eliminates a typo - Removes some incorrect author attributions due to c/p - Removes c/p error potential for future pmc manpages Approved by: jkoshy, gnn, rpaulo, fabient (copyright holders) MFC after: 1 week
* Update PMC events from October 2011 Intel documentation.fabient2012-01-041-11/+6
| | | | | Submitted by: Davide Italiano <davide.italiano@gmail.com> MFC after: 3 days
* Implement hwpmc counting PMC support for PowerPC G4+ (MPC745x/MPC744x).jhibbits2011-12-241-0/+62
| | | | | | | Sampling is in progress. Approved by: nwhitehorn (mentor) MFC after: 9.0-RELEASE
* In lib/libpmc/libpmc.c, struct pmc_cputype_map's pm_cputype field shoulddim2011-12-161-1/+1
| | | | | | be of type 'enum pmc_cputype', not 'enum pmc_class'. MFC after: 1 week
* Add a flush of the current PMC log buffer before displaying the next top.fabient2011-10-184-1/+21
| | | | | | | | As the underlying block is 4KB if the PMC throughput is low the measurement will be reported on the next tick. pmcstat(8) use the modified flush API to reclaim current buffer before displaying next top. MFC after: 1 month
* - change "is is" to "is" or "it is"eadler2011-10-161-1/+1
| | | | | | | | - change "the the" to "the" Approved by: lstewart Approved by: sahil (mentor) MFC after: 3 days
* Revert last commit: CPUTYPE will be defined hereimp2011-02-111-1/+1
|
* Don't require CPUTYPE to be defined for ARM, but use it if it is.imp2011-02-111-1/+1
|
* Fix manpage markup.uqs2010-11-062-3/+2
|
* mdoc: drop redundant .Pp and .LP callsuqs2010-10-081-1/+0
| | | | They have no effect when coming in pairs, or before .Bl/.Bd
* Fix punctuation and grammar, mostly by ending sentences with a period.gnn2010-10-042-33/+33
| | | | MFC after: 1 day
* Fix invalid class removal when IAF is not the last class.fabient2010-09-051-4/+4
| | | | | | Keep IAF class with 0 PMC and change the alias in libpmc to IAP. MFC after: 1 week
* MFtbemd:imp2010-08-231-2/+2
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki whilejoel2010-08-167-7/+7
| | | | | | translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
* Fix typos and spelling mistakes.joel2010-08-064-8/+8
|
OpenPOWER on IntegriCloud