man.bsd.lv manual page server

Manual Page Search Parameters

PMC.MIPS24K(3) Library Functions Manual PMC.MIPS24K(3)

pmc.mips24kmeasurement events for MIPS24K family CPUs

library “libpmc”

#include <pmc.h>

MIPS PMCs are present in MIPS 24k and other processors in the MIPS family.

There are two counters supported by the hardware and each is 32 bits wide.

MIPS PMCs are documented in MIPS32 24K Processor Core Family Software User's Manual, MIPS Technologies Inc., December 2008.

MIPS programmable PMCs support the following events:

(Event 0, Counter 0/1) Total number of cycles. The performance counters are clocked by the top-level gated clock. If the core is built with that clock gater present, none of the counters will increment while the clock is stopped - due to a WAIT instruction.
(Event 1, Counter 0/1) Total number of instructions completed.
(Event 2, Counter 0) Total number of branch instructions completed.
(Event 2, Counter 1) Counts all branch instructions which completed, but were mispredicted.
(Event 3, Counter 0) Counts all JR R31 instructions completed.
(Event 3, Counter 1) Counts all JR $31 instructions which completed, used the RPS for a prediction, but were mispredicted.
(Event 4, Counter 0) Counts all JR $xx (not $31) and JALR instructions (indirect jumps).
(Event 4, Counter 1) If RPS use is disabled, JR $31 will not be predicted.
(Event 5, Counter 0) Counts ITLB accesses that are due to fetches showing up in the instruction fetch stage of the pipeline and which do not use a fixed mapping or are not in unmapped space. If an address is fetched twice from the pipe (as in the case of a cache miss), that instruction willcount as 2 ITLB accesses. Since each fetch gets us 2 instructions,there is one access marked per double word.
(Event 5, Counter 1) Counts all misses in the ITLB except ones that are on the back of another miss. We cannot process back to back misses and thus those are ignored. They are also ignored if there is some form of address error.
(Event 6, Counter 0) Counts DTLB access including those in unmapped address spaces.
(Event 6, Counter 1) Counts DTLB misses. Back to back misses that result in only one DTLB entry getting refilled are counted as a single miss.
(Event 7, Counter 0) Instruction JTLB accesses are counted exactly the same as ITLB misses.
(Event 7, Counter 1) Counts instruction JTLB accesses that result in no match or a match on an invalid translation.
(Event 8, Counter 0) Data JTLB accesses.
(Event 8, Counter 1) Counts data JTLB accesses that result in no match or a match on an invalid translation.
(Event 9, Counter 0) Counts every time the instruction cache is accessed. All replays, wasted fetches etc. are counted. For example, following a branch, even though the prediction is taken, the fall through access is counted.
(Event 9, Counter 1) Counts all instruction cache misses that result in a bus request.
(Event 10, Counter 0) Counts cached loads and stores.
(Event 10, Counter 1) Counts cache lines written back to memory due to replacement or cacheops.
(Event 11, Counter 0/1) Counts loads and stores that miss in the cache
(Event 13, Counter 0) Counts number of cacheable loads that miss in the cache.
(Event 13, Counter 1) Counts number of cacheable stores that miss in the cache.
(Event 14, Counter 0) Non-floating point, non-Coprocessor 2 instructions.
(Event 14, Counter 1) Floating point instructions completed.
(Event 15, Counter 0) Integer and co-processor loads completed.
(Event 15, Counter 1) Integer and co-processor stores completed.
(Event 16, Counter 0) Direct jump (and link) instructions completed.
(Event 16, Counter 1) MIPS16c instructions completed.
(Event 17, Counter 0) NOPs completed. This includes all instructions that normally write to a general purpose register, but where the destination register was set to r0.
(Event 17, Counter 1) Integer multiply and divide instructions completed. (MULxx, DIVx, MADDx, MSUBx).
(Event 18, Counter 0) Counts the total number of cycles where no instructions are issued from the IFU to ALU (the RF stage does not advance) which includes both of the previous two events. The RT_STALL is different than the sum of them though because cycles when both stalls are active will only be counted once.
(Event 18, Counter 1) replay traps (other than uTLB)
(Event 19, Counter 0) Conditional stores completed. Counts all events, including failed stores.
(Event 19, Counter 1) Conditional store instruction that did not update memory. Note: While this event and the SC instruction count event can be configured to count in specific operating modes, the timing of the events is much different and the observed operating mode could change between them, causing some inaccuracy in the measured ratio.
(Event 20, Counter 0) Note that this only counts PREFs that are actually attempted. PREFs to uncached addresses or ones with translation errors are not counted
(Event 20, Counter 1) Counts PREF instructions that hit in the cache
(Event 21, Counter 0) Counts cache lines written back to memory due to replacement or cacheops.
(Event 21, Counter 1) Number of accesses to L2 Cache.
(Event 22, Counter 0) Number of accesses that missed in the L2 cache.
(Event 22, Counter 1) Single bit errors in L2 Cache that were detected and corrected.
(Event 23, Counter 0) Any type of exception taken.
(Event 24, Counter 0) Counts cycles where the LSU is in fixup and cannot accept a new instruction from the ALU. Fixups are replays within the LSU that occur when an instruction needs to re-access the cache or the DTLB.
(Event 25, Counter 0) Counts the number of cycles where the fetch unit is not providing a valid instruction to the ALU.
(Event 25, Counter 1) Counts the number of cycles where the ALU pipeline cannot advance.
(Event 33, Counter 0) Counts uncached and uncached accelerated loads.
(Event 33, Counter 1) Counts uncached and uncached accelerated stores.
(Event 35, Counter 0) Co-processor 2 register to register instructions completed.
(Event 35, Counter 1) Co-processor 2 move to and from instructions as well as loads and stores.
(Event 37, Counter 0) Cycles when IFU stalls because an instruction miss caused the IFU not to have any runnable instructions. Ignores the stalls due to ITLB misses as well as the 4 cycles following a redirect.
(Event 37, Counter 1) Counts all cycles where integer pipeline waits on Load return data due to a D-cache miss. The LSU can signal a "long stall" on a D-cache misses, in which case the waiting TC might be rescheduled so other TCs can execute instructions till the data returns.
(Event 38, Counter 0) Cycles where the main pipeline is stalled waiting for a SYNC to complete.
(Event 38, Counter 1) Cycles where the main pipeline is stalled because of an index conflict in the Fill Store Buffer.
(Event 39, Counter 0) Data miss is outstanding, but not necessarily stalling the pipeline. The difference between this and D$ miss stall cycles can show the gain from non-blocking cache misses.
(Event 39, Counter 1) L2 miss is outstanding, but not necessarily stalling the pipeline.
(Event 40, Counter 0) Cycles where the processor is stalled on an uncached fetch, load, or store.
(Event 41, Counter 0) Cycles where the processor is stalled on an uncached fetch, load, or store.
(Event 41, Counter 1) Counts all cycles where integer pipeline waits on FPU return data.
(Event 42, Counter 0) Counts all cycles where integer pipeline waits on CP2 return data.
(Event 42, Counter 1) Counts all cycles where integer pipeline waits on CorExtend return data.
(Event 43, Counter 0) Count all pipeline bubbles that are a result of multicycle ISPRAM access. Pipeline bubbles are defined as all cycles that IFU doesn't present an instruction to ALU. The four cycles after a redirect are not counted.
(Event 43, Counter 1) Counts stall cycles created by an instruction waiting for access to DSPRAM.
(Event 44, Counter 0) Counts all cycles the where pipeline is stalled due to CACHE instructions. Includes cycles where CACHE instructions themselves are stalled in the ALU, and cycles where CACHE instructions cause subsequent instructions to be stalled.
(Event 45, Counter 0) Counts all cycles where integer pipeline waits on Load return data.
(Event 45, Counter 1) Counts stall cycles due to skewed ALU where the bypass to the address generation takes an extra cycle.
(Event 46, Counter 0) Counts all cycles where integer pipeline waits on return data from MFC0, RDHWR instructions.
(Event 46, Counter 1) This counts the number of cycles from a mispredicted branch until the next non-delay slot instruction executes.
(Event 48, Counter 0) Counts the number of times an instruction cache miss was detected, but both fill buffers were already allocated.
(Event 48, Counter 1) Number of cycles where at least one of the IFU fill buffers is allocated (miss pending).
(Event 49, Counter 0) Number of times an EJTAG Instruction Trigger Point condition matched.
(Event 49, Counter 1) Number of times an EJTAG Data Trigger Point condition matched.
(Event 50, Counter 0) Fill store buffer less than one quarter full.
(Event 50, Counter 1) Fill store buffer between one quarter and one half full.
(Event 51, Counter 0) Fill store buffer more than half full.
(Event 51, Counter 1) Cycles where the pipeline is stalled because the Fill-Store Buffer in LSU is full.
(Event 52, Counter 0) Load data queue less than one quarter full.
(Event 52, Counter 1) Load data queue between one quarter and one half full.
(Event 53, Counter 0) Load data queue more than one half full.
(Event 53, Counter 1) Cycles where the pipeline is stalled because the Load Data Queue in the LSU is full.
(Event 54, Counter 0) Write back buffer less than one quarter full.
(Event 54, Counter 1) Write back buffer between one quarter and one half full.
(Event 55, Counter 0) Write back buffer more than one half full.
(Event 55 Counter 1) Cycles where the pipeline is stalled because the Load Data Queue in the LSU is full.
(Event 61, Counter 0) Measures latency from miss detection until critical dword of response is returned, Only counts for cacheable reads.
(Event 61, Counter 1) Counts number of cacheable read requests used for previous latency counter.

The following table shows the mapping between the PMC-independent aliases supported by library “libpmc” and the underlying hardware events used.

pmc(3), pmc.atom(3), pmc.core(3), pmc.iaf(3), pmc.k7(3), pmc.k8(3), pmc.octeon(3), pmc.p4(3), pmc.p5(3), pmc.p6(3), pmc.soft(3), pmc.tsc(3), pmc_cpuinfo(3), pmclog(3), hwpmc(4)

The pmc library first appeared in FreeBSD 6.0.

The library “libpmc” library was written by Joseph Koshy <jkoshy@FreeBSD.org>. MIPS support was added by George Neville-Neil <gnn@FreeBSD.org>.

March 24, 2012 FreeBSD-12.0