Commit graph

367 commits

Author SHA1 Message Date
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 9d2ab4a62d Merge head 2014-04-27 08:13:43 +00:00
Hiren Panchasara e8f021a3f7 Update hwpmc to support core events for Atom Silvermont microarchitecture.
(Model 0x4D as per Intel document 330061-001 01/2014)

Tested by:	Olivier Cochard-Labbe <olivier@cochatrd.me>
MFC after:	4 weeks
2014-03-20 20:51:08 +00:00
Justin Hibbits 169dd953b0 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.

MFC after:	1 month
2014-02-01 02:03:50 +00:00
Ryan Stone 9b605dd32e pmc(3) does not document a dependency on <sys/types.h> but <pmc.h>
requires it, so include it explicitly from <pmc.h>.

MFC after:	1 month
2013-11-25 18:31:13 +00:00
Simon J. Gerraty d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Ulrich Spörlein 4bbdf74796 Always install pmc.foo(3) manpages.
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
2013-05-03 08:20:10 +00:00
Simon J. Gerraty 69e6d7b75e sync from head 2013-04-12 20:48:55 +00:00
Joel Dahl 4a121e0748 Remove EOL whitespace. 2013-03-29 08:32:49 +00:00
Sean Bruno cc0c1555d3 Update hwpmc to support Haswell class processors.
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
2013-03-28 19:15:54 +00:00
Bryan Venteicher a83639a2e6 Add missing space
MFC after:	3 days
2013-03-27 07:11:29 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Alexander Motin 1af19ee4a2 Add support for good old 8192Hz profiling clock to software PMC.
Reviewed by:	fabient
2013-02-26 18:13:42 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Sean Bruno 3f929d8cdd Update hwpmc to support the Xeon class of Ivybridge processors.
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
2013-01-31 22:09:53 +00:00
Simon J. Gerraty 7cd2dcf076 Updated/new Makefile.depend 2012-11-08 21:24:17 +00:00
Dimitry Andric f0bbe9aa78 Fix a few warnings from newer clang 3.2 in libpmc, about comparing enum
pmc_event values against integer constants which fall outside the enum
range.

Reviewed by:	fabient, sbruno
MFC after:	3 days
2012-11-05 18:49:21 +00:00
Simon J. Gerraty 23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Sean Bruno cdfd0cc862 Cleanup and rename some variables in libpmc and hwpmc.
Submitted by:	hiren panchasara <hiren.panchasara@gmail.com>
Reviewed by:	jimharris@ sbruno@
Obtained from:	Yahoo! Inc.
MFC after:	2 weeks
2012-10-24 01:26:29 +00:00
Joel Dahl ad2f1898bc Remove trailing whitespace. 2012-10-19 18:30:50 +00:00
Sean Bruno 29f79bb342 Update man page crossreferences to sandybridge xeon class
MFC after:	2 weeks
2012-10-19 17:21:10 +00:00
Sean Bruno fabe02f5f3 Update hwpmc to support the Xeon class of Sandybridge processors.
(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
2012-10-19 17:01:27 +00:00
Tim Kientzle 5847daf4c2 Fix "make install"
Also make arm the same as other platforms:  Install man
pages for all CPUs in the family.
2012-10-06 17:54:42 +00:00
Joel Dahl 4c7c24efe0 Remove trailing whitespace. 2012-09-06 19:24:48 +00:00
Joel Dahl a619d8f7a1 Minor mdoc fix. 2012-09-06 19:14:02 +00:00
Fabien Thomas 1e862e5ad0 Add Intel Ivy Bridge support to hwpmc(9).
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
2012-09-06 13:54:01 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Joel Dahl 9ee2158b55 mdoc: minor Bl improvements. 2012-06-02 08:47:26 +00:00
Joel Dahl f8727698eb mdoc: sort prologue macros. 2012-03-29 06:19:00 +00:00
Eitan Adler 50d675f7a9 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
Fabien Thomas f5f9340b98 Add software PMC support.
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
2012-03-28 20:58:30 +00:00
Joel Dahl 24eb28257a Remove useless Ta macro. 2012-03-27 15:55:56 +00:00
Joel Dahl 41949a1ed5 Remove superfluous paragraph macro. 2012-03-25 12:13:24 +00:00
Oleksandr Tymoshenko e3a078dfed Update manual pages for MIPS-related CPUs:
- 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.
2012-03-25 02:22:32 +00:00
Oleksandr Tymoshenko c2657f80fb Add Octeon-related parts to libpmc 2012-03-23 00:10:21 +00:00
Joseph Koshy 53bad46ed0 Correct a function prototype.
Submitted by:	"Anders Magnusson" <ragge at ludd.ltu.se>, via joel
2012-03-22 19:04:22 +00:00
Oleksandr Tymoshenko 2827d3e138 Make reusable part of code have mips prefix, not mips24 2012-03-22 18:07:44 +00:00
Sergey Kandaurov 4b6c639716 Kill EoL whitespaces, and minor lint. 2012-03-02 05:55:45 +00:00
Davide Italiano 78d763a29b - Add support for the Intel Sandy Bridge microarchitecture (both core and 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
2012-03-01 21:23:26 +00:00
Glen Barber bb374ac283 Whitespace cleanup:
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
2012-02-25 16:02:12 +00:00
Glen Barber 9d496f5ab6 Whitespace cleanup:
o Wrap sentences on to new lines
 o Cleanup trailing whitespace

Found with:	textproc/igor
MFC after:	1 week
X-MFC-With:	r232157
2012-02-25 15:21:43 +00:00
Glen Barber 3102cfe2e2 Fix various typos in manual pages.
Submitted by:	amdmi3
PR:		165431
MFC after:	1 week
2012-02-25 14:31:25 +00:00
Christian Brueffer 026dbd291e Switch the license boilerplates to our standard one.
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
2012-02-17 11:09:51 +00:00
Fabien Thomas ba89031aea Update PMC events from October 2011 Intel documentation.
Submitted by:	Davide Italiano <davide.italiano@gmail.com>
MFC after:	3 days
2012-01-04 07:58:36 +00:00
Justin Hibbits 7b25dcca76 Implement hwpmc counting PMC support for PowerPC G4+ (MPC745x/MPC744x).
Sampling is in progress.

Approved by:	nwhitehorn (mentor)
MFC after:	9.0-RELEASE
2011-12-24 19:34:52 +00:00
Dimitry Andric 562fc14bc9 In lib/libpmc/libpmc.c, struct pmc_cputype_map's pm_cputype field should
be of type 'enum pmc_cputype', not 'enum pmc_class'.

MFC after:	1 week
2011-12-16 00:13:43 +00:00
Fabien Thomas dceed24a7c Add a flush of the current PMC log buffer before displaying the next top.
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
2011-10-18 15:25:43 +00:00
Eitan Adler 36daf0495a - change "is is" to "is" or "it is"
- change "the the" to "the"

Approved by:	lstewart
Approved by:	sahil (mentor)
MFC after:	3 days
2011-10-16 14:30:28 +00:00
Warner Losh 6998f84670 Revert last commit: CPUTYPE will be defined here 2011-02-11 02:34:26 +00:00
Warner Losh 64a5f83e35 Don't require CPUTYPE to be defined for ARM, but use it if it is. 2011-02-11 02:24:04 +00:00
Ulrich Spörlein 9e411c4821 Fix manpage markup. 2010-11-06 10:54:33 +00:00
Ulrich Spörlein 0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
George V. Neville-Neil 51cc3ad710 Fix punctuation and grammar, mostly by ending sentences with a period.
MFC after:	1 day
2010-10-04 14:32:14 +00:00
Fabien Thomas 2aef9dd6d3 Fix invalid class removal when IAF is not the last class.
Keep IAF class with 0 PMC and change the alias in libpmc to IAP.

MFC after:	1 week
2010-09-05 13:31:14 +00:00
Warner Losh 25faff346c MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
Joel Dahl c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Joel Dahl f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Joel Dahl 799162a628 Spelling fixes. 2010-08-03 17:40:09 +00:00
Ulrich Spörlein ef8a3e5cf2 mdoc: remove literal tabs where they don't belong 2010-06-08 16:48:59 +00:00
Fabien Thomas d66caf62a2 Fix memory leak on error.
Found with:	Coverity Prevent(tm)
MFC after:	1 month
2010-06-05 23:00:02 +00:00
Ulrich Spörlein e10c1be450 mdoc cleanup
Garbage collect unused sections, macros and arguments. Fix prologue and
remove empty lines.

Found by: mdocml
2010-06-02 10:20:23 +00:00
Ulrich Spörlein b27f498819 mdoc: Use mdoc macro for the (R) symbol
While here, also drop the unneeded quotes
2010-05-27 13:56:33 +00:00
Ulrich Spörlein 0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Ryan Stone aa1b887b41 When configuring hwpmc to use the EXT_SNOOP event, only send a default cachestate qualifier on the Atom processor. Other Intel processors do not accept a cachestate qualifier and currently hwpmc will return EINVAL if you try to use the EXT_SNOOP event on those processors
Approved by:	jkoshy (mentor)
MFC after:	2 weeks
2010-05-01 21:59:06 +00:00
Ulrich Spörlein aa12cea2cc mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
Fabien Thomas 1fa7f10bac - Support for uncore counting events: one fixed PMC with the uncore
domain clock, 8 programmable PMC.
- Westmere based CPU (Xeon 5600, Corei7 980X) support.
- New man pages with events list for core and uncore.
- Updated Corei7 events with Intel 253669-033US December 2009 doc.
  There is some removed events in the documentation, they have been
  kept in the code but documented in the man page as obsolete.
- Offcore response events can be setup with rsp token.

Sponsored by: NETASQ
2010-04-02 13:23:49 +00:00
Rui Paulo ed11e09daf Finish the much belated Intel XScale hwpmc(4) man page. 2010-03-23 11:33:08 +00:00
George V. Neville-Neil 660df75e8b Add support for hwpmc(4) on the MIPS 24K, 32 bit, embedded processor.
Add macros for properly accessing coprocessor 0 registers that
support performance counters.

Reviewed by:	jkoshy rpaulo fabien imp
MFC after:	1 month
2010-03-03 15:05:58 +00:00
Joseph Koshy bc315bbd5a Bug fix: add a missing initializer.
Submitted by:	Luca Pizzamiglio <luca.pizzamiglio at gmail dot com>
PR:		i386/142742
2010-01-12 17:03:55 +00:00
Ed Schouten daaf575910 Build lib/ with WARNS=6 by default.
Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.

I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.
2010-01-02 09:58:07 +00:00
Rui Paulo 0ce207d2af Intel XScale hwpmc(4) support.
This brings hwpmc(4) support for 2nd and 3rd generation XScale cores.
Right now it's enabled by default to make sure we test this a bit.
When the time comes it can be disabled by default.
Tested on Gateworks boards.

A man page is coming.

Obtained from:	//depot/user/rpaulo/xscalepmc/...
2009-12-23 23:16:54 +00:00
Christian Brueffer cf6c5eebe7 Use our canonical .Dd format.
Submitted by:	Ulrich Spoerlein
2009-11-02 12:35:38 +00:00
Joseph Koshy 791f5d5ba2 Not all Intel Core (TM) CPUs implement PMC_CLASS_IAF fixed-function
counters.  For such CPUs, use an alternate mapping of convenience
names to events supported by PMC_CLASS_IAP programmable counters.

Testing and review by:	fabient
2009-10-24 04:11:40 +00:00
Rui Paulo 45c6072249 Install x86 related man pages on x86 systems only.
Reviewed by:	jkoshy
2009-10-04 10:54:20 +00:00
Joseph Koshy dd1259dafb Use a more appropriate choice of words.
Submitted by:	danfe
2009-08-23 14:48:25 +00:00
Joseph Koshy ef58215868 Use US spellings, fix typos. 2009-08-23 07:32:30 +00:00
Joseph Koshy cbd3e3c8ad Fix typos. 2009-08-23 07:31:10 +00:00
Joseph Koshy 445f22cfe7 Fix a typo. 2009-08-23 07:30:12 +00:00
Joseph Koshy a2cd12e7a0 Fix typos, use American English spellings. 2009-08-23 07:29:34 +00:00
Joseph Koshy 7dfdb5c882 Fix typos. 2009-08-23 07:24:39 +00:00
Joseph Koshy abb0a58ed9 Correct typos. 2009-08-23 06:22:31 +00:00
Joseph Koshy 5dcb8c704e Correct grammar. 2009-08-23 06:19:02 +00:00
Joseph Koshy b53a052da8 Fix a typo.
Reported by:	John McCullough <jmccullo at cs.ucsd.edu>
2009-08-23 05:49:12 +00:00
Joseph Koshy f20a61ffe6 Fix typos.
Reported by:	Harald Servat <redcrash at gmail dot com>
2009-08-23 05:47:33 +00:00
Joseph Koshy 5c9306fd41 Document the fact that some Core2 family CPUs lack fixed-function counters. 2009-06-09 06:36:29 +00:00
Joseph Koshy b47ea38e01 Fix parsing of Core2 event qualifiers.
Submitted by:	Nikola K <laladelausanne at gmail dot com>
2009-06-09 06:34:48 +00:00
Fabien Thomas c2a3620fc3 Allow compile from c++ for libpmc
Approved by:	jkoshy (mentor)
MFC after:	3 days
2009-03-24 22:35:05 +00:00
Jeff Roberson 597979c4b7 - Add support for nehalem/corei7 cpus. This supports all of the core
counters defined in the reference manual.  It does not support the
   'uncore' events.

Reviewed by:	jkoshy
Sponsored by:	Nokia
2009-01-27 07:29:37 +00:00
Joseph Koshy 3c83ff13e9 Document processor errata that affect performance measurement. 2008-12-08 12:28:48 +00:00
Joseph Koshy b4d091f3a4 Fixes for Core2 Extreme support.
Submitted by:	 "Artem Belevich" <artemb at gmail dot com>
2008-12-03 17:30:36 +00:00
Joseph Koshy d95afe050e Update description of an event.
Submitted by:	"Verplanke, Edwin" <edwin dot verplanke at intel dot com>
2008-11-27 09:21:37 +00:00
Joseph Koshy 0cfab8ddc1 - Add support for PMCs in Intel CPUs of Family 6, model 0xE (Core Solo
and Core Duo), models 0xF (Core2), model 0x17 (Core2Extreme) and
  model 0x1C (Atom).

  In these CPUs, the actual numbers, kinds and widths of PMCs present
  need to queried at run time.  Support for specific "architectural"
  events also needs to be queried at run time.

  Model 0xE CPUs support programmable PMCs, subsequent CPUs
  additionally support "fixed-function" counters.

- Use event names that are close to vendor documentation, taking in
  account that:
  - events with identical semantics on two or more CPUs in this family
    can have differing names in vendor documentation,
  - identical vendor event names may map to differing events across
    CPUs,
  - each type of CPU supports a different subset of measurable
    events.

  Fixed-function and programmable counters both use the same vendor
  names for events.  The use of a class name prefix ("iaf-" or
  "iap-" respectively) permits these to be distinguished.

- In libpmc, refactor pmc_name_of_event() into a public interface
  and an internal helper function, for use by log handling code.

- Minor code tweaks: staticize a global, freshen a few comments.

Tested by:	gnn
2008-11-27 09:00:47 +00:00
Joseph Koshy d5ec7b69ec Fix buglets. 2008-11-26 03:48:20 +00:00
Joseph Koshy ebf07c3e19 Correction: these PMCs do not support a "umask" modifier. 2008-11-24 08:14:01 +00:00
Joseph Koshy 0f7668cbae - Document the rules used to determine when spellings of events
are equivalent.
- Reorder text to make the manual page more coherent.
2008-11-24 08:11:33 +00:00
Joseph Koshy 944e20faf5 - Document the class name prefix for these PMCs.
- Document the "anythread" qualifier, available on Atom CPUs.
- Add examples.
2008-11-15 11:34:30 +00:00
Joseph Koshy 0b4dcce33e Tweak -mdoc usage. 2008-11-13 16:32:20 +00:00
Joseph Koshy 9275b7fce8 Document UMASK values, fix errors. 2008-11-13 10:40:13 +00:00
Joseph Koshy f21fb297ad Fix typos, document UMASK values. 2008-11-13 10:21:56 +00:00
Joseph Koshy 63653d3956 Remove duplicates, fix errors and document UMASK values. 2008-11-13 09:53:53 +00:00
Joseph Koshy 6c292c4db6 Document the alternate event names supported for "architectural" PMC events. 2008-11-12 17:43:37 +00:00
Joseph Koshy 06209c4453 Use spellings that are close to vendor documentation. 2008-11-12 17:38:23 +00:00
Joseph Koshy 789140c0e7 - Sparsely number enumerations 'pmc_cputype' and 'pmc_event' in order to
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.
2008-10-09 14:55:45 +00:00
Joseph Koshy 8fb796642a Correct a typo. 2008-10-06 10:34:44 +00:00
Joseph Koshy 243e1539f3 - Add cross-references.
- Tweak -mdoc use.
2008-10-04 12:54:25 +00:00
Joseph Koshy 2eca5e0f76 Add cross-references. 2008-10-04 12:53:08 +00:00
Joseph Koshy 8c3af4f2c2 Cross-reference new manual pages. 2008-10-04 12:44:05 +00:00
Joseph Koshy 72cf78b859 - Cross-reference new manual pages.
- Spell new PMC class names correctly.
2008-10-04 12:35:02 +00:00
Joseph Koshy 7042d3b9da Add manual pages for performance measurement counters present in
Intel Atom(tm), Core(tm) and Core2(tm) CPUs.
2008-10-04 12:27:49 +00:00
Joseph Koshy a8a55dd98f - Document event numbers associated with event names.
- Document an event that was missed out earlier.
- Sort event names alphabetically.
2008-10-02 08:53:06 +00:00
Joseph Koshy f0fbd1c4a6 - Document event numbers.
- Sort event names.
2008-10-02 06:37:33 +00:00
Joseph Koshy 0206ebd3c8 -mdoc tweaks. 2008-10-02 06:21:07 +00:00
Joseph Koshy 8c171bf58c - Document event numbers.
- Correct misspellings of two event names.
2008-10-02 06:15:40 +00:00
Joseph Koshy 624760c7f6 Document event numbers alongside event names.
Requested by:		Arun Sharma <arun at sharma-home dot net>
2008-10-02 04:46:00 +00:00
Joseph Koshy 6455febbea Document changes in behaviour due to sparse CPU numbering support. 2008-09-22 14:31:24 +00:00
Joseph Koshy 624f6965da Keep symbols in sorted order. 2008-09-19 13:21:23 +00:00
Joseph Koshy 0f3866fa5f Improve grammar. 2008-09-18 10:20:35 +00:00
Joseph Koshy 80f30b733b Document new PMC classes, capabilities and CPU kinds.
Improve typography.
2008-09-18 10:16:54 +00:00
Joseph Koshy 48ddc62541 Whitespace fixes. 2008-09-17 04:13:14 +00:00
Joseph Koshy 0b9b757d45 Add event name aliases for Pentium PMCs. 2008-09-17 03:53:37 +00:00
Joseph Koshy 24f2c3f394 Replace PMC-dependent content with references to
the appropriate manual pages.
2008-09-16 16:58:24 +00:00
Joseph Koshy d41debca93 Build and install PMC-dependent manual pages. 2008-09-16 16:57:14 +00:00
Joseph Koshy 7c8e922826 Fix a typo. 2008-09-16 16:53:25 +00:00
Joseph Koshy 2186848edd Move PMC documentation to separate manual pages, one per PMC class. 2008-09-16 16:34:55 +00:00
Joseph Koshy 020247a4d2 Move TSC specific PMC information to its own manual page. 2008-09-16 16:29:41 +00:00
Joseph Koshy 6aa5a19391 Correct an event name alias: event "k7-dc-misses" does not support
a unitmask.
2008-09-16 14:13:03 +00:00
Joseph Koshy bcbe65a85f - Document Pentium and Pentium MMX events.
- Update (c) years and the manual page's date.
2008-03-14 06:22:03 +00:00
Joseph Koshy 484202faab Bring the behaviour of pmc_capabilities() and pmc_width() in line with
documentation: set 'errno' and return -1 in case of an error.

Update (c) years.
2008-03-12 15:51:32 +00:00
Joseph Koshy ef4ba9be47 Describe return values from pmc_ncpu() and pmc_npmc() better. 2008-03-12 15:48:59 +00:00
Joseph Koshy 120da7bd62 Correct a typo. 2008-02-03 06:04:38 +00:00
Joseph Koshy aa342b1f18 Improve style(9) compliance and trim a long text line. 2007-12-07 13:52:51 +00:00
Joseph Koshy c5e73985de Add callchain parsing to -lpmc.
Sponsored by:	FreeBSD Foundation and Google Inc.
2007-12-03 11:15:46 +00:00
Joseph Koshy 0b84422642 Replace a spurious cross-reference to hwpmc(4) with correct text. 2007-12-03 10:59:23 +00:00
Joseph Koshy c89d1cf588 - Add an overview of the pmc(3) API.
- Defer detailed descriptions of individual functions in the API to
  function-specific manual pages.
2007-11-25 06:50:31 +00:00
Joseph Koshy 677d4530c2 Move the following functions into their own manual pages:
- pmc_attach(), pmc_detach().
- pmc_capabilities(), pmc_cpuinfo(), pmc_ncpu(), pmc_npmc(), pmc_pmcinfo(),
  pmc_width().
- pmc_get_driver_stats().
- pmc_get_msr().
- pmc_read(), pmc_rw(), pmc_write().
- pmc_set().
- pmc_start(), pmc_stop().
2007-11-25 06:38:55 +00:00
Joseph Koshy f28834c1a2 - Describe function pmc_init() in its own manual page.
- Describe functions pmc_configure_logfile(), pmc_flush_logfile() and
  pmc_writelog() in their own manual page.
2007-11-25 03:18:42 +00:00
Joseph Koshy fcdeaa0525 Describe convenience functions `pmc_name_of_{capability,class,cputype,
disposition,event,mode,state}' in their own manual page.
2007-11-24 11:05:36 +00:00
Joseph Koshy 115cadfd60 Describe pmc_event_names_of_class() in its own manual page. 2007-11-23 12:30:55 +00:00
Joseph Koshy 1ddf079eed Describe pmc_enable() and pmc_disable() in their own manual page. 2007-11-23 12:21:34 +00:00
Joseph Koshy 8fe4cbb6b7 Describe pmc_allocate() and pmc_release() in their own manual page. 2007-11-23 11:46:08 +00:00
Joseph Koshy d62f5d4e5c Fix a bug in the description of the "p6-div" event. [1]
Update the description of the "p6-div" and "p6-mul" events according
to the "Intel(r) 64 and IA-32 Architectures Software Developers
Manual Volume 3B: System Programming Guide, Part 2, November 2006".

Reported by: 	Harald Servat <redcrash at gmail dot com> [1]
2007-04-12 09:16:54 +00:00
Joseph Koshy 73e2d811e8 Correct a typo in an event name alias.
Reported by: 	Harald Servat <redcrash at gmail dot com>
2007-04-11 04:52:09 +00:00
Joseph Koshy 7aa963e5e5 Clarify memory management rules for pmc_cpuinfo().
Suggested by:	"Harald Servat" <redcrash at gmail dot com>
2007-03-26 17:33:41 +00:00
Ruslan Ermilov a73a3ab56b Markup fixes. 2006-09-17 21:27:35 +00:00
Joseph Koshy 49874f6ea3 MFP4: Support for profiling dynamically loaded objects.
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)
2006-03-26 12:20:54 +00:00
Joseph Koshy d8acba2a3e Update the pmc(3) manual page's date string and freshen the year in the (c) line for
pmc.3 and libpmc.c.
2006-03-20 15:28:59 +00:00
Joseph Koshy 177a2f2245 Add an alias 'unhalted-cycles' denoting cycles where the CPU is
not in a halt or sleep state.
2006-02-25 05:34:00 +00:00
Ruslan Ermilov 3a14548604 Fix prototypes. 2005-11-24 10:54:47 +00:00
Ruslan Ermilov 110e1704d3 -mdoc sweep. 2005-11-17 13:00:00 +00:00
Joseph Koshy 5138c36a1b Add COMPATIBILITY and HISTORY sections.
MFC after:	3 days
2005-07-21 06:44:54 +00:00
Joseph Koshy 79b6b08fd5 Catch with the source code. Sort a list alphabetically. Add a
HISTORY section.

MFC after:	3 days
2005-07-21 06:42:30 +00:00
Christian Brueffer f0ea72a038 - Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them

MFC after:	3 days
2005-07-14 20:29:08 +00:00
Joseph Koshy 82c83e34dd Fix a bug in pmclog_read() that causes it to return with a false
error when a log record crosses an internal buffer boundary.

Approved by:	re (scottl)
2005-07-09 17:12:30 +00:00
Joseph Koshy 86a655492a - Update the CPU version check to recognize P4/EMT64 CPUs. [1]
- Allow libpmc(3) to support P4/EMT64 PMCs on the amd64 architecture
  and AMD K8 PMCs on the i386. [2]

Submitted by:	ps [1]
Pointy hat:	myself [2]
Approved by:	re (scottl)
2005-07-03 16:33:22 +00:00
Joseph Koshy 151392465f MFP4:
- pmcstat(8) gprof output mode fixes:

  lib/libpmc/pmclog.{c,h}, sys/sys/pmclog.h:
  + Add a 'is_usermode' field to the PMCLOG_PCSAMPLE event
  + Add an 'entryaddr' field to the PMCLOG_PROCEXEC event,
    so that pmcstat(8) can determine where the runtime loader
    /libexec/ld-elf.so.1 is getting loaded.

  sys/kern/kern_exec.c:
  + Use a local struct to group the entry address of the image being
    exec()'ed and the process credential changed flag to the exec
    handling hook inside hwpmc(4).

  usr.sbin/pmcstat/*:
  + Support "-k kernelpath", "-D sampledir".
  + Implement the ELF bits of 'gmon.out' profile generation in a new
    file "pmcstat_log.c".  Move all log related functions to this
    file.
  + Move local definitions and prototypes to "pmcstat.h"

- Other bug fixes:
  + lib/libpmc/pmclog.c: correctly handle EOF in pmclog_read().
  + sys/dev/hwpmc_mod.c: unconditionally log a PROCEXIT event to all
    attached PMCs when a process exits.
  + sys/sys/pmc.h: correct a function prototype.
  + Improve usage checks in pmcstat(8).

Approved by:	re (blanket hwpmc)
2005-06-30 19:01:26 +00:00
Ruslan Ermilov 9abe909b54 - Tidy up the markup.
- Clarify the sections on "Cascading P4 PMCs" and
  "Precise Event Based Sampling" (1)
- Bump document date.

Reviewed by:	jkoshy
Submitted by:	jkoshy (1)
Approved by:	re (blanket)
2005-06-24 16:56:24 +00:00
Ruslan Ermilov f711ce99e5 Tidy up the markup.
Reviewed by:	jkoshy
Approved by:	re (blanket)
2005-06-24 16:13:36 +00:00
Joseph Koshy 1455fcd32d Fix tinderbox breakage. 2005-06-10 03:45:04 +00:00
Joseph Koshy f263522a45 MFP4:
- Implement sampling modes and logging support in hwpmc(4).

- Separate MI and MD parts of hwpmc(4) and allow sharing of
  PMC implementations across different architectures.
  Add support for P4 (EMT64) style PMCs to the amd64 code.

- New pmcstat(8) options: -E (exit time counts) -W (counts
  every context switch), -R (print log file).

- pmc(3) API changes, improve our ability to keep ABI compatibility
  in the future.  Add more 'alias' names for commonly used events.

- bug fixes & documentation.
2005-06-09 19:45:09 +00:00
Joseph Koshy c5153e190b Add convenience APIs pmc_width() and pmc_capabilities() to -lpmc.
Have pmcstat(8) and pmccontrol(8) use these APIs.

Return PMC class-related constants (PMC widths and capabilities)
with the OP GETCPUINFO call leaving OP PMCINFO to return only the
dynamic information associated with a PMC (i.e., whether enabled,
owner pid, reload count etc.).

Allow pmc_read() (i.e., OPS PMCRW) on active self-attached PMCs to
get upto-date values from hardware since we can guarantee that the
hardware is running the correct PMC at the time of the call.

Bug fixes:
 - (x86 class processors) Fix a bug that prevented an RDPMC
   instruction from being recognized as permitted till after the
   attached process had context switched out and back in again after
   a pmc_start() call.

   Tighten the rules for using RDPMC class instructions: a GETMSR
   OP is now allowed only after an OP ATTACH has been done by the
   PMC's owner to itself.  OP GETMSR is not allowed for PMCs that
   track descendants, for PMCs attached to processes other than
   their owner processes.

 - (P4/HTT processors only) Fix a bug that caused the MI and MD
   layers to get out of sync.  Add a new MD operation 'get_config()'
   as part of this fix.

 - Allow multiple system-mode PMCs at the same row-index but on
   different CPUs to be allocated.

 - Reject allocation of an administratively disabled PMC.

Misc. code cleanups and refactoring.  Improve a few comments.
2005-05-01 14:11:49 +00:00
Joseph Koshy 67edd22983 Note events affected by processor errata. 2005-04-23 05:45:18 +00:00
Joseph Koshy d56c5d4bec Add event aliases for P6 and K8 PMCs. 2005-04-21 05:50:25 +00:00
Marcel Moolenaar 04e9feb06c o Do not include <machine/pmc_mdep.h>. It's automaticly included for
us when <sys/pmc.h> is included.
o  Replace "#if __i386__" and "#if __amd64__" with the equivalent of
   "#ifdef __i386__" and "#ifdef __amd64__" (resp.) These tokens are
   not defined on all platforms.
o  Conditionally compile pmc_parse_mask() on i386 and amd64 only. It's
   only referenced there. This will change when support for other
   platforms is added, of course.

Ok'd by: jkoshy@
2005-04-20 20:48:24 +00:00
Joseph Koshy c570de2caf Remove extra Id keyword. 2005-04-20 05:36:43 +00:00
Joseph Koshy 90f629a16a Remove superfluous CFLAGS lines. Use the conditional '?=' construct
for WARNS lines.

Submitted by:	ru
2005-04-19 14:43:59 +00:00
Joseph Koshy ebccf1e3a6 Bring a working snapshot of hwpmc(4), its associated libraries, userland utilities
and documentation into -CURRENT.

Bump FreeBSD_version.

Reviewed by:	alc, jhb (kernel changes)
2005-04-19 04:01:25 +00:00