aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pmcstat/pmcstat.8
Commit message (Collapse)AuthorAgeFilesLines
* The exec(2) man page does not exist; refer to execve(2) which does.Jens Schweikhardt2025-04-191-4/+4
|
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* pmcstat(8): Drop .UdMitchell Horne2023-07-101-4/+2
| | | | | | | | | | | This utility has existed for a long time and should not be advertised as "currently under development". While here, fix the one other warning from igor about using a newline for a new sentence. MFC after: 3 days Sponsored by: The FreeBSD Foundation
* pmcstat: Update manpage dateJessica Clarke2023-06-071-1/+1
| | | | Fixes: 53d0b9e438bc ("pmc: Provide full path to modules from kernel linker")
* pmc: Provide full path to modules from kernel linkerJessica Clarke2023-05-301-12/+0
| | | | | | | | | | | | | | | | | This unifies the user object and kernel module paths in libpmcstat, allows modules loaded from non-standard locations (e.g. from a user's home directory when testing) to be found and, since buffer is what all the warnings here use (they were never updated when buffer_modules were added to pick based on where the file was found) has the side-effect of ensuring the messages are correct. This includes obsoleting the now-superfluous -k option in pmcstat. This change breaks the hwpmc ABI and will be followed by a bump to the pmc major version. Reviewed by: jhb, jkoshy, mhorne Differential Revision: https://reviews.freebsd.org/D40048
* pmcstat: Warn about text output format stability.Joseph Koshy2023-03-241-1/+5
| | | | | | | | | The formats for pmcstat(8)'s human-readable output are not part of its user interface definition, and may change in the future. Highlight this in its manual page. Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D39249
* pmcstat.8: Improve description of -TMateusz Piotrowski2020-08-171-6/+35
| | | | Notes: svn path=/head/; revision=364297
* pmcstat: implement showing offsets into symbols in top modeMateusz Guzik2020-08-051-6/+9
| | | | | | | | | | | | | The -I option (and hotkey) is reused for this. Skipping symbol resolution is moved to the new -A option (and hotkey). While arguably this violates POLA I think it's a change for the better. ALso note the -I option was added in head. Differential Revision: https://reviews.freebsd.org/D21658 Notes: svn path=/head/; revision=363928
* libpmcstat: Try /boot/modules if module not foundRyan Moeller2020-03-121-0/+2
| | | | | | | | | | | | | | | Modules from ports/pkg are commonly installed to /boot/modules rather than to the same directory the kernel resides in. Look there if a module is not found next to the kernel. Submitted by: mmacy Reported by: Nick Principe <nap@iXsystems.com> Approved by: mmacy (mentor) MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=358923
* hwpmc: support sampling both kernel and user stacks when interrupted in kernelMatt Macy2018-06-041-3/+5
| | | | | | | | | | | | | | | | This adds the -U options to pmcstat which will attribute in-kernel samples back to the user stack that invoked the system call. It is not the default, because when looking at kernel profiles it is generally more desirable to merge all instances of a given system call together. Although heavily revised, this change is directly derived from D7350 by Jonathan T. Looney. Obtained from: jtl Sponsored by: Juniper Networks, Limelight Networks Notes: svn path=/head/; revision=334595
* pmc(3)/hwpmc(4): update supported Intel processors to rely fully on theMatt Macy2018-05-261-8/+17
| | | | | | | | | | | | | | | | | | vendor provided pmu-events tables and sundry cleanups. The vendor pmu-events tables provide counter descriptions, default sample rates, event, umask, and flag values for all the counter configuration permutations. Using this gives us: - much simpler kernel code for the MD component - helpful long and short event descriptions - simpler user code - sample rates that won't overload the system Update man page with newer sample types and remove unused sample type. Notes: svn path=/head/; revision=334244
* Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely ↵Matt Macy2018-05-261-17/+8
| | | | | | | | | fully on the" because of squash commit messages Notes: svn path=/head/; revision=334243
* pmc(3)/hwpmc(4): update supported Intel processors to rely fully on theMatt Macy2018-05-261-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vendor provided pmu-events tables and sundry cleanups. The vendor pmu-events tables provide counter descriptions, default sample rates, event, umask, and flag values for all the counter configuration permutations. Using this gives us: - much simpler kernel code for the MD component - helpful long and short event descriptions - simpler user code - sample rates that won't overload the system Update man page with newer sample types and remove unused sample type. Squashed commit of the following: commit 4459d43eff815bec08ccc5533dbe5de846f03128 Author: Matt Macy <mmacy@mattmacy.io> Date: Sat May 26 00:06:31 2018 -0700 libpmc: fix pmu function signatures for non amd64 commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:38:11 2018 -0700 pmcstat: fix indentation of usage commit f686954b15ff56a833ac80404898977cb80a265b Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:19:49 2018 -0700 pmclog(3): add callchain and pmcallocatedyn, remove pcsample commit 73e13a0d2e9498c81c150d14d022050cee7511bb Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:19:00 2018 -0700 pmclog.h: GC pcsample field commit 3e93ffd65da641fa657539dad3c48e281f8b5798 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:05:57 2018 -0700 hwpmc: make Intel core CPUs use external event tables commit 634f5fae1e1644ac324003136c66cd9c619d1c93 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:00:06 2018 -0700 pmclog: update log record types, bump PMC_MAJOR - explicitly make log record types a multiple of 8 bytes - hook in pmu event types for pmc_allocate records - remove references to no longer PCSAMPLE record commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 21:52:10 2018 -0700 libpmc: add support for having vendor table driven pmc_allocate commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 19:11:33 2018 -0700 hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user commit 859dceb93daa6419a48c794db99b6758e5b041c9 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 19:09:45 2018 -0700 pmcstat: update usage and man page as well as make -L consistent with pmccontrol commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 18:07:03 2018 -0700 pmu_util: add support for all current intel event keywords commit d8089c7f6a6c8527f38324252b1ffb47004694c6 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 17:45:00 2018 -0700 add description for new arguments commit 058336740bab53c62ec88a3a026ea848cf3878c6 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 17:38:15 2018 -0700 libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate commit 049b66b382e2f833c3f47bc8df9e750cb265709f Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:12:41 2018 -0700 pmcstat: hook pmu_events counter description utility routines in commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:11:59 2018 -0700 pmu_events: add utility routines for listing counters and their descriptions commit cba4d4f8907f772279f86f18f915e0d74d33ac56 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:09:50 2018 -0700 pmu-events: expand out skylake regex to simplify string matches Notes: svn path=/head/; revision=334242
* pmcstat(8)Sean Bruno2018-05-251-1/+12
| | | | | | | | | | | - Document per thread filtering. Submitted by: kbowling Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15549 Notes: svn path=/head/; revision=334215
* Fix the date on the pmcstat(8) man page from r291016.Jonathan T. Looney2015-11-181-1/+1
| | | | | | | | | | Approved by: gnn (mentor) MFC after: 1 month X-MFC with: r291016 Pointy hat to: jtl Notes: svn path=/head/; revision=291017
* Support a wider history counter in pmcstat(8) gmon outputJonathan T. Looney2015-11-181-1/+8
| | | | | | | | | | | | | | | | | | | | 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. Differential Revision: https://reviews.freebsd.org/D4151 Reviewed by: jhb, bjk Approved by: gnn (mentor) MFC after: 1 month Sponsored by: Juniper Networks Notes: svn path=/head/; revision=291016
* Use the cpuset API more consistently:John Baldwin2015-05-271-3/+3
| | | | | | | | | | | | | | | - Fetch the root set from cpuset_getaffinity() instead of assuming all CPUs from 0 to hw.ncpu are the root set. - Use CPU_SETSIZE and CPU_FFS. - The original notion of halted CPUs the manpage and code refers to is gone. Use the term "available" instead. Differential Revision: https://reviews.freebsd.org/D2491 Reviewed by: emaste MFC after: 1 week Notes: svn path=/head/; revision=283613
* Use the kern.bootfile sysctl to set the default kernel path rather thanJohn Baldwin2015-05-081-3/+4
| | | | | | | | | | | | | hardcoding /boot/kernel. This allows pmcstat(8) to work without -k when using nextboot -k or 'boot foo' at the loader to boot alternate kernels. Differential Revision: https://reviews.freebsd.org/D2425 Reviewed by: adrian, emaste, gnn MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Notes: svn path=/head/; revision=282643
* pmcstat.8: fix -a flag description; improve -m flag to matchEric van Gyzen2015-03-281-2/+8
| | | | | | | | | | | | | | The -a flag reads a file saved by -O, not -o. The -m flag requires the -R flag. Copy that paragraph from -a. Reviewed by: adrian Approved by: kib (mentor) MFC after: 1 week Sponsored by: Dell Inc Notes: svn path=/head/; revision=280793
* Fix renderingBaptiste Daroussin2014-10-271-2/+1
| | | | | | | Submitted by: brueffer Notes: svn path=/head/; revision=273739
* Clarify the documentation of pmcstat:Baptiste Daroussin2014-10-271-1/+8
| | | | | | | | | | | the -d argument should be passed before -p, -s, -P or -S to be taken in account Differential Revision: https://reviews.freebsd.org/D1011 Reviewed by: adrian, gnn MFC after: 1 week Notes: svn path=/head/; revision=273737
* mdoc: kill EOL whitespace.Joel Dahl2014-07-291-1/+1
| | | | Notes: svn path=/head/; revision=269251
* use .Mt to mark up email addresses consistently (part2)Baptiste Daroussin2014-06-201-1/+1
| | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de> Notes: svn path=/head/; revision=267668
* Update the date on the manual page.George V. Neville-Neil2014-05-181-1/+1
| | | | | | | Pointed out by: bz Notes: svn path=/head/; revision=266403
* Add a command line argument (-l) to end event collection after someGeorge V. Neville-Neil2014-05-161-0/+8
| | | | | | | | | | | number of seconds. The number of seconds may be a fraction. Submitted by: Julien Charbon <jcharbon@versign.com> MFC after: 2 weeks Relnotes: yes Notes: svn path=/head/; revision=266209
* Document the -a option that was added in r262424.Scott Long2014-04-291-1/+17
| | | | | | | | Obtained from: Netflix, Inc. MFC after: 3 days Notes: svn path=/head/; revision=265085
* Minor spelling fixes.Joel Dahl2012-06-031-1/+1
| | | | Notes: svn path=/head/; revision=236509
* mdoc: correct .Bd/.Bl arguments.Joel Dahl2012-03-261-1/+1
| | | | | | | Reviewed by: brueffer Notes: svn path=/head/; revision=233522
* mdoc: order prologue macros consistently by Dd/Dt/OsUlrich Spörlein2010-04-141-1/+1
| | | | | | | | | | | 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) Notes: svn path=/head/; revision=206622
* - Reorganize code in 'plugin' to share log processing.Fabien Thomas2010-02-111-1/+27
| | | | | | | | | | | - Kcachegrind (calltree) support with assembly/source code mapping and call count estimator (-F). - Top mode for calltree and callgraph plugin (-T). MFC after: 1 month Notes: svn path=/head/; revision=203790
* Catch up with the times: "mozilla" -> "firefox".Joseph Koshy2009-06-021-2/+2
| | | | Notes: svn path=/head/; revision=193296
* Add the -m option to pmcstat.Attilio Rao2008-11-251-0/+14
| | | | | | | | | | | | This option prints the list of sampled PCs along with the function name, the start and end addresses of this where their live within. Reviewed by: jkoshy Tested by: gnn Sponsored by: Nokia Notes: svn path=/head/; revision=185322
* - Avoid a spurious error when a command line is specified withoutJoseph Koshy2008-10-071-3/+3
| | | | | | | | any process scope PMCs. - Change the -c '*' option to denote non-halted CPUs. Notes: svn path=/head/; revision=183672
* Add an example illustrating the use sleep(1) for performing timedJoseph Koshy2008-09-191-2/+7
| | | | | | | measurements. Notes: svn path=/head/; revision=183183
* Document messages printed in verbose mode.Joseph Koshy2008-06-291-2/+36
| | | | | | | Requested by: Fabien Thomas <fabien.thomas at netasq dot com> Notes: svn path=/head/; revision=180091
* Introduce pmcstat(8) changes for summarizing hwpmc(4) callchain records inJoseph Koshy2007-12-071-5/+54
| | | | | | | | | | | in textual form and in gmon.out format. Update manual page. Sponsored by: FreeBSD Foundation and Google Inc. Notes: svn path=/head/; revision=174396
* MFP4: Enhancements to pmcstat(8):Joseph Koshy2007-04-271-15/+24
| | | | | | | | | | | | | - Allow the "-t" option to take a regular expression naming command line processes to attach process PMCs to. - Update the manual page and add an example showing the use of the new functionality. - Update the (c) year on the affected source files. Notes: svn path=/head/; revision=169069
* MFP4: Enhancements and bug-fixes to pmcstat(8):Joseph Koshy2007-04-221-9/+18
| | | | | | | | | | | | | | | | | | | - The '-c' option now takes a comma-separated list of CPU numbers, or a literal '*' denoting all CPUs in the system. Subsequent system PMCs are allocated on the CPUs so specified. Change the default behaviour to allocate system PMCs on all CPUs, not just CPU 0. Update the manual page and add an example of how to use the new functionality. - Attach PMCs to a (commandline) child process more reliably. This fixes a long standing bug in counting events incurred by short-lived processes. Notes: svn path=/head/; revision=168949
* Markup fixes.Ruslan Ermilov2006-09-291-4/+5
| | | | Notes: svn path=/head/; revision=162806
* - Teach pmcstat(8) to log over the network; the -O option nowJoseph Koshy2006-04-021-7/+34
| | | | | | | | | | | | | | takes a host:port specification. - Update the manual page and add an example showing how log over the network using pmcstat(8) and nc(1). Document the current inability to process logs in cross-platform manner. - Have pmcstat_open_log() call err(3) directly in case of an error; this simplifies error handling in its caller. MFC after: 1 week Notes: svn path=/head/; revision=157406
* MFP4: Support for profiling dynamically loaded objects.Joseph Koshy2006-03-261-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=157144
* Document pmcstat's inability to handle 32 bit executables on theJoseph Koshy2005-10-181-0/+4
| | | | | | | | | AMD64 while I work on a fix. Noticed by: ps Notes: svn path=/head/; revision=151433
* Fix spelling error in sample command.Robert Watson2005-07-131-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=147953
* Add examples illustrating how to record system-wide profiles andJoseph Koshy2005-07-011-3/+18
| | | | | | | | | | | | | how to convert these to gprof(1) flat profiles. Augment description for the '-g' option. Remove superfluous quotes around a macro argument, bump document date [1]. Reminded by: ru [1] Approved by: re (blanket hwpmc) Notes: svn path=/head/; revision=147713
* MFP4:Joseph Koshy2005-06-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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) Notes: svn path=/head/; revision=147708
* - Tidy markup. [1]Joseph Koshy2005-06-241-31/+22
| | | | | | | | | | | | | | | - Remove mention of an unimplemented option. - Clarify the behavior of pmcstat when logging PMCs are requested, but no log output file is specified. - Add a cross-reference to pmclog(3). - Bump document date. Reviewed by: ru Submitted by: ru [1] Approved by: re (blanket hwpmc) Notes: svn path=/head/; revision=147587
* MFP4:Joseph Koshy2005-06-091-11/+49
| | | | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=147191
* Bring a working snapshot of hwpmc(4), its associated libraries, userland ↵Joseph Koshy2005-04-191-0/+196
utilities and documentation into -CURRENT. Bump FreeBSD_version. Reviewed by: alc, jhb (kernel changes) Notes: svn path=/head/; revision=145256