Code Snapshots |
| About | Articles | How to contact me | Projects | Site Map |
This code is available in FreeBSD 6.X and later. Please see http://wiki.FreeBSD.org/PmcTools/ for further updates.
| # | PMC Arch | State |
Resolve Date (In -CURRENT) |
Description |
|---|---|---|---|---|
| 1 | AMD64 | Fixed | 2005/08/07 | Running sampling under load causes an AMD64 box to silently reset and reboot. [NMI handling needs to be special-cased on the AMD64.] |
| 2 | (all) | Fixed | 2005/07/09 | The last few samples when using pmcstat(8) -O file are occasionally dropped. [Turned out to be a bug in pmclog(3)]. |
| 3 | Intel P4 | Open | ... | On a P4 kldunload does not completely reset processor state. |
| 4 | (all) | Open | ... | pmcstat(8) -g ignores a.out executables. |
| 5 | (all) | Fixed | 2005/09/14 | pmcstat(8) -g ignores PC values inside rtld(8) address space. |
| 6 | (all) | Open | ... | Process-mode sampling with PMC_F_DESCENDANTS doesn't work. |
| 7 | (x86 compatible) | Open | ... | The TSC should be virtualizable, but isn't. |
| 8 | AMD K7, Intel PPro/P-II/P-III/Celeron/Pentium-M | Open | ... | Sampling modes do not generate output. [The local APIC not being recognized on single-processor motherboards and hence we are unable to configure the PMCs to interrupt.] |
| 9 | (all) | Fixed | 2005/9/13 | pmcstat(8)'s gprof output mode needs to be checked for accuracy. |
| 10 | AMD64 | Fixed | 2005/9/12 | (Reported by Olivier Crameri) AMD64 doesn't sample for cache-misses and tlb-miss events. |
| 11 | AMD64 | Open | ... | (Reported by Paul Saab) pmcstat(8) does not handle 32 bit executables on the AMD64 when generating a gprof profile. |
| 12 | AMD64 | Open | ... | (Reported by Niklas Sorensson) pmcstat(8) -P appears to be missing samples on an AMD64 box. |
| 13 | P-III | Open | ... | (Reported by David Fresse, FreeBSD 6.0-RC1) pmcstat(8) fails to exit cleanly on a dual processor P-III system, requiring a forcible kldunload of the hwpmc module or a reboot. |
Development of new features is happening in the FreeBSD perforce repository. The project repository is viewable at: //depot/user/jkoshy/projects/pmc/... .
A python wrapper to pmc(3) has being developed.
A testsuite is being developed and is viewable at: //depot/user/jkoshy/projects/pmctools/pmc-testsuite/... .
In case you would like to see what the code can do :).
The -L option to pmccontrol(8) lists the available counter classes on a CPU:
| AMD Athlon XP | Intel P-IV |
orthanc-5# pmccontrol -L
TSC
tsc
K7
k7-dc-accesses
k7-dc-misses
k7-dc-refills-from-l2
k7-dc-refills-from-system
k7-dc-writebacks
k7-l1-dtlb-miss-and-l2-dtlb-hits
k7-l1-and-l2-dtlb-misses
k7-misaligned-references
k7-ic-fetches
k7-ic-misses
k7-l1-itlb-misses
k7-l1-l2-itlb-misses
k7-retired-instructions
k7-retired-ops
k7-retired-branches
k7-retired-branches-mispredicted
k7-retired-taken-branches
k7-retired-taken-branches-mispredicted
k7-retired-far-control-transfers
k7-retired-resync-branches
k7-interrupts-masked-cycles
k7-interrupts-masked-while-pending-cycles
k7-hardware-interrupts
|
mismatcher# pmccontrol -L
TSC
tsc
P4
p4-tc-deliver-mode
p4-bpu-fetch-request
p4-itlb-reference
p4-memory-cancel
p4-memory-complete
p4-load-port-replay
p4-store-port-replay
p4-mob-load-replay
p4-page-walk-type
p4-bsq-cache-reference
p4-ioq-allocation
p4-ioq-active-entries
p4-fsb-data-activity
p4-bsq-allocation
p4-bsq-active-entries
p4-sse-input-assist
p4-packed-sp-uop
p4-packed-dp-uop
p4-scalar-sp-uop
p4-scalar-dp-uop
p4-64bit-mmx-uop
p4-128bit-mmx-uop
p4-x87-fp-uop
p4-x87-simd-moves-uop
p4-global-power-events
p4-tc-ms-xfer
p4-uop-queue-writes
p4-retired-mispred-branch-type
p4-retired-branch-type
p4-resource-stall
p4-wc-buffer
p4-b2b-cycles
p4-bnr
p4-snoop
p4-response
p4-front-end-event
p4-execution-event
p4-replay-event
p4-intr-retired
p4-uops-retired
p4-uop-type
p4-branch-retired
p4-mispred-branch-retired
p4-x87-assist
p4-machine-clear
|
The -l option to pmccontrol(8) lists current hardware PMC state:
| AMD Athlon XP | Intel P-IV |
orthanc-5# pmccontrol -l
#CPU 0:
#N NAME CLASS STATE ROW-DISP
0 TSC TSC ENABLED FREE
1 K7-0 K7 ENABLED FREE
2 K7-1 K7 ENABLED FREE
3 K7-2 K7 ENABLED FREE
4 K7-3 K7 ENABLED FREE
|
mismatcher# pmccontrol -l
#CPU 0:
#N NAME CLASS STATE ROW-DISP
0 TSC TSC ENABLED FREE
1 BPU_COUNTER0 P4 ENABLED FREE
2 BPU_COUNTER1 P4 ENABLED FREE
3 BPU_COUNTER2 P4 ENABLED FREE
4 BPU_COUNTER3 P4 ENABLED FREE
5 MS_COUNTER0 P4 ENABLED FREE
6 MS_COUNTER1 P4 ENABLED FREE
7 MS_COUNTER2 P4 ENABLED FREE
8 MS_COUNTER3 P4 ENABLED FREE
9 FLAME_COUNTER0 P4 ENABLED FREE
10 FLAME_COUNTER1 P4 ENABLED FREE
11 FLAME_COUNTER2 P4 ENABLED FREE
12 FLAME_COUNTER3 P4 ENABLED FREE
13 IQ_COUNTER0 P4 ENABLED FREE
14 IQ_COUNTER1 P4 ENABLED FREE
15 IQ_COUNTER2 P4 ENABLED FREE
16 IQ_COUNTER3 P4 ENABLED FREE
17 IQ_COUNTER4 P4 ENABLED FREE
18 IQ_COUNTER5 P4 ENABLED FREE
#CPU 1:
#N NAME CLASS STATE ROW-DISP
0 TSC TSC ENABLED FREE
1 BPU_COUNTER0 P4 ENABLED FREE
2 BPU_COUNTER1 P4 ENABLED FREE
3 BPU_COUNTER2 P4 ENABLED FREE
4 BPU_COUNTER3 P4 ENABLED FREE
5 MS_COUNTER0 P4 ENABLED FREE
6 MS_COUNTER1 P4 ENABLED FREE
7 MS_COUNTER2 P4 ENABLED FREE
8 MS_COUNTER3 P4 ENABLED FREE
9 FLAME_COUNTER0 P4 ENABLED FREE
10 FLAME_COUNTER1 P4 ENABLED FREE
11 FLAME_COUNTER2 P4 ENABLED FREE
12 FLAME_COUNTER3 P4 ENABLED FREE
13 IQ_COUNTER0 P4 ENABLED FREE
14 IQ_COUNTER1 P4 ENABLED FREE
15 IQ_COUNTER2 P4 ENABLED FREE
16 IQ_COUNTER3 P4 ENABLED FREE
17 IQ_COUNTER4 P4 ENABLED FREE
18 IQ_COUNTER5 P4 ENABLED FREE
|
pmcstat(8) is used to initiate measurements.
System-wide counting modes are working on the AMD Athlon.
orthanc-5# pmcstat -w 1 -s k7-retired-ops -s k7-hardware-interrupts -s tsc
# s/k7-retired-ops s/k7-hardware-interrupts s/tsc
... [snip]
1537452324 303 1544654204
1539769394 277 1544313494
1506255881 232 1544571129
1440860430 241 1544515883
1512002871 264 1544521156
1501634509 438 1544538724
1495399026 484 1544520002
1538775286 300 1544519884
1540522406 230 1544496905
1408860912 252 1544561516
1540594579 230 1544484827
... [snip]
Process virtual modes.
In the following example, we attach a PMC to an existing process (the ION window manager) and read it at 1 second intervals.
orthanc-5 $ ps -ax | grep ion | grep -v grep
2576 v0 S 0:00.14 ion
orthanc-5 $ pmcstat -p k7-dc-misses -w 1 -t 2576
# p/k7-dc-misses
0
0
245
1607
877
198
0
0
3879 --
3881 -- switch virtual screens here
1795 --
0
1821
0 ^C
orthanc-5 $
The pmcstat(8) utility can be used to spawn a child process and measure its performance using PMCs.
orthanc-5 $ pmcstat -p k7-dc-misses -p k7-retired-ops -w 1 find . -print > /dev/null
# p/k7-dc-misses p/k7-retired-ops
820490 1657219814
197281 273097142
166935 221770396
314936 424232980
177045 228165639
132126 183637685
200139 270518409
orthanc-5 $
| Contact: jkoshy@FreeBSD.org |
|