add cpucache

This commit is contained in:
Brendan Gregg committed 2018-01-12 14:52:40 -08:00
1 parent 46da5466c0
commit d472914aca
2 files changed
+184 -1

No files matched your search

+58 -1
View File
@@ -46,7 +46,7 @@ USAGE: pmcarch {-C CPU | -p PID | -c CMD} [interval [duration]]
pmcarch -c 'cksum /boot/*' # measure run and measure this cmd
</pre>
## All PMCs
## Extended PMCs
These are available on some AWS Nitro hypervisor instance types. Eg, c5.9xl.
@@ -91,3 +91,60 @@ USAGE: tlbstat {-C CPU | -p PID | -c CMD} [interval [duration]]
tlbstat -p 181 # measure PID 181 only
tlbstat -c 'cksum /boot/*' # measure run and measure this cmd
</pre>
## ALL PMCs
These may not work on the cloud yet, and may be works-in-progress. They may also require more recent Linux versions for the PMC aliases.
### cpucache
Summarizes CPU L1/L2/LLC cache hit ratios. Eg:
<pre>
# <b>./cpucache</b>
All counter columns are x 1000
CYCLES INSTR IPC L1DREF L1DMISS L1D% L2REF L2MISS L2% LLCREF LLCMISS LLC%
55827883 44795258 0.80 11674473 98067 99.16 161026 78908 51.00 97522 31338 67.87
55841905 44803990 0.80 11685292 98216 99.16 162127 79934 50.70 98810 30975 68.65
55832518 44838601 0.80 11700599 98181 99.16 160586 78725 50.98 96895 31497 67.49
55832741 44831064 0.80 11700963 98102 99.16 160849 78377 51.27 97296 31477 67.65
55832729 44763451 0.80 11672814 98216 99.16 163742 80630 50.76 99961 30679 69.31
55847526 44815072 0.80 11691652 98299 99.16 162176 79552 50.95 99092 30798 68.92
55832810 44748131 0.80 11667573 98132 99.16 163209 82497 49.45 101771 31035 69.50
55832325 44788718 0.80 11670262 98459 99.16 161834 79713 50.74 97504 31057 68.15
55832453 44795688 0.80 11682541 98069 99.16 162384 77339 52.37 95222 30347 68.13
55832224 44749672 0.80 11688124 98007 99.16 163076 79868 51.02 100960 30842 69.45
55837742 44793089 0.80 11689272 98273 99.16 161173 79280 50.81 97667 31776 67.46
[...]
</pre>
- 'CYCLES': CPU Cycles x 1000
- 'INSTR': CPU Instructions x 1000
- 'IPC': Instructions-Per-Cycle
- 'L1DREF': Level 1 data cache loads x 1000
- 'L1DMISS': Level 1 data cache load misses x 1000
- 'L1D%': Level 1 data cache hit ratio, as a percentage
- 'L2REF': Level 2 requests x 1000
- 'L2MISS': Level 2 misses x 1000
- 'L2%': Level 2 hit ratio, as a percentage
- 'LLCREF': Last Level Cache references x 1000
- 'LLCMISS': Last Level Cache misses x 1000
- 'LLC%': Last Level Cache hit ratio, as a percentage
USAGE:
<pre>
# <b>./cpucache -h</b>
USAGE: cpucache {-C CPU | -p PID | -c CMD} [interval [duration]]
-C CPU # measure this CPU only
-p PID # measure this PID only
-c 'CMD' # measure this command only (quote it)
interval # output interval in secs (default 1)
duration # total seconds (default infinityish)
eg,
cpucache # show stats across all CPUs
cpucache 5 # show stats every 5 seconds
cpucache -C 0 # measure CPU 0 only
cpucache -p 181 # measure PID 181 only
cpucache -c 'cksum /boot/*' # measure run and measure this cmd
</pre>