Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,4 @@ Use `builder/build.sh` to build the dependencies and the application in Docker c
### Subsequent Builds

`make` builds the app. It assumes the dependencies have been built previously and that you have Go installed on your development system. See [go.mod](go.mod) for the minimum Go version.

2 changes: 1 addition & 1 deletion cmd/metrics/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func NewLoader(uarch string, useLegacyLoader bool) (Loader, error) {
case cpus.UarchCWF, cpus.UarchGNR, cpus.UarchGNR_X1, cpus.UarchGNR_X2, cpus.UarchGNR_X3, cpus.UarchGNR_D, cpus.UarchSRF, cpus.UarchSRF_SP, cpus.UarchSRF_AP, cpus.UarchEMR, cpus.UarchEMR_MCC, cpus.UarchEMR_XCC, cpus.UarchSPR, cpus.UarchSPR_MCC, cpus.UarchSPR_XCC, cpus.UarchICX:
slog.Debug("Using perfmon loader for microarchitecture", slog.String("uarch", uarch))
return newPerfmonLoader(), nil
case cpus.UarchGraviton2, cpus.UarchGraviton3, cpus.UarchGraviton4, cpus.UarchAxion, cpus.UarchAltraFamily, cpus.UarchAmpereOneAC03, cpus.UarchAmpereOneAC04, cpus.UarchAmpereOneAC04_1:
case cpus.UarchGraviton2, cpus.UarchGraviton3, cpus.UarchGraviton4, cpus.UarchGraviton5, cpus.UarchAxion, cpus.UarchAltraFamily, cpus.UarchAmpereOneAC03, cpus.UarchAmpereOneAC04, cpus.UarchAmpereOneAC04_1:
slog.Debug("Using component loader for microarchitecture", slog.String("uarch", uarch))
return newComponentLoader(), nil
default:
Expand Down
2 changes: 2 additions & 0 deletions cmd/metrics/loader_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ func initializeComponentMetricEvaluable(expression string, evaluatorFunctions ma
// the cpus module, to the directory where the associated events and metrics reside
func getUarchDir(uarch string) (string, error) {
switch uarch {
case cpus.UarchGraviton5:
return "neoverse-v3", nil
case cpus.UarchGraviton4, cpus.UarchAxion:
return "neoverse-n2-v2", nil
case cpus.UarchGraviton2:
Expand Down
2 changes: 1 addition & 1 deletion cmd/metrics/metadata_aarch.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func getARMSlots(scriptOutputs map[string]script.ScriptOutput) (slots int, err e
// Used as a fallback when we cannot read the slots from sysfs.
func getARMSlotsByArchitecture(uarch string) (slots int, err error) {
switch uarch {
case cpus.UarchGraviton4, cpus.UarchAxion:
case cpus.UarchGraviton4, cpus.UarchGraviton5, cpus.UarchAxion:
slots = 8
case cpus.UarchGraviton2, cpus.UarchGraviton3:
slots = 6
Expand Down
6 changes: 6 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/bus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"ArchStdEvent": "BUS_CYCLES",
"PublicDescription": "Counts bus cycles in the CPU. Bus cycles represent a clock cycle in which a transaction could be sent or received on the interface from the CPU to the external bus. Since that interface is driven at the same clock speed as the CPU, this event is a duplicate of CPU_CYCLES."
}
]
10 changes: 10 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/exception.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"ArchStdEvent": "EXC_TAKEN",
"PublicDescription": "Counts any taken architecturally visible exceptions such as IRQ, FIQ, SError, and other synchronous exceptions. Exceptions are counted whether or not they are taken locally."
},
{
"ArchStdEvent": "EXC_RETURN",
"PublicDescription": "Counts any architecturally executed exception return instructions. For example: AArch64: ERET"
}
]
10 changes: 10 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/general.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"ArchStdEvent": "CPU_CYCLES",
"PublicDescription": "Counts CPU clock cycles (not timer cycles). The clock measured by this event is defined as the physical clock driving the CPU logic."
},
{
"ArchStdEvent": "CNT_CYCLES",
"PublicDescription": "Increments at a constant frequency equal to the rate of increment of the System Counter, CNTPCT_EL0."
}
]
18 changes: 18 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/l1d_cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"ArchStdEvent": "L1D_CACHE_REFILL",
"PublicDescription": "Counts level 1 data cache refills caused by speculatively executed load or store operations that missed in the level 1 data cache. This event only counts one event per cache line."
},
{
"ArchStdEvent": "L1D_CACHE",
"PublicDescription": "Counts level 1 data cache accesses from any load/store operations. Atomic operations that resolve in the CPUs caches (near atomic operations) counts as both a write access and read access. Each access to a cache line is counted including the multiple accesses caused by single instructions such as LDM or STM. Each access to other level 1 data or unified memory structures, for example refill buffers, write buffers, and write-back buffers, are also counted."
},
{
"ArchStdEvent": "L1D_CACHE_WB",
"PublicDescription": "Counts write-backs of dirty data from the L1 data cache to the L2 cache. This occurs when either a dirty cache line is evicted from L1 data cache and allocated in the L2 cache or dirty data is written to the L2 and possibly to the next level of cache. This event counts both victim cache line evictions and cache write-backs from snoops or cache maintenance operations. The following cache operations are not counted:\n\n1. Invalidations which do not result in data being transferred out of the L1 (such as evictions of clean data),\n2. Full line writes which write to L2 without writing L1, such as write streaming mode."
},
{
"ArchStdEvent": "L1D_CACHE_LMISS_RD",
"PublicDescription": "Counts cache line refills into the level 1 data cache from any memory read operations, that incurred additional latency."
}
]
14 changes: 14 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/l1i_cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"ArchStdEvent": "L1I_CACHE_REFILL",
"PublicDescription": "Counts cache line refills in the level 1 instruction cache caused by a missed instruction fetch. Instruction fetches may include accessing multiple instructions, but the single cache line allocation is counted once."
},
{
"ArchStdEvent": "L1I_CACHE",
"PublicDescription": "Counts instruction fetches which access the level 1 instruction cache. Instruction cache accesses caused by cache maintenance operations are not counted."
},
{
"ArchStdEvent": "L1I_CACHE_LMISS",
"PublicDescription": "Counts cache line refills into the level 1 instruction cache, that incurred additional latency."
}
]
18 changes: 18 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/l2_cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"ArchStdEvent": "L2D_CACHE",
"PublicDescription": "Counts accesses to the level 2 cache due to data accesses. Level 2 cache is a unified cache for data and instruction accesses. Accesses are for misses in the first level data cache or translation resolutions due to accesses. This event also counts write back of dirty data from level 1 data cache to the L2 cache."
},
{
"ArchStdEvent": "L2D_CACHE_REFILL",
"PublicDescription": "Counts cache line refills into the level 2 cache. Level 2 cache is a unified cache for data and instruction accesses. Accesses are for misses in the level 1 data cache or translation resolutions due to accesses."
},
{
"ArchStdEvent": "L2D_CACHE_WB",
"PublicDescription": "Counts write-backs of data from the L2 cache to outside the CPU. This includes snoops to the L2 (from other CPUs) which return data even if the snoops cause an invalidation. L2 cache line invalidations which do not write data outside the CPU and snoops which return data from an L1 cache are not counted. Data would not be written outside the cache when invalidating a clean cache line."
},
{
"ArchStdEvent": "L2D_CACHE_LMISS_RD",
"PublicDescription": "Counts cache line refills into the level 2 unified cache from any memory read operations that incurred additional latency."
}
]
18 changes: 18 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/memory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"ArchStdEvent": "MEM_ACCESS",
"PublicDescription": "Counts memory accesses issued by the CPU load store unit, where those accesses are issued due to load or store operations. This event counts memory accesses no matter whether the data is received from any level of cache hierarchy or external memory. If memory accesses are broken up into smaller transactions than what were specified in the load or store instructions, then the event counts those smaller memory transactions."
},
{
"ArchStdEvent": "LDST_ALIGN_LAT",
"PublicDescription": "Counts the number of memory read and write accesses in a cycle that incurred additional latency, due to the alignment of the address and the size of data being accessed, which results in store crossing a single cache line."
},
{
"ArchStdEvent": "LD_ALIGN_LAT",
"PublicDescription": "Counts the number of memory read accesses in a cycle that incurred additional latency, due to the alignment of the address and size of data being accessed, which results in load crossing a single cache line."
},
{
"ArchStdEvent": "ST_ALIGN_LAT",
"PublicDescription": "Counts the number of memory write access in a cycle that incurred additional latency, due to the alignment of the address and size of data being accessed incurred additional latency."
}
]
149 changes: 149 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/metrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
[
{
"MetricName": "backend_stalled_cycles",
"MetricExpr": "STALL_BACKEND / CPU_CYCLES * 100",
"BriefDescription": "This metric is the percentage of cycles that were stalled due to resource constraints in the backend unit of the processor.",
"MetricGroup": "Cycle_Accounting",
"ScaleUnit": "1percent of cycles"
},
{
"MetricName": "branch_misprediction_ratio",
"MetricExpr": "BR_MIS_PRED_RETIRED / BR_RETIRED",
"BriefDescription": "This metric measures the ratio of branches mispredicted to the total number of branches architecturally executed. This gives an indication of the effectiveness of the branch prediction unit.",
"MetricGroup": "Miss_Ratio;Branch_Effectiveness",
"ScaleUnit": "100percent of branches"
},
{
"MetricName": "branch_mpki",
"MetricExpr": "BR_MIS_PRED_RETIRED / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of branch mispredictions per thousand instructions executed.",
"MetricGroup": "MPKI;Branch_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "dtlb_mpki",
"MetricExpr": "DTLB_WALK / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of data TLB Walks per thousand instructions executed.",
"MetricGroup": "MPKI;DTLB_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "dtlb_walk_ratio",
"MetricExpr": "DTLB_WALK / L1D_TLB",
"BriefDescription": "This metric measures the ratio of data TLB Walks to the total number of data TLB accesses. This gives an indication of the effectiveness of the data TLB accesses.",
"MetricGroup": "Miss_Ratio;DTLB_Effectiveness",
"ScaleUnit": "100percent of TLB accesses"
},
{
"MetricName": "frontend_stalled_cycles",
"MetricExpr": "STALL_FRONTEND / CPU_CYCLES * 100",
"BriefDescription": "This metric is the percentage of cycles that were stalled due to resource constraints in the frontend unit of the processor.",
"MetricGroup": "Cycle_Accounting",
"ScaleUnit": "1percent of cycles"
},
{
"MetricName": "ipc",
"MetricExpr": "INST_RETIRED / CPU_CYCLES",
"BriefDescription": "This metric measures the number of instructions retired per cycle.",
"MetricGroup": "General",
"ScaleUnit": "1per cycle"
},
{
"MetricName": "itlb_mpki",
"MetricExpr": "ITLB_WALK / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of instruction TLB Walks per thousand instructions executed.",
"MetricGroup": "MPKI;ITLB_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "itlb_walk_ratio",
"MetricExpr": "ITLB_WALK / L1I_TLB",
"BriefDescription": "This metric measures the ratio of instruction TLB Walks to the total number of instruction TLB accesses. This gives an indication of the effectiveness of the instruction TLB accesses.",
"MetricGroup": "Miss_Ratio;ITLB_Effectiveness",
"ScaleUnit": "100percent of TLB accesses"
},
{
"MetricName": "l1d_cache_miss_ratio",
"MetricExpr": "L1D_CACHE_REFILL / L1D_CACHE",
"BriefDescription": "This metric measures the ratio of level 1 data cache accesses missed to the total number of level 1 data cache accesses. This gives an indication of the effectiveness of the level 1 data cache.",
"MetricGroup": "Miss_Ratio;L1D_Cache_Effectiveness",
"ScaleUnit": "100percent of cache accesses"
},
{
"MetricName": "l1d_cache_mpki",
"MetricExpr": "L1D_CACHE_REFILL / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of level 1 data cache accesses missed per thousand instructions executed.",
"MetricGroup": "MPKI;L1D_Cache_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "l1d_tlb_miss_ratio",
"MetricExpr": "L1D_TLB_REFILL / L1D_TLB",
"BriefDescription": "This metric measures the ratio of level 1 data TLB accesses missed to the total number of level 1 data TLB accesses. This gives an indication of the effectiveness of the level 1 data TLB.",
"MetricGroup": "Miss_Ratio;DTLB_Effectiveness",
"ScaleUnit": "100percent of TLB accesses"
},
{
"MetricName": "l1d_tlb_mpki",
"MetricExpr": "L1D_TLB_REFILL / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of level 1 data TLB accesses missed per thousand instructions executed.",
"MetricGroup": "MPKI;DTLB_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "l1i_cache_miss_ratio",
"MetricExpr": "L1I_CACHE_REFILL / L1I_CACHE",
"BriefDescription": "This metric measures the ratio of level 1 instruction cache accesses missed to the total number of level 1 instruction cache accesses. This gives an indication of the effectiveness of the level 1 instruction cache.",
"MetricGroup": "Miss_Ratio;L1I_Cache_Effectiveness",
"ScaleUnit": "100percent of cache accesses"
},
{
"MetricName": "l1i_cache_mpki",
"MetricExpr": "L1I_CACHE_REFILL / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of level 1 instruction cache accesses missed per thousand instructions executed.",
"MetricGroup": "MPKI;L1I_Cache_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "l1i_tlb_miss_ratio",
"MetricExpr": "L1I_TLB_REFILL / L1I_TLB",
"BriefDescription": "This metric measures the ratio of level 1 instruction TLB accesses missed to the total number of level 1 instruction TLB accesses. This gives an indication of the effectiveness of the level 1 instruction TLB.",
"MetricGroup": "Miss_Ratio;ITLB_Effectiveness",
"ScaleUnit": "100percent of TLB accesses"
},
{
"MetricName": "l1i_tlb_mpki",
"MetricExpr": "L1I_TLB_REFILL / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of level 1 instruction TLB accesses missed per thousand instructions executed.",
"MetricGroup": "MPKI;ITLB_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "l2_cache_miss_ratio",
"MetricExpr": "L2D_CACHE_REFILL / L2D_CACHE",
"BriefDescription": "This metric measures the ratio of level 2 cache accesses missed to the total number of level 2 cache accesses. This gives an indication of the effectiveness of the level 2 cache, which is a unified cache that stores both data and instruction. Note that cache accesses in this cache are either data memory access or instruction fetch as this is a unified cache.",
"MetricGroup": "Miss_Ratio;L2_Cache_Effectiveness",
"ScaleUnit": "100percent of cache accesses"
},
{
"MetricName": "l2_cache_mpki",
"MetricExpr": "L2D_CACHE_REFILL / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of level 2 unified cache accesses missed per thousand instructions executed. Note that cache accesses in this cache are either data memory access or instruction fetch as this is a unified cache.",
"MetricGroup": "MPKI;L2_Cache_Effectiveness",
"ScaleUnit": "1MPKI"
},
{
"MetricName": "l2_tlb_miss_ratio",
"MetricExpr": "L2D_TLB_REFILL / L2D_TLB",
"BriefDescription": "This metric measures the ratio of level 2 unified TLB accesses missed to the total number of level 2 unified TLB accesses. This gives an indication of the effectiveness of the level 2 TLB.",
"MetricGroup": "Miss_Ratio;ITLB_Effectiveness;DTLB_Effectiveness",
"ScaleUnit": "100percent of TLB accesses"
},
{
"MetricName": "l2_tlb_mpki",
"MetricExpr": "L2D_TLB_REFILL / INST_RETIRED * 1000",
"BriefDescription": "This metric measures the number of level 2 unified TLB accesses missed per thousand instructions executed.",
"MetricGroup": "MPKI;ITLB_Effectiveness;DTLB_Effectiveness",
"ScaleUnit": "1MPKI"
}
]
26 changes: 26 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/retired.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"ArchStdEvent": "INST_RETIRED",
"PublicDescription": "Counts instructions that have been architecturally executed."
},
{
"ArchStdEvent": "CID_WRITE_RETIRED",
"PublicDescription": "Counts architecturally executed writes to the CONTEXTIDR_EL1 register, which usually contain the kernel PID and can be output with hardware trace."
},
{
"ArchStdEvent": "TTBR_WRITE_RETIRED",
"PublicDescription": "Counts architectural writes to TTBR0/1_EL1. If virtualization host extensions are enabled (by setting the HCR_EL2.E2H bit to 1), then accesses to TTBR0/1_EL1 that are redirected to TTBR0/1_EL2, or accesses to TTBR0/1_EL12, are counted. TTBRn registers are typically updated when the kernel is swapping user-space threads or applications."
},
{
"ArchStdEvent": "BR_RETIRED",
"PublicDescription": "Counts architecturally executed branches, whether the branch is taken or not. Instructions that explicitly write to the PC are also counted. Note that exception generating instructions, exception return instructions and context synchronization instructions are not counted."
},
{
"ArchStdEvent": "BR_MIS_PRED_RETIRED",
"PublicDescription": "Counts branches counted by BR_RETIRED which were mispredicted and caused a pipeline flush."
},
{
"ArchStdEvent": "OP_RETIRED",
"PublicDescription": "Counts micro-operations that are architecturally executed. This is a count of number of micro-operations retired from the commit queue in a single cycle."
}
]
18 changes: 18 additions & 0 deletions cmd/metrics/resources/component/neoverse-v3/spec_operation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"ArchStdEvent": "BR_MIS_PRED",
"PublicDescription": "Counts branches which are speculatively executed and mispredicted."
},
{
"ArchStdEvent": "BR_PRED",
"PublicDescription": "Counts all speculatively executed branches."
},
{
"ArchStdEvent": "INST_SPEC",
"PublicDescription": "Counts operations that have been speculatively executed."
},
{
"ArchStdEvent": "OP_SPEC",
"PublicDescription": "Counts micro-operations speculatively executed. This is the count of the number of micro-operations dispatched in a cycle."
}
]
Loading