From bad4b5a707a9ea6732a3160694c6eaf3d5054c0b Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 11:16:48 -0700 Subject: [PATCH 01/20] retire latencies Signed-off-by: Harper, Jason M --- cmd/metrics/event_defs.go | 3 + cmd/metrics/metric_defs.go | 80 +++++++++- .../GenuineIntel/gnr_retire_latency.json | 146 ++++++++++++++++++ scripts/check_events.py | 1 + scripts/perfmonevents2perfspect.py | 28 +++- scripts/perfmonmetrics2perfspect.py | 32 +++- 6 files changed, 281 insertions(+), 9 deletions(-) create mode 100644 cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json diff --git a/cmd/metrics/event_defs.go b/cmd/metrics/event_defs.go index 9eca15ab..5b5a6544 100644 --- a/cmd/metrics/event_defs.go +++ b/cmd/metrics/event_defs.go @@ -54,6 +54,9 @@ func LoadEventGroups(eventDefinitionOverridePath string, metadata Metadata) (gro defer file.Close() scanner := bufio.NewScanner(file) uncollectable := mapset.NewSet[string]() + if flagTransactionRate == 0 { + uncollectable.Add("TXN") + } var group GroupDefinition for scanner.Scan() { line := strings.TrimSpace(scanner.Text()) diff --git a/cmd/metrics/metric_defs.go b/cmd/metrics/metric_defs.go index 311ceed5..a0e5a262 100644 --- a/cmd/metrics/metric_defs.go +++ b/cmd/metrics/metric_defs.go @@ -9,6 +9,7 @@ import ( "log/slog" "os" "path/filepath" + "regexp" "strings" "github.com/Knetic/govaluate" @@ -92,12 +93,17 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st err = fmt.Errorf("unknown granularity: %s", flagGranularity) return } - coresPerSocket := fmt.Sprintf("%f", float64(metadata.CoresPerSocket)) chasPerSocket := fmt.Sprintf("%f", float64(len(metadata.UncoreDeviceIDs["cha"]))) socketCount := fmt.Sprintf("%f", float64(metadata.SocketCount)) hyperThreadingOn := fmt.Sprintf("%t", metadata.ThreadsPerCore > 1) threadsPerCore := fmt.Sprintf("%f", float64(metadata.ThreadsPerCore)) + // load retire latency constants + var retireLatencies map[string]string + if retireLatencies, err = LoadRetireLatencies(metadata); err != nil { + slog.Error("failed to load retire latencies", slog.String("error", err.Error())) + return + } // configure each metric for metricIdx := range loadedMetrics { tmpMetric := loadedMetrics[metricIdx] @@ -105,9 +111,6 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st tmpMetric.Expression = abbreviateEventName(tmpMetric.Expression) // skip metrics that use uncollectable events foundUncollectable := false - if flagTransactionRate == 0 { - uncollectableEvents = append(uncollectableEvents, "TXN") - } for _, uncollectableEvent := range uncollectableEvents { if strings.Contains(tmpMetric.Expression, uncollectableEvent) { slog.Debug("removing metric that uses uncollectable event", slog.String("metric", tmpMetric.Name), slog.String("event", uncollectableEvent)) @@ -123,8 +126,11 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st if transformed, err = transformConditional(tmpMetric.Expression); err != nil { return } + // replace "> =" with ">=" and "< =" with "<=" + transformed = strings.ReplaceAll(transformed, "> =", ">=") + transformed = strings.ReplaceAll(transformed, "< =", "<=") if transformed != tmpMetric.Expression { - slog.Debug("transformed metric", slog.String("original", tmpMetric.Name), slog.String("transformed", transformed)) + slog.Debug("transformed metric", slog.String("metric name", tmpMetric.Name), slog.String("transformed", transformed)) tmpMetric.Expression = transformed } // replace constants with their values @@ -136,6 +142,21 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, "[HYPERTHREADING_ON]", hyperThreadingOn) tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, "[CONST_THREAD_COUNT]", threadsPerCore) tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, "[TXN]", fmt.Sprintf("%f", flagTransactionRate)) + // replace retire latencies + for retireEvent, retireLatency := range retireLatencies { + // replace :retire_latency with value + tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, fmt.Sprintf("[%s:retire_latency]", retireEvent), retireLatency) + } + // replace constant numbers masquerading as variables with their values, e.g., [20] -> 20 + // there may be more than one with differing values in the expression, so use a regex to find them all + re := regexp.MustCompile(`\[(\d+)\]`) + found := re.FindAllStringSubmatchIndex(tmpMetric.Expression, -1) + for _, match := range found { + // match[2] is the start of the number, match[3] is the end of the number + number := tmpMetric.Expression[match[2]:match[3]] + // replace the whole match with the number + tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, tmpMetric.Expression[match[0]:match[1]], number) + } // get a list of the variables in the expression tmpMetric.Variables = make(map[string]int) expressionIdx := 0 @@ -239,3 +260,52 @@ func transformConditional(origIn string) (out string, err error) { } return } + +type PlatformInfo struct { + ModelName string `json:"Model name"` + CPUFamily string `json:"CPU family"` + Model string `json:"Model"` + ThreadsPerCore string `json:"Thread(s) per core"` + CoresPerSocket string `json:"Core(s) per socket"` + Sockets string `json:"Socket(s)"` + Stepping string `json:"Stepping"` + L3Cache string `json:"L3 cache"` + NUMANodes string `json:"NUMA node(s)"` + TMAVersion string `json:"TMA version"` +} + +type MetricStats struct { + Min float64 `json:"MIN"` + Max float64 `json:"MAX"` + Mean float64 `json:"MEAN"` +} + +type RetireLatency struct { + Platform PlatformInfo `json:"Platform"` + Data map[string]MetricStats `json:"Data"` +} + +func LoadRetireLatencies(metadata Metadata) (retireLatencies map[string]string, err error) { + uarch := strings.ToLower(strings.Split(metadata.Microarchitecture, "_")[0]) + uarch = strings.Split(uarch, " ")[0] + filename := fmt.Sprintf("%s_retire_latency.json", uarch) + var bytes []byte + if bytes, err = resources.ReadFile(filepath.Join("resources", "metrics", metadata.Architecture, metadata.Vendor, filename)); err != nil { + // not all architectures have retire latencies defined + err = nil + return + } + var retireLatency RetireLatency + if err = json.Unmarshal(bytes, &retireLatency); err != nil { + slog.Error("failed to unmarshal retire latencies", slog.String("error", err.Error())) + return + } + // create a map of retire latencies + retireLatencies = make(map[string]string) + for event, stats := range retireLatency.Data { + // use the mean value for the retire latency + retireLatencies[event] = fmt.Sprintf("%f", stats.Mean) + } + slog.Debug("loaded retire latencies", slog.Any("latencies", retireLatencies)) + return +} diff --git a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json new file mode 100644 index 00000000..f3932bd6 --- /dev/null +++ b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json @@ -0,0 +1,146 @@ +{ + "Platform": { + "Model name": "GENUINE INTEL(R) XEON(R)", + "CPU family": "6", + "Model": "173", + "Thread(s) per core": "1", + "Core(s) per socket": "64", + "Socket(s)": "2", + "Stepping": "0", + "L3 cache": "576 MiB (2 instances)", + "NUMA node(s)": "2", + "TMA version": "5.01-full-perf" + }, + "Data": { + "BR_MISP_RETIRED.COND_NTAKEN_COST": { + "MIN": 0, + "MAX": 888, + "MEAN": 6.11 + }, + "BR_MISP_RETIRED.COND_TAKEN_COST": { + "MIN": 0, + "MAX": 2750, + "MEAN": 5.09 + }, + "BR_MISP_RETIRED.INDIRECT_CALL_COST": { + "MIN": 0, + "MAX": 703, + "MEAN": 15.56 + }, + "BR_MISP_RETIRED.INDIRECT_COST": { + "MIN": 0, + "MAX": 1562, + "MEAN": 11.07 + }, + "BR_MISP_RETIRED.RET_COST": { + "MIN": 9, + "MAX": 1082, + "MEAN": 32.37 + }, + "FRONTEND_RETIRED.ANY_DSB_MISS": { + "MIN": 0, + "MAX": 65535, + "MEAN": 2.46 + }, + "FRONTEND_RETIRED.ITLB_MISS": { + "MIN": 0, + "MAX": 980, + "MEAN": 41.96 + }, + "FRONTEND_RETIRED.L1I_MISS": { + "MIN": 0, + "MAX": 1785, + "MEAN": 9.83 + }, + "FRONTEND_RETIRED.L2_MISS": { + "MIN": 0, + "MAX": 2854, + "MEAN": 137.41 + }, + "FRONTEND_RETIRED.MS_FLOWS": { + "MIN": 0, + "MAX": 65535, + "MEAN": 77.14 + }, + "FRONTEND_RETIRED.STLB_MISS": { + "MIN": 0, + "MAX": 754, + "MEAN": 206.85 + }, + "FRONTEND_RETIRED.UNKNOWN_BRANCH": { + "MIN": 0, + "MAX": 532, + "MEAN": 3.85 + }, + "MEM_INST_RETIRED.LOCK_LOADS": { + "MIN": 15, + "MAX": 5156, + "MEAN": 63.76 + }, + "MEM_INST_RETIRED.SPLIT_LOADS": { + "MIN": 0, + "MAX": 4704, + "MEAN": 3.97 + }, + "MEM_INST_RETIRED.SPLIT_STORES": { + "MIN": 0, + "MAX": 65535, + "MEAN": 19.0 + }, + "MEM_INST_RETIRED.STLB_HIT_LOADS": { + "MIN": 0, + "MAX": 3424, + "MEAN": 1.57 + }, + "MEM_INST_RETIRED.STLB_HIT_STORES": { + "MIN": 0, + "MAX": 65535, + "MEAN": 5.24 + }, + "MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD": { + "MIN": 0, + "MAX": 4472, + "MEAN": 353.04 + }, + "MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS": { + "MIN": 0, + "MAX": 830, + "MEAN": 125.27 + }, + "MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD": { + "MIN": 0, + "MAX": 3939, + "MEAN": 289.9 + }, + "MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM": { + "MIN": 0, + "MAX": 4146, + "MEAN": 115.83 + }, + "MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM": { + "MIN": 0, + "MAX": 3572, + "MEAN": 430.22 + }, + "MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD": { + "MIN": 0, + "MAX": 8552, + "MEAN": 125.36 + }, + "MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM": { + "MIN": 0, + "MAX": 2580, + "MEAN": 135.29 + }, + "MEM_LOAD_RETIRED.L2_HIT": { + "MIN": 0, + "MAX": 7140, + "MEAN": 5.71 + }, + "MEM_LOAD_RETIRED.L3_HIT": { + "MIN": 0, + "MAX": 5630, + "MEAN": 57.64 + } + } +} diff --git a/scripts/check_events.py b/scripts/check_events.py index f386a119..850c3528 100755 --- a/scripts/check_events.py +++ b/scripts/check_events.py @@ -56,6 +56,7 @@ def main(): "CORES_PER_SOCKET", "HYPERTHREADING_ON", "CONST_THREAD_COUNT", + "TXN", ]: if event.find(":") > 0 and event[-1] != "k": event = event[0 : event.find(":")] diff --git a/scripts/perfmonevents2perfspect.py b/scripts/perfmonevents2perfspect.py index 145ad655..9e60be30 100755 --- a/scripts/perfmonevents2perfspect.py +++ b/scripts/perfmonevents2perfspect.py @@ -31,7 +31,7 @@ events = f.readlines() # for each event name, find corresponding event in perfmon json and create a perfspect formatted event - # example: cpu/event=0x71,umask=0x00,name='TOPDOWN_FE_BOUND.ALL'/ + # example: cpu/event=0x71,umask=0x00,period=1000003,name='TOPDOWN_FE_BOUND.ALL'/ # if event name is not found in perfmon json file, it is added to a list of not found events result = [] notfound = [] @@ -39,8 +39,30 @@ e = e.strip() for p in perfmon["Events"]: if p["EventName"] == e: - # event = f"cpu/event={p['EventCode']},umask={p['UMask']},cmask={p['CMask']},name='{p['EventName']}'/" - event = f"cpu/event={p['EventCode']},umask={p['UMask']},name='{p['EventName']}'/" + eventParts = [] + unit = p.get("Unit", "cpu") + unit = unit.split(" ")[0] # take the first part of the unit if it has multiple parts + unit = unit.lower() + eventParts.append(f"{unit}/event={p['EventCode']}") + eventParts.append(f"umask={p['UMask']}") + if p.get("SampleAfterValue", "") != "": + eventParts.append(f"period={p['SampleAfterValue']}") + eventParts.append(f"name='{p['EventName']}'") + event = ",".join(eventParts) + event += "/" + # Add optional comment with counter and takenAlone info + # if counter is not "0,1,2,3,4,5,6,7" or takenAlone is "1", add them to the comment + counter = "" + takenAlone = "" + comment = "" + if p["Counter"] != "0,1,2,3,4,5,6,7": + counter = p['Counter'] + if p.get("TakenAlone", "0") == "1": + takenAlone = "[*]" + if counter != "" or takenAlone != "": + comment = f" # {counter}{takenAlone}" + if comment != "": + event = event.ljust(80) + comment result.append(event) break else: diff --git a/scripts/perfmonmetrics2perfspect.py b/scripts/perfmonmetrics2perfspect.py index 12f09d10..4ed80973 100755 --- a/scripts/perfmonmetrics2perfspect.py +++ b/scripts/perfmonmetrics2perfspect.py @@ -64,16 +64,46 @@ def translate_perfmon_json_metrics_to_perfspect(inFile): vars = {} result = [] for m in mf["Metrics"]: + # if m.get("Category") != "TMA": + # continue + # if m.get("Category") == "TMA" and m.get("Level") > 4: + # continue + # if m.get("LegacyName") and m["LegacyName"].startswith("metric_TMA_Info_"): + # continue + # if m.get("LegacyName") and m["LegacyName"].startswith("metric_TMA_Bottleneck_"): + # continue vars.clear() metric = {} - metric["name"] = m["LegacyName"] + # strip metric_ prefix from the name + if m.get("LegacyName") is None: + print(f"ERROR: Metric {m['Name']} has no LegacyName", file=sys.stderr) + continue + if m["LegacyName"].startswith("metric_"): + metric["name"] = m["LegacyName"][len("metric_") :] + else: + metric["name"] = m["LegacyName"] + # not yet :metric["description"] = m.get("BriefDescription", "") # extract the events and constants for e in m["Events"]: vars[e["Alias"]] = e["Name"] for c in m["Constants"]: vars[c["Alias"]] = c["Name"] + # count the parentheses in the formula + if m["Formula"].count("(") != m["Formula"].count(")"): + print( + f"ERROR: Perfmon metric {m['Name']} has mismatched parentheses in Formula: {m['Formula']}", + file=sys.stderr, + ) + continue # convert the formula metric["expression"] = replace_vars_in_formula(vars, m["Formula"]) + # count the parentheses in the expression + if metric["expression"].count("(") != metric["expression"].count(")"): + print( + f"ERROR: PerfSpect metric {m['Name']} has mismatched parentheses in expression: {metric['expression']}", + file=sys.stderr, + ) + continue result.append(metric) return result From 63456757ca543c9c5cbbdb76f76b640d54213d8a Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 15:13:00 -0700 Subject: [PATCH 02/20] update TMA metrics/events Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 94 ++++++--- .../metrics/x86_64/GenuineIntel/gnr.json | 178 +++++++++++++----- 2 files changed, 199 insertions(+), 73 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 34868362..6fd677d8 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -5,8 +5,6 @@ cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, cpu/event=0xa6,umask=0x02,period=2000003,name='EXE_ACTIVITY.1_PORTS_UTIL'/, -cpu/event=0xa6,umask=0x04,period=2000003,name='EXE_ACTIVITY.2_PORTS_UTIL'/, -cpu/event=0xa6,umask=0xc,period=2000003,name='EXE_ACTIVITY.2_PORTS_UTIL:u0xc'/, cpu-cycles, ref-cycles, instructions; @@ -49,19 +47,8 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xcf,umask=0x10,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED2.512B_PACKED_HALF'/, -cpu/event=0xcf,umask=0x08,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED2.256B_PACKED_HALF'/, -cpu/event=0xc7,umask=0x80,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.512B_PACKED_SINGLE'/, -cpu/event=0xc7,umask=0x40,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.512B_PACKED_DOUBLE'/, -cpu/event=0xc7,umask=0x20,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE'/, -cpu/event=0xc7,umask=0x10,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE'/, -cpu-cycles, -ref-cycles, -instructions; - cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, cpu/event=0x47,umask=0x05,cmask=0x05,period=1000003,name='MEMORY_ACTIVITY.STALLS_L2_MISS'/, -cpu/event=0x12,umask=0x20,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.STLB_HIT:c1'/, cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_ACTIVE'/, cpu/event=0xa3,umask=0x10,cmask=0x10,period=1000003,name='CYCLE_ACTIVITY.CYCLES_MEM_ANY'/, cpu/event=0xad,umask=0x80,period=500009,name='INT_MISC.CLEAR_RESTEER_CYCLES'/, @@ -71,7 +58,6 @@ ref-cycles, instructions; cpu/event=0xd1,umask=0x08,cmask=0x00,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, -cpu/event=0xb1,umask=0x01,cmask=0x03,period=2000003,name='UOPS_EXECUTED.CYCLES_GE_3'/, cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, cpu-cycles, ref-cycles, @@ -79,8 +65,6 @@ instructions; cpu/event=0xd0,umask=0x21,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.LOCK_LOADS'/, cpu/event=0xd0,umask=0x82,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, -cpu/event=0x24,umask=0xe2,cmask=0x00,period=2000003,name='L2_RQSTS.ALL_RFO'/, -cpu/event=0x24,umask=0xc2,cmask=0x00,period=2000003,name='L2_RQSTS.RFO_HIT'/, cpu-cycles, ref-cycles, instructions; @@ -93,10 +77,6 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd3,umask=0x02,cmask=0x00,period=1000003,name='MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM'/, -cpu/event=0xd3,umask=0x01,cmask=0x00,period=100007,name='MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x104004477,name='OCR.READS_TO_CORE.LOCAL_DRAM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x730004477,name='OCR.READS_TO_CORE.REMOTE_DRAM'/, cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, cpu/event=0xb7,umask=0x02,period=2000003,name='EXE.AMX_BUSY'/, cpu-cycles, @@ -106,13 +86,11 @@ instructions; cpu/event=0xd2,umask=0x02,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, cpu/event=0xd2,umask=0x04,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x90002380,name='OCR.HWPF_L3.REMOTE'/, cpu-cycles, ref-cycles, instructions; cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x84002380,name='OCR.HWPF_L3.L3_MISS_LOCAL'/, cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, cpu-cycles, @@ -130,18 +108,12 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd3,umask=0x08,cmask=0x00,period=100007,name='MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD'/, -cpu/event=0xd3,umask=0x04,cmask=0x00,period=100007,name='MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM'/, cpu/event=0x2a,umask=0x01,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, cpu/event=0x2a,umask=0x01,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, cpu-cycles:k, ref-cycles:k, instructions:k; -#C6 -cstate_core/c6-residency/; -cstate_pkg/c6-residency/; - #UPI upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; @@ -172,6 +144,72 @@ imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; +cpu/event=0xc2,umask=0x02,name='UOPS_RETIRED.SLOTS'/, +cpu/event=0xae,umask=0x01,name='UOPS_ISSUED.ANY'/; + +cpu/event=0x87,umask=0x01,name='DECODE.LCP'/, +cpu/event=0x61,umask=0x02,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, +cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_ANY'/, +cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_OK'/; + +cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_ANY'/, +cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_OK'/, +cpu/event=0x79,umask=0x20,name='IDQ.MS_CYCLES_ANY'/; + +cpu/event=0xc5,umask=0x50,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, +cpu/event=0xc5,umask=0x41,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, +cpu/event=0xc5,umask=0x42,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, +cpu/event=0xc5,umask=0xc0,name='BR_MISP_RETIRED.INDIRECT_COST'/, +cpu/event=0xc5,umask=0x48,name='BR_MISP_RETIRED.RET_COST'/; + +cpu/event=0xad,umask=0x01,name='INT_MISC.CLEARS_COUNT'/, +cpu/event=0xc3,umask=0x01,name='MACHINE_CLEARS.COUNT'/, +cpu/event=0xc3,umask=0x02,name='MACHINE_CLEARS.MEMORY_ORDERING'/, +cpu/event=0xd0,umask=0x09,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, +cpu/event=0x03,umask=0x82,name='LD_BLOCKS.STORE_FORWARD'/, +cpu/event=0xd0,umask=0x81,name='MEM_INST_RETIRED.ALL_LOADS'/, +cpu/event=0xd0,umask=0x41,name='MEM_INST_RETIRED.SPLIT_LOADS'/; + +cpu/event=0x48,umask=0x01,name='L1D_PEND_MISS.PENDING'/, +cpu/event=0x43,umask=0xfd,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, +cpu/event=0x48,umask=0x02,name='L1D_PEND_MISS.FB_FULL'/, +cpu/event=0xd2,umask=0x01,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; + +cpu/event=0xd1,umask=0x04,name='MEM_LOAD_RETIRED.L3_HIT'/, +cpu/event=0x2d,umask=0x01,name='XQ.FULL_CYCLES'/; + +cpu/event=0x48,umask=0x04,name='L1D_PEND_MISS.L2_STALLS'/, +cpu/event=0x44,umask=0x01,name='MEM_STORE_RETIRED.L2_HIT'/, +cpu/event=0x2A,umask=0x01,name='OCR.DEMAND_RFO.L3_MISS'/, +cpu/event=0xd0,umask=0x42,name='MEM_INST_RETIRED.SPLIT_STORES'/; + +cpu/event=0x2A,umask=0x01,name='OCR.STREAMING_WR.ANY_RESPONSE'/, +cpu/event=0xd0,umask=0x0a,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, +cpu/event=0x13,umask=0x10,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; + +cpu/event=0xb0,umask=0x09,name='ARITH.DIV_ACTIVE'/, +cpu/event=0xa2,umask=0x02,name='RESOURCE_STALLS.SCOREBOARD'/, +cpu/event=0xec,umask=0x20,name='CPU_CLK_UNHALTED.C02'/, +cpu/event=0xa6,umask=0x80,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, +cpu/event=0xa6,umask=0xC,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, +cpu/event=0xa3,umask=0x04,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; + +cpu/event=0xb1,umask=0x10,name='UOPS_EXECUTED.X87'/, +cpu/event=0xb1,umask=0x01,name='UOPS_EXECUTED.THREAD'/, +cpu/event=0xc7,umask=0x03,name='FP_ARITH_INST_RETIRED.SCALAR'/, +cpu/event=0xcf,umask=0x03,name='FP_ARITH_INST_RETIRED2.SCALAR'/, +cpu/event=0xc7,umask=0xfc,name='FP_ARITH_INST_RETIRED.VECTOR'/, +cpu/event=0xcf,umask=0x1c,name='FP_ARITH_INST_RETIRED2.VECTOR'/, +cpu/event=0xe7,umask=0x03,name='INT_VEC_RETIRED.ADD_128'/, +cpu/event=0xe7,umask=0x10,name='INT_VEC_RETIRED.VNNI_128'/; + +cpu/event=0xe5,umask=0x03,name='MEM_UOP_RETIRED.ANY'/, +cpu/event=0xc0,umask=0x10,name='INST_RETIRED.MACRO_FUSED'/; + +#C6 +cstate_core/c6-residency/; +cstate_pkg/c6-residency/; + #power power/energy-pkg/, power/energy-ram/; diff --git a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json index 9e7cb719..defd0460 100644 --- a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json +++ b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json @@ -179,14 +179,6 @@ "name": "% Uops delivered from legacy decode pipeline (MITE)", "expression": "100 * ([IDQ.MITE_UOPS] / ([IDQ.DSB_UOPS] + [IDQ.MITE_UOPS] + [IDQ.MS_UOPS] + [LSD.UOPS]))" }, - { - "name": "core initiated local dram read bandwidth (MB/sec)", - "expression": "([OCR.READS_TO_CORE.LOCAL_DRAM] + [OCR.HWPF_L3.L3_MISS_LOCAL]) * 64 / 1000000" - }, - { - "name": "core initiated remote dram read bandwidth (MB/sec)", - "expression": "([OCR.READS_TO_CORE.REMOTE_DRAM] + [OCR.HWPF_L3.REMOTE]) * 64 / 1000000" - }, { "name": "memory bandwidth read (MB/sec)", "expression": "([UNC_M_CAS_COUNT_SCH0.RD] + [UNC_M_CAS_COUNT_SCH1.RD]) * 64 / 1000000" @@ -272,32 +264,72 @@ "expression": "100 * ( [INT_MISC.CLEAR_RESTEER_CYCLES] / ( [cpu-cycles] ) + ( [INT_MISC.UNKNOWN_BRANCH_CYCLES] / ( [cpu-cycles] ) ) )" }, { - "name": "TMA_......Mispredicts_Resteers(%)", - "expression": "100 * ( ( ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) / ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) ) * [INT_MISC.CLEAR_RESTEER_CYCLES] / ( [cpu-cycles] ) )" + "name": "TMA_....MS_Switches(%)", + "expression": "100 * ( ( 3 ) * [UOPS_RETIRED.MS:c1:e1] / ( [UOPS_RETIRED.SLOTS] / [UOPS_ISSUED.ANY] ) / ( [cpu-cycles] ) )" }, { - "name": "TMA_......Clears_Resteers(%)", - "expression": "100 * ( ( 1 - ( ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) / ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) ) ) * [INT_MISC.CLEAR_RESTEER_CYCLES] / ( [cpu-cycles] ) )" + "name": "TMA_....LCP(%)", + "expression": "100 * ( [DECODE.LCP] / ( [cpu-cycles] ) )" }, { - "name": "TMA_......Unknown_Branches(%)", - "expression": "100 * ( [INT_MISC.UNKNOWN_BRANCH_CYCLES] / ( [cpu-cycles] ) )" + "name": "TMA_....DSB_Switches(%)", + "expression": "100 * ( [DSB2MITE_SWITCHES.PENALTY_CYCLES] / ( [cpu-cycles] ) )" }, { "name": "TMA_..Fetch_Bandwidth(%)", - "expression": "100 * ( max( ( 0 ) , ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) - ( ( [PERF_METRICS.FETCH_LATENCY] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) ) ) ) )" + "expression": "100 * ( max( 0 , ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) - ( ( [PERF_METRICS.FETCH_LATENCY] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) ) ) )" + }, + { + "name": "TMA_....MITE(%)", + "expression": "100 * ( ( [IDQ.MITE_CYCLES_ANY] - [IDQ.MITE_CYCLES_OK] ) / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) / 2 )" + }, + { + "name": "TMA_....DSB(%)", + "expression": "100 * ( ( [IDQ.DSB_CYCLES_ANY] - [IDQ.DSB_CYCLES_OK] ) / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) / 2 )" + }, + { + "name": "TMA_....MS(%)", + "expression": "100 * ( max( [IDQ.MS_CYCLES_ANY] , [UOPS_RETIRED.MS:c1] / ( [UOPS_RETIRED.SLOTS] / [UOPS_ISSUED.ANY] ) ) / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) / 2 )" }, { "name": "TMA_Bad_Speculation(%)", - "expression": "100 * ( max( ( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) , ( 0 ) ) )" + "expression": "100 * ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) )" }, { "name": "TMA_..Branch_Mispredicts(%)", "expression": "100 * ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) )" }, + { + "name": "TMA_....Cond_NT_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.COND_NTAKEN_COST] * [BR_MISP_RETIRED.COND_NTAKEN_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Cond_TK_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.COND_TAKEN_COST] * [BR_MISP_RETIRED.COND_TAKEN_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Ind_Call_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.INDIRECT_CALL_COST] * [BR_MISP_RETIRED.INDIRECT_CALL_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Ind_Jump_Mispredicts(%)", + "expression": "100 * ( max( ( ( [BR_MISP_RETIRED.INDIRECT_COST] * [BR_MISP_RETIRED.INDIRECT_COST:retire_latency] ) - ( [BR_MISP_RETIRED.INDIRECT_CALL_COST] * [BR_MISP_RETIRED.INDIRECT_CALL_COST:retire_latency] ) ) / ( [cpu-cycles] ) , 0 ) )" + }, + { + "name": "TMA_....Ret_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.RET_COST] * [BR_MISP_RETIRED.RET_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Other_Mispredicts(%)", + "expression": "100 * ( max( ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( 1 - [BR_MISP_RETIRED.ALL_BRANCHES] / ( [INT_MISC.CLEARS_COUNT] - [MACHINE_CLEARS.COUNT] ) ) , 0.0001 ) )" + }, { "name": "TMA_..Machine_Clears(%)", - "expression": "100 * ( max( ( 0 ) , ( ( max( ( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) , ( 0 ) ) ) - ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) )" + "expression": "100 * ( max( 0 , ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) - ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) )" + }, + { + "name": "TMA_....Other_Nukes(%)", + "expression": "100 * ( max( ( max( 0 , ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) - ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * ( 1 - [MACHINE_CLEARS.MEMORY_ORDERING] / [MACHINE_CLEARS.COUNT] ) , 0.0001 ) )" }, { "name": "TMA_Backend_Bound(%)", @@ -309,15 +341,31 @@ }, { "name": "TMA_....L1_Bound(%)", - "expression": "100 * ( max( ( ( [EXE_ACTIVITY.BOUND_ON_LOADS] - [MEMORY_ACTIVITY.STALLS_L1D_MISS] ) / ( [cpu-cycles] ) ) , ( 0 ) ) )" + "expression": "100 * ( max( ( [EXE_ACTIVITY.BOUND_ON_LOADS] - [MEMORY_ACTIVITY.STALLS_L1D_MISS] ) / ( [cpu-cycles] ) , 0 ) )" }, { "name": "TMA_......DTLB_Load(%)", - "expression": "100 * ( min( ( ( 7 ) * [DTLB_LOAD_MISSES.STLB_HIT:c1] + [DTLB_LOAD_MISSES.WALK_ACTIVE] ) , ( max( ( [CYCLE_ACTIVITY.CYCLES_MEM_ANY] - [MEMORY_ACTIVITY.CYCLES_L1D_MISS] ) , ( 0 ) ) ) ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.STLB_HIT_LOADS] * [MEM_INST_RETIRED.STLB_HIT_LOADS:retire_latency] ) , [MEM_INST_RETIRED.STLB_HIT_LOADS] * ( 7 ) ) if ( [MEM_INST_RETIRED.STLB_HIT_LOADS:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.STLB_HIT_LOADS] * ( 7 ) ) ) / ( [cpu-cycles] ) + ( [DTLB_LOAD_MISSES.WALK_ACTIVE] / ( [cpu-cycles] ) ) )" + }, + { + "name": "TMA_......Store_Fwd_Blk(%)", + "expression": "100 * ( 13 * [LD_BLOCKS.STORE_FORWARD] / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......L1_Latency_Dependency(%)", + "expression": "100 * ( min( 2 * ( [MEM_INST_RETIRED.ALL_LOADS] - [MEM_LOAD_RETIRED.FB_HIT] - [MEM_LOAD_RETIRED.L1_MISS] ) * 20 / 100 , max( [CYCLE_ACTIVITY.CYCLES_MEM_ANY] - [MEMORY_ACTIVITY.CYCLES_L1D_MISS] , 0 ) ) / ( [cpu-cycles] ) )" }, { "name": "TMA_......Lock_Latency(%)", - "expression": "100 * ( ( 16 * max( ( 0 ) , ( [MEM_INST_RETIRED.LOCK_LOADS] - [L2_RQSTS.ALL_RFO] ) ) + ( [MEM_INST_RETIRED.LOCK_LOADS] / [MEM_INST_RETIRED.ALL_STORES] ) * ( ( 10 ) * [L2_RQSTS.RFO_HIT] + ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO] - 0 ) ) ) ) ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( [MEM_INST_RETIRED.LOCK_LOADS] * [MEM_INST_RETIRED.LOCK_LOADS:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......Split_Loads(%)", + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.SPLIT_LOADS] * [MEM_INST_RETIRED.SPLIT_LOADS:retire_latency] ) , [MEM_INST_RETIRED.SPLIT_LOADS] * ( [L1D_PEND_MISS.PENDING] / [MEM_LOAD_COMPLETED.L1_MISS_ANY] ) ) if ( [MEM_INST_RETIRED.SPLIT_LOADS:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.SPLIT_LOADS] * ( [L1D_PEND_MISS.PENDING] / [MEM_LOAD_COMPLETED.L1_MISS_ANY] ) ) ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......FB_Full(%)", + "expression": "100 * ( [L1D_PEND_MISS.FB_FULL] / ( [cpu-cycles] ) )" }, { "name": "TMA_....L2_Bound(%)", @@ -327,49 +375,77 @@ "name": "TMA_....L3_Bound(%)", "expression": "100 * ( ( [MEMORY_ACTIVITY.STALLS_L2_MISS] - [MEMORY_ACTIVITY.STALLS_L3_MISS] ) / ( [cpu-cycles] ) )" }, + { + "name": "TMA_......Contested_Accesses(%)", + "expression": "100 * ( ( ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) + ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) * ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] / ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] + [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD] ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + }, { "name": "TMA_......Data_Sharing(%)", - "expression": "100 * ( ( ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) * ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] + [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 1 - ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] / ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] + [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD] ) ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) + ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) * ( 1 - ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] / ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] + [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD] ) ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......L3_Hit_Latency(%)", + "expression": "100 * ( ( min( ( [MEM_LOAD_RETIRED.L3_HIT] * [MEM_LOAD_RETIRED.L3_HIT:retire_latency] ) , [MEM_LOAD_RETIRED.L3_HIT] * ( 37 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_RETIRED.L3_HIT:retire_latency] >= 0 ) else ( [MEM_LOAD_RETIRED.L3_HIT] * ( 37 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......SQ_Full(%)", + "expression": "100 * ( ( [XQ.FULL_CYCLES] + [L1D_PEND_MISS.L2_STALLS] ) / ( [cpu-cycles] ) )" }, { "name": "TMA_....DRAM_Bound(%)", - "expression": "100 * ( ( ( [MEMORY_ACTIVITY.STALLS_L3_MISS] / ( [cpu-cycles] ) ) - ( ( ( ( ( 1 - ( ( 19 * ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + 10 * ( ( [MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) ) ) / ( ( 19 * ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + 10 * ( ( [MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) ) ) + ( 25 * ( 1 * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + 33 * ( 1 * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) ) ) ) ) * ( [MEMORY_ACTIVITY.STALLS_L3_MISS] / ( [cpu-cycles] ) ) ) ) if ( ( ( 1000000 ) * 1 > [MEM_LOAD_RETIRED.L1_MISS] ) ) else 0 ) ) ) )" + "expression": "100 * ( ( [MEMORY_ACTIVITY.STALLS_L3_MISS] / ( [cpu-cycles] ) ) )" }, { "name": "TMA_......MEM_Bandwidth(%)", - "expression": "100 * ( ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] - 0 ) ) ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] ) ) / ( [cpu-cycles] ) )" }, { "name": "TMA_......MEM_Latency(%)", - "expression": "100 * ( ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD] - 0 ) ) ) / ( [cpu-cycles] ) - ( ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] - 0 ) ) ) / ( [cpu-cycles] ) ) )" + "expression": "100 * ( ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD] ) ) / ( [cpu-cycles] ) - ( ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] ) ) / ( [cpu-cycles] ) ) )" }, { "name": "TMA_....Store_Bound(%)", "expression": "100 * ( [EXE_ACTIVITY.BOUND_ON_STORES] / ( [cpu-cycles] ) )" }, + { + "name": "TMA_......Store_Latency(%)", + "expression": "100 * ( ( ( [MEM_STORE_RETIRED.L2_HIT] * ( 10 ) * ( 1 - ( [MEM_INST_RETIRED.LOCK_LOADS] / [MEM_INST_RETIRED.ALL_STORES] ) ) ) + ( 1 - ( [MEM_INST_RETIRED.LOCK_LOADS] / [MEM_INST_RETIRED.ALL_STORES] ) ) * ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO] ) ) ) / ( [cpu-cycles] ) )" + }, { "name": "TMA_......False_Sharing(%)", - "expression": "100 * ( ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] / ( [cpu-cycles] ) )" + "expression": "100 * ( ( ( 170 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_MISS:ocr_msr_val=0x103b800002] + ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......Split_Stores(%)", + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.SPLIT_STORES] * [MEM_INST_RETIRED.SPLIT_STORES:retire_latency] ) , [MEM_INST_RETIRED.SPLIT_STORES] * 1 ) if ( [MEM_INST_RETIRED.SPLIT_STORES:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.SPLIT_STORES] * 1 ) ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......Streaming_Stores(%)", + "expression": "100 * ( 9 * [OCR.STREAMING_WR.ANY_RESPONSE] / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......DTLB_Store(%)", + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.STLB_HIT_STORES] * [MEM_INST_RETIRED.STLB_HIT_STORES:retire_latency] ) , [MEM_INST_RETIRED.STLB_HIT_STORES] * ( 7 ) ) if ( [MEM_INST_RETIRED.STLB_HIT_STORES:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.STLB_HIT_STORES] * ( 7 ) ) ) / ( [cpu-cycles] ) + ( [DTLB_STORE_MISSES.WALK_ACTIVE] / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) ) )" }, { "name": "TMA_..Core_Bound(%)", - "expression": "100 * ( max( ( 0 ) , ( ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.MEMORY_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) )" + "expression": "100 * ( max( 0 , ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.MEMORY_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) )" }, { - "name": "TMA_........AMX_Busy(%)", - "expression": "100 * ( [EXE.AMX_BUSY] / ( [CPU_CLK_UNHALTED.DISTRIBUTED] ) )" + "name": "TMA_....Divider(%)", + "expression": "100 * ( [ARITH.DIV_ACTIVE] / ( [cpu-cycles] ) )" }, { - "name": "TMA_......Ports_Utilized_1(%)", - "expression": "100 * ( [EXE_ACTIVITY.1_PORTS_UTIL] / ( [cpu-cycles] ) )" + "name": "TMA_....Serializing_Operation(%)", + "expression": "100 * ( [RESOURCE_STALLS.SCOREBOARD] / ( [cpu-cycles] ) + ( [CPU_CLK_UNHALTED.C02] / ( [cpu-cycles] ) ) )" }, { - "name": "TMA_......Ports_Utilized_2(%)", - "expression": "100 * ( [EXE_ACTIVITY.2_PORTS_UTIL] / ( [cpu-cycles] ) )" + "name": "TMA_....AMX_Busy(%)", + "expression": "100 * ( [EXE.AMX_BUSY] / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) )" }, { - "name": "TMA_......Ports_Utilized_3m(%)", - "expression": "100 * ( [UOPS_EXECUTED.CYCLES_GE_3] / ( [cpu-cycles] ) )" + "name": "TMA_....Ports_Utilization(%)", + "expression": "100 * ( ( ( max( [EXE_ACTIVITY.EXE_BOUND_0_PORTS] - [RESOURCE_STALLS.SCOREBOARD] , 0 ) / ( [cpu-cycles] ) ) * ( [cpu-cycles] ) + ( [EXE_ACTIVITY.1_PORTS_UTIL] + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [EXE_ACTIVITY.2_3_PORTS_UTIL] ) ) / ( [cpu-cycles] ) if ( [ARITH.DIV_ACTIVE] < ( [CYCLE_ACTIVITY.STALLS_TOTAL] - [EXE_ACTIVITY.BOUND_ON_LOADS] ) ) else ( [EXE_ACTIVITY.1_PORTS_UTIL] + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [EXE_ACTIVITY.2_3_PORTS_UTIL] ) / ( [cpu-cycles] ) )" }, { "name": "TMA_Retiring(%)", @@ -377,30 +453,42 @@ }, { "name": "TMA_..Light_Operations(%)", - "expression": "100 * ( max( ( 0 ) , ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) )" + "expression": "100 * ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) )" + }, + { + "name": "TMA_....FP_Arith(%)", + "expression": "100 * ( ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [UOPS_EXECUTED.X87] / [UOPS_EXECUTED.THREAD] ) + ( ( [FP_ARITH_INST_RETIRED.SCALAR] + [FP_ARITH_INST_RETIRED2.SCALAR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [FP_ARITH_INST_RETIRED.VECTOR] + [FP_ARITH_INST_RETIRED2.VECTOR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) )" + }, + { + "name": "TMA_....Int_Operations(%)", + "expression": "100 * ( ( ( [INT_VEC_RETIRED.ADD_128] + [INT_VEC_RETIRED.VNNI_128] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [INT_VEC_RETIRED.ADD_256] + [INT_VEC_RETIRED.MUL_256] + [INT_VEC_RETIRED.VNNI_256] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) )" + }, + { + "name": "TMA_....Memory_Operations(%)", + "expression": "100 * ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [MEM_UOP_RETIRED.ANY] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" }, { - "name": "TMA_........FP_Vector_256b(%)", - "expression": "100 * ( ( [FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE] + [FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE] + [FP_ARITH_INST_RETIRED2.256B_PACKED_HALF] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" + "name": "TMA_....Fused_Instructions(%)", + "expression": "100 * ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [INST_RETIRED.MACRO_FUSED] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" }, { - "name": "TMA_........FP_Vector_512b(%)", - "expression": "100 * ( ( [FP_ARITH_INST_RETIRED.512B_PACKED_DOUBLE] + [FP_ARITH_INST_RETIRED.512B_PACKED_SINGLE] + [FP_ARITH_INST_RETIRED2.512B_PACKED_HALF] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" + "name": "TMA_....Non_Fused_Branches(%)", + "expression": "100 * ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * ( [BR_INST_RETIRED.ALL_BRANCHES] - [INST_RETIRED.MACRO_FUSED] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" }, { - "name": "TMA_......Int_Vector_256b(%)", - "expression": "100 * ( ( [INT_VEC_RETIRED.ADD_256] + [INT_VEC_RETIRED.MUL_256] + [INT_VEC_RETIRED.VNNI_256] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" + "name": "TMA_....Other_Light_Ops(%)", + "expression": "100 * ( max( 0 , ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) - ( ( ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [UOPS_EXECUTED.X87] / [UOPS_EXECUTED.THREAD] ) + ( ( [FP_ARITH_INST_RETIRED.SCALAR] + [FP_ARITH_INST_RETIRED2.SCALAR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [FP_ARITH_INST_RETIRED.VECTOR] + [FP_ARITH_INST_RETIRED2.VECTOR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) ) + ( ( ( [INT_VEC_RETIRED.ADD_128] + [INT_VEC_RETIRED.VNNI_128] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [INT_VEC_RETIRED.ADD_256] + [INT_VEC_RETIRED.MUL_256] + [INT_VEC_RETIRED.VNNI_256] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) ) + ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [MEM_UOP_RETIRED.ANY] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [INST_RETIRED.MACRO_FUSED] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * ( [BR_INST_RETIRED.ALL_BRANCHES] - [INST_RETIRED.MACRO_FUSED] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) ) ) )" }, { "name": "TMA_..Heavy_Operations(%)", "expression": "100 * ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) )" }, { - "name": "TMA_....Microcode_Sequencer(%)", - "expression": "100 * ( [UOPS_RETIRED.MS] / ( [TOPDOWN.SLOTS] ) )" + "name": "TMA_....Few_Uops_Instructions(%)", + "expression": "100 * ( max( 0 , ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [UOPS_RETIRED.MS] / ( [TOPDOWN.SLOTS] ) ) ) )" }, { - "name": "TMA_Info_Thread_IPC", - "expression": "[instructions] / ( [cpu-cycles] )" + "name": "TMA_....Microcode_Sequencer(%)", + "expression": "100 * ( [UOPS_RETIRED.MS] / ( [TOPDOWN.SLOTS] ) )" } ] \ No newline at end of file From 29ca16b5236c9ce900207237094d2b56477c4fb2 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 18:49:14 -0700 Subject: [PATCH 03/20] reorder Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 6fd677d8..3a1ea102 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -114,36 +114,6 @@ cpu-cycles:k, ref-cycles:k, instructions:k; -#UPI -upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; - -#CHA (Cache) -cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, -cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, -cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; - -cha/event=0x35,umask=0xC816FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, -cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, -cha/event=0x35,umask=0xC896FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, -cha/event=0x35,umask=0xC8977E01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; - -cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, -cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, -cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, -cha/event=0x36,umask=0xC817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; - -#CHA (IO Bandwidth) -cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, -cha/event=0x35,umask=0xCC43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, -cha/event=0x35,umask=0xCD43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, -cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; - -#IMC (memory read/writes) -imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, -imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, -imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, -imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; - cpu/event=0xc2,umask=0x02,name='UOPS_RETIRED.SLOTS'/, cpu/event=0xae,umask=0x01,name='UOPS_ISSUED.ANY'/; @@ -206,6 +176,36 @@ cpu/event=0xe7,umask=0x10,name='INT_VEC_RETIRED.VNNI_128'/; cpu/event=0xe5,umask=0x03,name='MEM_UOP_RETIRED.ANY'/, cpu/event=0xc0,umask=0x10,name='INST_RETIRED.MACRO_FUSED'/; +#UPI +upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; + +#CHA (Cache) +cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, +cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, +cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; + +cha/event=0x35,umask=0xC816FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, +cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, +cha/event=0x35,umask=0xC896FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, +cha/event=0x35,umask=0xC8977E01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; + +cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, +cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, +cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, +cha/event=0x36,umask=0xC817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; + +#CHA (IO Bandwidth) +cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, +cha/event=0x35,umask=0xCC43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, +cha/event=0x35,umask=0xCD43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, +cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; + +#IMC (memory read/writes) +imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, +imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, +imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, +imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; + #C6 cstate_core/c6-residency/; cstate_pkg/c6-residency/; From 2a1f1cb9e42e49df11aa4e6b2ac5475aa9f480e6 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 19:33:51 -0700 Subject: [PATCH 04/20] support comments at end of event line Signed-off-by: Harper, Jason M --- cmd/metrics/event_defs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/metrics/event_defs.go b/cmd/metrics/event_defs.go index 5b5a6544..b790f921 100644 --- a/cmd/metrics/event_defs.go +++ b/cmd/metrics/event_defs.go @@ -63,6 +63,12 @@ func LoadEventGroups(eventDefinitionOverridePath string, metadata Metadata) (gro if len(line) == 0 || line[0] == '#' { continue } + // strip end of line comment + if idx := strings.Index(line, "#"); idx != -1 { + line = line[:idx] + } + // remove trailing spaces + line = strings.TrimSpace(line) var event EventDefinition if event, err = parseEventDefinition(line[:len(line)-1]); err != nil { return From 286a1fad1f306ad0a48082473b511ee60f49488c Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 19:34:02 -0700 Subject: [PATCH 05/20] add cmask and period Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 212 +++++++++--------- 1 file changed, 107 insertions(+), 105 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 3a1ea102..d788f679 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -1,37 +1,37 @@ # GraniteRapids event list -cpu/event=0x51,umask=0x01,period=100003,name='L1D.REPLACEMENT'/, -cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, -cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, -cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, +cpu/event=0x51,umask=0x01,period=100003,name='L1D.REPLACEMENT'/, # 0,1,2,3 +cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, # 0,1,2,3 +cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, # 0,1,2,3 +cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, # 0,1,2,3 cpu/event=0xa6,umask=0x02,period=2000003,name='EXE_ACTIVITY.1_PORTS_UTIL'/, cpu-cycles, ref-cycles, instructions; -cpu/event=0xd1,umask=0x10,period=100021,name='MEM_LOAD_RETIRED.L2_MISS'/, -cpu/event=0x24,umask=0x24,period=200003,name='L2_RQSTS.CODE_RD_MISS'/, -cpu/event=0x11,umask=0x0e,period=100003,name='ITLB_MISSES.WALK_COMPLETED'/, -cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, +cpu/event=0xd1,umask=0x10,period=100021,name='MEM_LOAD_RETIRED.L2_MISS'/, # 0,1,2,3 +cpu/event=0x24,umask=0x24,period=200003,name='L2_RQSTS.CODE_RD_MISS'/, # 0,1,2,3 +cpu/event=0x11,umask=0x0e,period=100003,name='ITLB_MISSES.WALK_COMPLETED'/, # 0,1,2,3 +cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, # 0,1,2,3 cpu/event=0xa6,umask=0x40,cmask=0x02,period=1000003,name='EXE_ACTIVITY.BOUND_ON_STORES'/, cpu/event=0xa6,umask=0x21,cmask=0x05,period=2000003,name='EXE_ACTIVITY.BOUND_ON_LOADS'/, cpu/event=0xad,umask=0x10,period=1000003,name='INT_MISC.UOP_DROPPING'/, -cpu/event=0xad,umask=0x40,period=1000003,name='INT_MISC.UNKNOWN_BRANCH_CYCLES'/, +cpu/event=0xad,umask=0x40,period=1000003,name='INT_MISC.UNKNOWN_BRANCH_CYCLES'/, # [*] cpu-cycles, ref-cycles, instructions; -cpu/event=0xc4,umask=0x00,period=100003,name='BR_INST_RETIRED.ALL_BRANCHES'/, -cpu/event=0xc5,umask=0x00,period=100003,name='BR_MISP_RETIRED.ALL_BRANCHES'/, -cpu/event=0x12,umask=0x0e,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED'/, -cpu/event=0x12,umask=0x04,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M'/, -cpu/event=0x13,umask=0x0e,period=100003,name='DTLB_STORE_MISSES.WALK_COMPLETED'/, -cpu/event=0xd1,umask=0x02,period=200003,name='MEM_LOAD_RETIRED.L2_HIT'/, +cpu/event=0xc4,umask=0x00,period=400009,name='BR_INST_RETIRED.ALL_BRANCHES'/, +cpu/event=0xc5,umask=0x00,period=400009,name='BR_MISP_RETIRED.ALL_BRANCHES'/, +cpu/event=0x12,umask=0x0e,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED'/, # 0,1,2,3 +cpu/event=0x12,umask=0x04,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M'/, # 0,1,2,3 +cpu/event=0x13,umask=0x0e,period=100003,name='DTLB_STORE_MISSES.WALK_COMPLETED'/, # 0,1,2,3 +cpu/event=0xd1,umask=0x02,period=200003,name='MEM_LOAD_RETIRED.L2_HIT'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x00,umask=0x04,period=10000003,name='TOPDOWN.SLOTS'/, +cpu/event=0x00,umask=0x04,period=10000003,name='TOPDOWN.SLOTS'/, # Fixed counter 3 cpu/event=0x00,umask=0x81,period=10000003,name='PERF_METRICS.BAD_SPECULATION'/, cpu/event=0x00,umask=0x83,period=10000003,name='PERF_METRICS.BACKEND_BOUND'/, cpu/event=0x00,umask=0x82,period=10000003,name='PERF_METRICS.FRONTEND_BOUND'/, @@ -40,16 +40,16 @@ cpu/event=0x00,umask=0x86,period=10000003,name='PERF_METRICS.FETCH_LATENCY'/, cpu/event=0x00,umask=0x87,period=10000003,name='PERF_METRICS.MEMORY_BOUND'/, cpu/event=0x00,umask=0x85,period=10000003,name='PERF_METRICS.BRANCH_MISPREDICTS'/, cpu/event=0x00,umask=0x84,period=10000003,name='PERF_METRICS.HEAVY_OPERATIONS'/, -cpu/event=0x47,umask=0x09,cmask=0x09,period=1000003,name='MEMORY_ACTIVITY.STALLS_L3_MISS'/, -cpu/event=0x80,umask=0x04,period=500009,name='ICACHE_DATA.STALLS'/, -cpu/event=0x83,umask=0x04,period=200003,name='ICACHE_TAG.STALLS'/, +cpu/event=0x47,umask=0x09,cmask=0x09,period=1000003,name='MEMORY_ACTIVITY.STALLS_L3_MISS'/, # 0,1,2,3 +cpu/event=0x80,umask=0x04,period=500009,name='ICACHE_DATA.STALLS'/, # 0,1,2,3 +cpu/event=0x83,umask=0x04,period=200003,name='ICACHE_TAG.STALLS'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, -cpu/event=0x47,umask=0x05,cmask=0x05,period=1000003,name='MEMORY_ACTIVITY.STALLS_L2_MISS'/, -cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_ACTIVE'/, +cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, # 0,1,2,3 +cpu/event=0x47,umask=0x05,cmask=0x05,period=1000003,name='MEMORY_ACTIVITY.STALLS_L2_MISS'/, # 0,1,2,3 +cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_ACTIVE'/, # 0,1,2,3 cpu/event=0xa3,umask=0x10,cmask=0x10,period=1000003,name='CYCLE_ACTIVITY.CYCLES_MEM_ANY'/, cpu/event=0xad,umask=0x80,period=500009,name='INT_MISC.CLEAR_RESTEER_CYCLES'/, cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, @@ -57,22 +57,24 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd1,umask=0x08,cmask=0x00,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, -cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, +cpu/event=0xd1,umask=0x08,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, # 0,1,2,3 +cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, # [*] cpu-cycles, ref-cycles, instructions; -cpu/event=0xd0,umask=0x21,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.LOCK_LOADS'/, -cpu/event=0xd0,umask=0x82,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, +cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1'/, # [*] +cpu/event=0xd0,umask=0x21,period=100007,name='MEM_INST_RETIRED.LOCK_LOADS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x82,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, -cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, -cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, -cpu/event=0xd1,umask=0x40,cmask=0x00,period=100007,name='MEM_LOAD_RETIRED.FB_HIT'/, +cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1:e1'/, # [*] +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 +cpu/event=0x2b,umask=0x01,period=100003,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, # 0,1,2,3 +cpu/event=0xd1,umask=0x40,period=100007,name='MEM_LOAD_RETIRED.FB_HIT'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; @@ -83,98 +85,98 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd2,umask=0x02,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, -cpu/event=0xd2,umask=0x04,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, -cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, +cpu/event=0xd2,umask=0x02,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, # 0,1,2,3 +cpu/event=0xd2,umask=0x04,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, # 0,1,2,3 +cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, -cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, # 0,1,2,3 cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, cpu-cycles, ref-cycles, instructions; -cpu/event=0xe7,umask=0x0c,cmask=0x00,period=100003,name='INT_VEC_RETIRED.ADD_256'/, -cpu/event=0xe7,umask=0x20,cmask=0x00,period=100003,name='INT_VEC_RETIRED.VNNI_256'/, -cpu/event=0xe7,umask=0x80,cmask=0x00,period=100003,name='INT_VEC_RETIRED.MUL_256'/, -cpu/event=0x79,umask=0x08,cmask=0x00,period=2000003,name='IDQ.DSB_UOPS'/, -cpu/event=0x79,umask=0x04,period=100003,name='IDQ.MITE_UOPS'/, -cpu/event=0x79,umask=0x20,period=100003,name='IDQ.MS_UOPS'/, -cpu/event=0xa8,umask=0x01,cmask=0x00,period=2000003,name='LSD.UOPS'/, +cpu/event=0xe7,umask=0x0c,period=1000003,name='INT_VEC_RETIRED.ADD_256'/, +cpu/event=0xe7,umask=0x20,period=1000003,name='INT_VEC_RETIRED.VNNI_256'/, +cpu/event=0xe7,umask=0x80,period=1000003,name='INT_VEC_RETIRED.MUL_256'/, +cpu/event=0x79,umask=0x08,period=2000003,name='IDQ.DSB_UOPS'/, # 0,1,2,3 +cpu/event=0x79,umask=0x04,period=2000003,name='IDQ.MITE_UOPS'/, # 0,1,2,3 +cpu/event=0x79,umask=0x20,period=1000003,name='IDQ.MS_UOPS'/, # 0,1,2,3 +cpu/event=0xa8,umask=0x01,period=2000003,name='LSD.UOPS'/, cpu-cycles, ref-cycles, instructions; -cpu/event=0x2a,umask=0x01,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 cpu-cycles:k, ref-cycles:k, instructions:k; -cpu/event=0xc2,umask=0x02,name='UOPS_RETIRED.SLOTS'/, -cpu/event=0xae,umask=0x01,name='UOPS_ISSUED.ANY'/; - -cpu/event=0x87,umask=0x01,name='DECODE.LCP'/, -cpu/event=0x61,umask=0x02,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, -cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_ANY'/, -cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_OK'/; - -cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_ANY'/, -cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_OK'/, -cpu/event=0x79,umask=0x20,name='IDQ.MS_CYCLES_ANY'/; - -cpu/event=0xc5,umask=0x50,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, -cpu/event=0xc5,umask=0x41,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, -cpu/event=0xc5,umask=0x42,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, -cpu/event=0xc5,umask=0xc0,name='BR_MISP_RETIRED.INDIRECT_COST'/, -cpu/event=0xc5,umask=0x48,name='BR_MISP_RETIRED.RET_COST'/; - -cpu/event=0xad,umask=0x01,name='INT_MISC.CLEARS_COUNT'/, -cpu/event=0xc3,umask=0x01,name='MACHINE_CLEARS.COUNT'/, -cpu/event=0xc3,umask=0x02,name='MACHINE_CLEARS.MEMORY_ORDERING'/, -cpu/event=0xd0,umask=0x09,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, -cpu/event=0x03,umask=0x82,name='LD_BLOCKS.STORE_FORWARD'/, -cpu/event=0xd0,umask=0x81,name='MEM_INST_RETIRED.ALL_LOADS'/, -cpu/event=0xd0,umask=0x41,name='MEM_INST_RETIRED.SPLIT_LOADS'/; - -cpu/event=0x48,umask=0x01,name='L1D_PEND_MISS.PENDING'/, -cpu/event=0x43,umask=0xfd,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, -cpu/event=0x48,umask=0x02,name='L1D_PEND_MISS.FB_FULL'/, -cpu/event=0xd2,umask=0x01,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; - -cpu/event=0xd1,umask=0x04,name='MEM_LOAD_RETIRED.L3_HIT'/, -cpu/event=0x2d,umask=0x01,name='XQ.FULL_CYCLES'/; - -cpu/event=0x48,umask=0x04,name='L1D_PEND_MISS.L2_STALLS'/, -cpu/event=0x44,umask=0x01,name='MEM_STORE_RETIRED.L2_HIT'/, -cpu/event=0x2A,umask=0x01,name='OCR.DEMAND_RFO.L3_MISS'/, -cpu/event=0xd0,umask=0x42,name='MEM_INST_RETIRED.SPLIT_STORES'/; - -cpu/event=0x2A,umask=0x01,name='OCR.STREAMING_WR.ANY_RESPONSE'/, -cpu/event=0xd0,umask=0x0a,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, -cpu/event=0x13,umask=0x10,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; - -cpu/event=0xb0,umask=0x09,name='ARITH.DIV_ACTIVE'/, -cpu/event=0xa2,umask=0x02,name='RESOURCE_STALLS.SCOREBOARD'/, -cpu/event=0xec,umask=0x20,name='CPU_CLK_UNHALTED.C02'/, -cpu/event=0xa6,umask=0x80,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, -cpu/event=0xa6,umask=0xC,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, -cpu/event=0xa3,umask=0x04,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; - -cpu/event=0xb1,umask=0x10,name='UOPS_EXECUTED.X87'/, -cpu/event=0xb1,umask=0x01,name='UOPS_EXECUTED.THREAD'/, -cpu/event=0xc7,umask=0x03,name='FP_ARITH_INST_RETIRED.SCALAR'/, -cpu/event=0xcf,umask=0x03,name='FP_ARITH_INST_RETIRED2.SCALAR'/, -cpu/event=0xc7,umask=0xfc,name='FP_ARITH_INST_RETIRED.VECTOR'/, -cpu/event=0xcf,umask=0x1c,name='FP_ARITH_INST_RETIRED2.VECTOR'/, -cpu/event=0xe7,umask=0x03,name='INT_VEC_RETIRED.ADD_128'/, -cpu/event=0xe7,umask=0x10,name='INT_VEC_RETIRED.VNNI_128'/; - -cpu/event=0xe5,umask=0x03,name='MEM_UOP_RETIRED.ANY'/, -cpu/event=0xc0,umask=0x10,name='INST_RETIRED.MACRO_FUSED'/; +cpu/event=0xc2,umask=0x02,period=2000003,name='UOPS_RETIRED.SLOTS'/, +cpu/event=0xae,umask=0x01,period=2000003,name='UOPS_ISSUED.ANY'/; + +cpu/event=0x87,umask=0x01,period=500009,name='DECODE.LCP'/, # 0,1,2,3 +cpu/event=0x61,umask=0x02,period=100003,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, # 0,1,2,3 +cpu/event=0x79,umask=0x04,cmask=0x01,period=2000003,name='IDQ.MITE_CYCLES_ANY'/, # 0,1,2,3 +cpu/event=0x79,umask=0x04,cmask=0x06,period=2000003,name='IDQ.MITE_CYCLES_OK'/; # 0,1,2,3 + +cpu/event=0x79,umask=0x08,cmask=0x01,period=2000003,name='IDQ.DSB_CYCLES_ANY'/, # 0,1,2,3 +cpu/event=0x79,umask=0x08,cmask=0x06,period=2000003,name='IDQ.DSB_CYCLES_OK'/, # 0,1,2,3 +cpu/event=0x79,umask=0x20,cmask=0x01,period=2000003,name='IDQ.MS_CYCLES_ANY'/; # 0,1,2,3 + +cpu/event=0xc5,umask=0x50,period=400009,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, +cpu/event=0xc5,umask=0x41,period=400009,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, +cpu/event=0xc5,umask=0x42,period=400009,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, +cpu/event=0xc5,umask=0xc0,period=100003,name='BR_MISP_RETIRED.INDIRECT_COST'/, +cpu/event=0xc5,umask=0x48,period=100007,name='BR_MISP_RETIRED.RET_COST'/; + +cpu/event=0xad,umask=0x01,cmask=0x01,period=500009,name='INT_MISC.CLEARS_COUNT'/, +cpu/event=0xc3,umask=0x01,cmask=0x01,period=100003,name='MACHINE_CLEARS.COUNT'/, +cpu/event=0xc3,umask=0x02,period=100003,name='MACHINE_CLEARS.MEMORY_ORDERING'/, +cpu/event=0xd0,umask=0x09,period=100003,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, # 0,1,2,3 +cpu/event=0x03,umask=0x82,period=100003,name='LD_BLOCKS.STORE_FORWARD'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x81,period=1000003,name='MEM_INST_RETIRED.ALL_LOADS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x41,period=100003,name='MEM_INST_RETIRED.SPLIT_LOADS'/; # 0,1,2,3 + +cpu/event=0x48,umask=0x01,period=1000003,name='L1D_PEND_MISS.PENDING'/, # 0,1,2,3 +cpu/event=0x43,umask=0xfd,period=1000003,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, # 0,1,2,3 +cpu/event=0x48,umask=0x02,period=1000003,name='L1D_PEND_MISS.FB_FULL'/, # 0,1,2,3 +cpu/event=0xd2,umask=0x01,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; # 0,1,2,3 + +cpu/event=0xd1,umask=0x04,period=100021,name='MEM_LOAD_RETIRED.L3_HIT'/, # 0,1,2,3 +cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/; # 0,1,2,3 + +cpu/event=0x48,umask=0x04,period=1000003,name='L1D_PEND_MISS.L2_STALLS'/, # 0,1,2,3 +cpu/event=0x44,umask=0x01,period=200003,name='MEM_STORE_RETIRED.L2_HIT'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/; # 0,1,2,3 + +cpu/event=0x2a,umask=0x01,period=100003,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x0a,period=100003,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, # 0,1,2,3 +cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; # 0,1,2,3 + +cpu/event=0xb0,umask=0x09,cmask=0x01,period=1000003,name='ARITH.DIV_ACTIVE'/, +cpu/event=0xa2,umask=0x02,period=100003,name='RESOURCE_STALLS.SCOREBOARD'/, +cpu/event=0xec,umask=0x20,period=2000003,name='CPU_CLK_UNHALTED.C02'/, +cpu/event=0xa6,umask=0x80,period=1000003,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, +cpu/event=0xa6,umask=0xC,period=2000003,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, +cpu/event=0xa3,umask=0x04,cmask=0x04,period=1000003,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; + +cpu/event=0xb1,umask=0x10,period=2000003,name='UOPS_EXECUTED.X87'/, +cpu/event=0xb1,umask=0x01,period=2000003,name='UOPS_EXECUTED.THREAD'/, +cpu/event=0xc7,umask=0x03,period=1000003,name='FP_ARITH_INST_RETIRED.SCALAR'/, +cpu/event=0xcf,umask=0x03,period=100003,name='FP_ARITH_INST_RETIRED2.SCALAR'/, +cpu/event=0xc7,umask=0xfc,period=1000003,name='FP_ARITH_INST_RETIRED.VECTOR'/, +cpu/event=0xcf,umask=0x1c,period=100003,name='FP_ARITH_INST_RETIRED2.VECTOR'/, +cpu/event=0xe7,umask=0x03,period=1000003,name='INT_VEC_RETIRED.ADD_128'/, +cpu/event=0xe7,umask=0x10,period=1000003,name='INT_VEC_RETIRED.VNNI_128'/; + +cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, +cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/; #UPI upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; From dcc9c3d08133cd40aa5ab349b633ad73aa15ec15 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Thu, 19 Jun 2025 05:51:08 -0700 Subject: [PATCH 06/20] ocr Signed-off-by: Harper, Jason M --- .../resources/events/x86_64/GenuineIntel/gnr.txt | 10 +++++----- .../resources/metrics/x86_64/GenuineIntel/gnr.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index d788f679..c037de29 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -71,9 +71,9 @@ ref-cycles, instructions; cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1:e1'/, # [*] -cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 -cpu/event=0x2b,umask=0x01,period=100003,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 -cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 +cpu/event=0x2b,umask=0x01,period=100003,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, # 0,1,2,3 cpu/event=0xd1,umask=0x40,period=100007,name='MEM_LOAD_RETIRED.FB_HIT'/, # 0,1,2,3 cpu-cycles, ref-cycles, @@ -152,10 +152,10 @@ cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/; cpu/event=0x48,umask=0x04,period=1000003,name='L1D_PEND_MISS.L2_STALLS'/, # 0,1,2,3 cpu/event=0x44,umask=0x01,period=200003,name='MEM_STORE_RETIRED.L2_HIT'/, # 0,1,2,3 -cpu/event=0x2a,umask=0x01,period=100003,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x103b800002,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/; # 0,1,2,3 -cpu/event=0x2a,umask=0x01,period=100003,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x10800,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 cpu/event=0xd0,umask=0x0a,period=100003,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, # 0,1,2,3 cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; # 0,1,2,3 diff --git a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json index defd0460..91b6de82 100644 --- a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json +++ b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json @@ -413,7 +413,7 @@ }, { "name": "TMA_......False_Sharing(%)", - "expression": "100 * ( ( ( 170 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_MISS:ocr_msr_val=0x103b800002] + ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( ( 170 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_MISS] + ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] ) / ( [cpu-cycles] ) )" }, { "name": "TMA_......Split_Stores(%)", From f7c949234bf1645a51a37bb4dd8b5a11d0de23dc Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Thu, 19 Jun 2025 06:57:44 -0700 Subject: [PATCH 07/20] format uncore Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 40 ++--- scripts/perfmonevents2perfspect.py | 145 ++++++++++++------ 2 files changed, 118 insertions(+), 67 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index c037de29..4041d605 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -179,34 +179,34 @@ cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/; #UPI -upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; +upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; # 0,1,2,3 #CHA (Cache) -cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, -cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, -cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; +cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, # 0,1,2,3 +cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, # 0,1,2,3 +cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; # 0 -cha/event=0x35,umask=0xC816FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, -cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, -cha/event=0x35,umask=0xC896FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, -cha/event=0x35,umask=0xC8977E01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; +cha/event=0x35,umask=0xc816fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, # 0,1,2,3 +cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, # 0 +cha/event=0x35,umask=0xc896fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, # 0,1,2,3 +cha/event=0x35,umask=0xc8977e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; # 0,1,2,3 -cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, -cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, -cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, -cha/event=0x36,umask=0xC817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; +cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, # 0,1,2,3 +cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, # 0,1,2,3 +cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, # 0,1,2,3 +cha/event=0x36,umask=0xc817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; # 0 #CHA (IO Bandwidth) -cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, -cha/event=0x35,umask=0xCC43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, -cha/event=0x35,umask=0xCD43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, -cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; +cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, # 0,1,2,3 +cha/event=0x35,umask=0xcc43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, # 0,1,2,3 +cha/event=0x35,umask=0xcd43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, # 0,1,2,3 +cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; # 0,1,2,3 #IMC (memory read/writes) -imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, -imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, -imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, -imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; +imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, # 0,1,2,3 +imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, # 0,1,2,3 +imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, # 0,1,2,3 +imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; # 0,1,2,3 #C6 cstate_core/c6-residency/; diff --git a/scripts/perfmonevents2perfspect.py b/scripts/perfmonevents2perfspect.py index 9e60be30..0ba0a336 100755 --- a/scripts/perfmonevents2perfspect.py +++ b/scripts/perfmonevents2perfspect.py @@ -12,12 +12,92 @@ import sys import json -# arg1 - perfmon event json file (exported from perfmon.intel.com) -# arg2 - file containing list of event names, one event name per line +def format_event(p): + """ + Format a single event from perfmon to perfspect format. + """ + eventParts = [] + unit = p.get("Unit", "cpu") + unit = unit.split(" ")[0] # take the first part of the unit if it has multiple parts + unit = unit.lower() + # /event + eventParts.append(f"{unit}/event={p['EventCode']}") + # umask + if p.get("UMaskExt", "") != "": # only uncore events + umask_value = int(p["UMask"], 16) # convert hex to int + umask_hex = f"{umask_value:02x}" + umaskext_value = int(p["UMaskExt"], 16) # convert hex to int + umaskext_hex = f"{umaskext_value:x}" + eventParts.append(f"umask=0x{umaskext_hex}{umask_hex}") + else: + eventParts.append(f"umask={p['UMask']}") + # cmask + if p.get("CounterMask", "") != "": # only core events + if p["CounterMask"] != "0": + # convert to int + cmask_value = int(p["CounterMask"]) + # convert to hex, pad with zeros to 2 digits for consistency + cmask_hex = f"0x{cmask_value:02x}" + eventParts.append(f"cmask={cmask_hex}") + # period + if p.get("SampleAfterValue", "") != "": # only core events + eventParts.append(f"period={p['SampleAfterValue']}") + # offcore_rsp + if p.get("Offcore", "") != "": # only core events + if p["Offcore"] == "1": + eventParts.append(f"offcore_rsp={p['MSRValue']}") + # name + eventParts.append(f"name='{p['EventName']}'") + event = ",".join(eventParts) + event += "/" + # Add optional comment with counter and takenAlone info + # if counter is not "0,1,2,3,4,5,6,7" or takenAlone is "1", add them to the comment + counter = "" + takenAlone = "" + comment = "" + if p["Counter"] != "0,1,2,3,4,5,6,7": + counter = p['Counter'] + if p.get("TakenAlone", "") != "": # only core events + if p["TakenAlone"] == "1": + takenAlone = "[*]" + if counter != "" or takenAlone != "": + comment = f" # {counter}{takenAlone}" + if comment != "": + event = event.ljust(100) + comment + return event + +def format_all_events(events): + """ + Format all events from perfmon to perfspect format. + """ + result = [] + for p in events: + result.append(format_event(p)) + return result + +def format_event_list(events, event_names): + """ + Format a list of events from perfmon to perfspect format. + """ + result = [] + not_found = [] + for e in event_names: + e = e.strip() + for p in events: + if p["EventName"] == e: + result.append(format_event(p)) + break + else: + not_found.append(e) + return result, not_found + +# arg1 - perfmon core event json file (downloaded from github.com/intel/perfmon) +# arg2 - file containing list of event names, one event name per line [optional] +# if 2nd argument is not provided, all events from perfmon json file are used if __name__ == "__main__": - if len(sys.argv) < 3: + if len(sys.argv) < 2: print( - "Usage: perfmonevents2perfspect.py ", + "Usage: perfmonevents2perfspect.py []", file=sys.stderr, ) sys.exit(1) @@ -27,52 +107,23 @@ perfmon = json.load(f) # read list of event names - with open(sys.argv[2], "r") as f: - events = f.readlines() - - # for each event name, find corresponding event in perfmon json and create a perfspect formatted event - # example: cpu/event=0x71,umask=0x00,period=1000003,name='TOPDOWN_FE_BOUND.ALL'/ - # if event name is not found in perfmon json file, it is added to a list of not found events - result = [] - notfound = [] - for e in events: - e = e.strip() - for p in perfmon["Events"]: - if p["EventName"] == e: - eventParts = [] - unit = p.get("Unit", "cpu") - unit = unit.split(" ")[0] # take the first part of the unit if it has multiple parts - unit = unit.lower() - eventParts.append(f"{unit}/event={p['EventCode']}") - eventParts.append(f"umask={p['UMask']}") - if p.get("SampleAfterValue", "") != "": - eventParts.append(f"period={p['SampleAfterValue']}") - eventParts.append(f"name='{p['EventName']}'") - event = ",".join(eventParts) - event += "/" - # Add optional comment with counter and takenAlone info - # if counter is not "0,1,2,3,4,5,6,7" or takenAlone is "1", add them to the comment - counter = "" - takenAlone = "" - comment = "" - if p["Counter"] != "0,1,2,3,4,5,6,7": - counter = p['Counter'] - if p.get("TakenAlone", "0") == "1": - takenAlone = "[*]" - if counter != "" or takenAlone != "": - comment = f" # {counter}{takenAlone}" - if comment != "": - event = event.ljust(80) + comment - result.append(event) - break - else: - notfound.append(e) + if len(sys.argv) < 3: + # if no event names file is provided, use all events from perfmon json + result = format_all_events(perfmon["Events"]) + not_found = [] + else: + # read event names from file + with open(sys.argv[2], "r") as f: + events = f.readlines() + events = [e.strip() for e in events if e.strip()] + result, not_found = format_event_list(perfmon["Events"], events) # print perfspect formatted events to stdout for r in result: print(r) # print the not found event names to stderr - print("\nNot Found Events:", file=sys.stderr) - for n in notfound: - print(n, file=sys.stderr) + if not_found: + print("\nNot Found Events:", file=sys.stderr) + for n in not_found: + print(n, file=sys.stderr) From aae0154cee7f96f6d0042b7f2e309b1b939ae667 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Fri, 20 Jun 2025 06:20:56 -0700 Subject: [PATCH 08/20] merge cpu groups Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 104 ++++++++++-------- 1 file changed, 58 insertions(+), 46 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 4041d605..4e0c4fbe 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -5,6 +5,8 @@ cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, # 0,1,2,3 cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, # 0,1,2,3 cpu/event=0xa6,umask=0x02,period=2000003,name='EXE_ACTIVITY.1_PORTS_UTIL'/, +cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, +cpu/event=0xb7,umask=0x02,period=2000003,name='EXE.AMX_BUSY'/, cpu-cycles, ref-cycles, instructions; @@ -21,6 +23,8 @@ cpu-cycles, ref-cycles, instructions; +cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, +cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/, cpu/event=0xc4,umask=0x00,period=400009,name='BR_INST_RETIRED.ALL_BRANCHES'/, cpu/event=0xc5,umask=0x00,period=400009,name='BR_MISP_RETIRED.ALL_BRANCHES'/, cpu/event=0x12,umask=0x0e,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED'/, # 0,1,2,3 @@ -43,6 +47,8 @@ cpu/event=0x00,umask=0x84,period=10000003,name='PERF_METRICS.HEAVY_OPERATIONS'/, cpu/event=0x47,umask=0x09,cmask=0x09,period=1000003,name='MEMORY_ACTIVITY.STALLS_L3_MISS'/, # 0,1,2,3 cpu/event=0x80,umask=0x04,period=500009,name='ICACHE_DATA.STALLS'/, # 0,1,2,3 cpu/event=0x83,umask=0x04,period=200003,name='ICACHE_TAG.STALLS'/, # 0,1,2,3 +cpu/event=0xc2,umask=0x02,period=2000003,name='UOPS_RETIRED.SLOTS'/, +cpu/event=0xae,umask=0x01,period=2000003,name='UOPS_ISSUED.ANY'/; cpu-cycles, ref-cycles, instructions; @@ -53,19 +59,15 @@ cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_A cpu/event=0xa3,umask=0x10,cmask=0x10,period=1000003,name='CYCLE_ACTIVITY.CYCLES_MEM_ANY'/, cpu/event=0xad,umask=0x80,period=500009,name='INT_MISC.CLEAR_RESTEER_CYCLES'/, cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, -cpu-cycles, -ref-cycles, -instructions; - cpu/event=0xd1,umask=0x08,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, # 0,1,2,3 cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, # [*] cpu-cycles, ref-cycles, instructions; -cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1'/, # [*] -cpu/event=0xd0,umask=0x21,period=100007,name='MEM_INST_RETIRED.LOCK_LOADS'/, # 0,1,2,3 -cpu/event=0xd0,umask=0x82,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, # 0,1,2,3 +cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1'/, # [*] +cpu/event=0xd0,umask=0x21,period=100007,name='MEM_INST_RETIRED.LOCK_LOADS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x82,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; @@ -79,22 +81,14 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, -cpu/event=0xb7,umask=0x02,period=2000003,name='EXE.AMX_BUSY'/, -cpu-cycles, -ref-cycles, -instructions; - cpu/event=0xd2,umask=0x02,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, # 0,1,2,3 cpu/event=0xd2,umask=0x04,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, # 0,1,2,3 cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, # 0,1,2,3 -cpu-cycles, -ref-cycles, -instructions; - -cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 -cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, # 0,1,2,3 -cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, +cpu/event=0xc5,umask=0x50,period=400009,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, +cpu/event=0xc5,umask=0x41,period=400009,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, +cpu/event=0xc5,umask=0x42,period=400009,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, +cpu/event=0xc5,umask=0xc0,period=100003,name='BR_MISP_RETIRED.INDIRECT_COST'/, +cpu/event=0xc5,umask=0x48,period=100007,name='BR_MISP_RETIRED.RET_COST'/, cpu-cycles, ref-cycles, instructions; @@ -112,27 +106,30 @@ instructions; cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, # 0,1,2,3 cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 +cpu/event=0xb0,umask=0x09,cmask=0x01,period=1000003,name='ARITH.DIV_ACTIVE'/, +cpu/event=0xa2,umask=0x02,period=100003,name='RESOURCE_STALLS.SCOREBOARD'/, +cpu/event=0xec,umask=0x20,period=2000003,name='CPU_CLK_UNHALTED.C02'/, +cpu/event=0xa6,umask=0x80,period=1000003,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, +cpu/event=0xa6,umask=0xC,period=2000003,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, +cpu/event=0xa3,umask=0x04,cmask=0x04,period=1000003,name='CYCLE_ACTIVITY.STALLS_TOTAL'/, cpu-cycles:k, ref-cycles:k, instructions:k; -cpu/event=0xc2,umask=0x02,period=2000003,name='UOPS_RETIRED.SLOTS'/, -cpu/event=0xae,umask=0x01,period=2000003,name='UOPS_ISSUED.ANY'/; - cpu/event=0x87,umask=0x01,period=500009,name='DECODE.LCP'/, # 0,1,2,3 cpu/event=0x61,umask=0x02,period=100003,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, # 0,1,2,3 cpu/event=0x79,umask=0x04,cmask=0x01,period=2000003,name='IDQ.MITE_CYCLES_ANY'/, # 0,1,2,3 -cpu/event=0x79,umask=0x04,cmask=0x06,period=2000003,name='IDQ.MITE_CYCLES_OK'/; # 0,1,2,3 +cpu/event=0x79,umask=0x04,cmask=0x06,period=2000003,name='IDQ.MITE_CYCLES_OK'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x79,umask=0x08,cmask=0x01,period=2000003,name='IDQ.DSB_CYCLES_ANY'/, # 0,1,2,3 cpu/event=0x79,umask=0x08,cmask=0x06,period=2000003,name='IDQ.DSB_CYCLES_OK'/, # 0,1,2,3 -cpu/event=0x79,umask=0x20,cmask=0x01,period=2000003,name='IDQ.MS_CYCLES_ANY'/; # 0,1,2,3 - -cpu/event=0xc5,umask=0x50,period=400009,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, -cpu/event=0xc5,umask=0x41,period=400009,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, -cpu/event=0xc5,umask=0x42,period=400009,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, -cpu/event=0xc5,umask=0xc0,period=100003,name='BR_MISP_RETIRED.INDIRECT_COST'/, -cpu/event=0xc5,umask=0x48,period=100007,name='BR_MISP_RETIRED.RET_COST'/; +cpu/event=0x79,umask=0x20,cmask=0x01,period=2000003,name='IDQ.MS_CYCLES_ANY'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0xad,umask=0x01,cmask=0x01,period=500009,name='INT_MISC.CLEARS_COUNT'/, cpu/event=0xc3,umask=0x01,cmask=0x01,period=100003,name='MACHINE_CLEARS.COUNT'/, @@ -140,31 +137,39 @@ cpu/event=0xc3,umask=0x02,period=100003,name='MACHINE_CLEARS.MEMORY_ORDERING'/, cpu/event=0xd0,umask=0x09,period=100003,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, # 0,1,2,3 cpu/event=0x03,umask=0x82,period=100003,name='LD_BLOCKS.STORE_FORWARD'/, # 0,1,2,3 cpu/event=0xd0,umask=0x81,period=1000003,name='MEM_INST_RETIRED.ALL_LOADS'/, # 0,1,2,3 -cpu/event=0xd0,umask=0x41,period=100003,name='MEM_INST_RETIRED.SPLIT_LOADS'/; # 0,1,2,3 +cpu/event=0xd0,umask=0x41,period=100003,name='MEM_INST_RETIRED.SPLIT_LOADS'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x48,umask=0x01,period=1000003,name='L1D_PEND_MISS.PENDING'/, # 0,1,2,3 cpu/event=0x43,umask=0xfd,period=1000003,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, # 0,1,2,3 cpu/event=0x48,umask=0x02,period=1000003,name='L1D_PEND_MISS.FB_FULL'/, # 0,1,2,3 -cpu/event=0xd2,umask=0x01,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; # 0,1,2,3 +cpu/event=0xd2,umask=0x01,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0xd1,umask=0x04,period=100021,name='MEM_LOAD_RETIRED.L3_HIT'/, # 0,1,2,3 -cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/; # 0,1,2,3 +cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x48,umask=0x04,period=1000003,name='L1D_PEND_MISS.L2_STALLS'/, # 0,1,2,3 cpu/event=0x44,umask=0x01,period=200003,name='MEM_STORE_RETIRED.L2_HIT'/, # 0,1,2,3 cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x103b800002,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 -cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/; # 0,1,2,3 +cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x10800,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 cpu/event=0xd0,umask=0x0a,period=100003,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, # 0,1,2,3 -cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; # 0,1,2,3 - -cpu/event=0xb0,umask=0x09,cmask=0x01,period=1000003,name='ARITH.DIV_ACTIVE'/, -cpu/event=0xa2,umask=0x02,period=100003,name='RESOURCE_STALLS.SCOREBOARD'/, -cpu/event=0xec,umask=0x20,period=2000003,name='CPU_CLK_UNHALTED.C02'/, -cpu/event=0xa6,umask=0x80,period=1000003,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, -cpu/event=0xa6,umask=0xC,period=2000003,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, -cpu/event=0xa3,umask=0x04,cmask=0x04,period=1000003,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; +cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0xb1,umask=0x10,period=2000003,name='UOPS_EXECUTED.X87'/, cpu/event=0xb1,umask=0x01,period=2000003,name='UOPS_EXECUTED.THREAD'/, @@ -173,10 +178,17 @@ cpu/event=0xcf,umask=0x03,period=100003,name='FP_ARITH_INST_RETIRED2.SCALAR'/, cpu/event=0xc7,umask=0xfc,period=1000003,name='FP_ARITH_INST_RETIRED.VECTOR'/, cpu/event=0xcf,umask=0x1c,period=100003,name='FP_ARITH_INST_RETIRED2.VECTOR'/, cpu/event=0xe7,umask=0x03,period=1000003,name='INT_VEC_RETIRED.ADD_128'/, -cpu/event=0xe7,umask=0x10,period=1000003,name='INT_VEC_RETIRED.VNNI_128'/; +cpu/event=0xe7,umask=0x10,period=1000003,name='INT_VEC_RETIRED.VNNI_128'/, +cpu-cycles, +ref-cycles, +instructions; -cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, -cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/; +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, # 0,1,2,3 +cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; #UPI upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; # 0,1,2,3 From 8a2fab9912696666c7a44df8b75406f948f6e044 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Fri, 20 Jun 2025 06:43:52 -0700 Subject: [PATCH 09/20] comments Signed-off-by: Harper, Jason M --- .../resources/events/x86_64/GenuineIntel/gnr.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 4e0c4fbe..0bf2987a 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -1,5 +1,6 @@ # GraniteRapids event list +# cpu groups cpu/event=0x51,umask=0x01,period=100003,name='L1D.REPLACEMENT'/, # 0,1,2,3 cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, # 0,1,2,3 cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, # 0,1,2,3 @@ -190,10 +191,10 @@ cpu-cycles, ref-cycles, instructions; -#UPI +# upi groups upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; # 0,1,2,3 -#CHA (Cache) +# cha groups cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, # 0,1,2,3 cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, # 0,1,2,3 cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; # 0 @@ -208,22 +209,23 @@ cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, # 0,1,2,3 cha/event=0x36,umask=0xc817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; # 0 -#CHA (IO Bandwidth) cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, # 0,1,2,3 cha/event=0x35,umask=0xcc43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, # 0,1,2,3 cha/event=0x35,umask=0xcd43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, # 0,1,2,3 cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; # 0,1,2,3 -#IMC (memory read/writes) +# imc groups imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, # 0,1,2,3 imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, # 0,1,2,3 imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, # 0,1,2,3 imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; # 0,1,2,3 -#C6 +# cstate_core groups cstate_core/c6-residency/; + +# cstate_pkg groups cstate_pkg/c6-residency/; -#power +# power groups power/energy-pkg/, power/energy-ram/; From 706662a410ce08b221354bb00b7e75a0a243eace Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 11:16:48 -0700 Subject: [PATCH 10/20] retire latencies Signed-off-by: Harper, Jason M --- cmd/metrics/event_defs.go | 3 + cmd/metrics/metric_defs.go | 80 +++++++++- .../GenuineIntel/gnr_retire_latency.json | 146 ++++++++++++++++++ scripts/check_events.py | 1 + scripts/perfmonevents2perfspect.py | 28 +++- scripts/perfmonmetrics2perfspect.py | 32 +++- 6 files changed, 281 insertions(+), 9 deletions(-) create mode 100644 cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json diff --git a/cmd/metrics/event_defs.go b/cmd/metrics/event_defs.go index 9eca15ab..5b5a6544 100644 --- a/cmd/metrics/event_defs.go +++ b/cmd/metrics/event_defs.go @@ -54,6 +54,9 @@ func LoadEventGroups(eventDefinitionOverridePath string, metadata Metadata) (gro defer file.Close() scanner := bufio.NewScanner(file) uncollectable := mapset.NewSet[string]() + if flagTransactionRate == 0 { + uncollectable.Add("TXN") + } var group GroupDefinition for scanner.Scan() { line := strings.TrimSpace(scanner.Text()) diff --git a/cmd/metrics/metric_defs.go b/cmd/metrics/metric_defs.go index 311ceed5..a0e5a262 100644 --- a/cmd/metrics/metric_defs.go +++ b/cmd/metrics/metric_defs.go @@ -9,6 +9,7 @@ import ( "log/slog" "os" "path/filepath" + "regexp" "strings" "github.com/Knetic/govaluate" @@ -92,12 +93,17 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st err = fmt.Errorf("unknown granularity: %s", flagGranularity) return } - coresPerSocket := fmt.Sprintf("%f", float64(metadata.CoresPerSocket)) chasPerSocket := fmt.Sprintf("%f", float64(len(metadata.UncoreDeviceIDs["cha"]))) socketCount := fmt.Sprintf("%f", float64(metadata.SocketCount)) hyperThreadingOn := fmt.Sprintf("%t", metadata.ThreadsPerCore > 1) threadsPerCore := fmt.Sprintf("%f", float64(metadata.ThreadsPerCore)) + // load retire latency constants + var retireLatencies map[string]string + if retireLatencies, err = LoadRetireLatencies(metadata); err != nil { + slog.Error("failed to load retire latencies", slog.String("error", err.Error())) + return + } // configure each metric for metricIdx := range loadedMetrics { tmpMetric := loadedMetrics[metricIdx] @@ -105,9 +111,6 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st tmpMetric.Expression = abbreviateEventName(tmpMetric.Expression) // skip metrics that use uncollectable events foundUncollectable := false - if flagTransactionRate == 0 { - uncollectableEvents = append(uncollectableEvents, "TXN") - } for _, uncollectableEvent := range uncollectableEvents { if strings.Contains(tmpMetric.Expression, uncollectableEvent) { slog.Debug("removing metric that uses uncollectable event", slog.String("metric", tmpMetric.Name), slog.String("event", uncollectableEvent)) @@ -123,8 +126,11 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st if transformed, err = transformConditional(tmpMetric.Expression); err != nil { return } + // replace "> =" with ">=" and "< =" with "<=" + transformed = strings.ReplaceAll(transformed, "> =", ">=") + transformed = strings.ReplaceAll(transformed, "< =", "<=") if transformed != tmpMetric.Expression { - slog.Debug("transformed metric", slog.String("original", tmpMetric.Name), slog.String("transformed", transformed)) + slog.Debug("transformed metric", slog.String("metric name", tmpMetric.Name), slog.String("transformed", transformed)) tmpMetric.Expression = transformed } // replace constants with their values @@ -136,6 +142,21 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, "[HYPERTHREADING_ON]", hyperThreadingOn) tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, "[CONST_THREAD_COUNT]", threadsPerCore) tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, "[TXN]", fmt.Sprintf("%f", flagTransactionRate)) + // replace retire latencies + for retireEvent, retireLatency := range retireLatencies { + // replace :retire_latency with value + tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, fmt.Sprintf("[%s:retire_latency]", retireEvent), retireLatency) + } + // replace constant numbers masquerading as variables with their values, e.g., [20] -> 20 + // there may be more than one with differing values in the expression, so use a regex to find them all + re := regexp.MustCompile(`\[(\d+)\]`) + found := re.FindAllStringSubmatchIndex(tmpMetric.Expression, -1) + for _, match := range found { + // match[2] is the start of the number, match[3] is the end of the number + number := tmpMetric.Expression[match[2]:match[3]] + // replace the whole match with the number + tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, tmpMetric.Expression[match[0]:match[1]], number) + } // get a list of the variables in the expression tmpMetric.Variables = make(map[string]int) expressionIdx := 0 @@ -239,3 +260,52 @@ func transformConditional(origIn string) (out string, err error) { } return } + +type PlatformInfo struct { + ModelName string `json:"Model name"` + CPUFamily string `json:"CPU family"` + Model string `json:"Model"` + ThreadsPerCore string `json:"Thread(s) per core"` + CoresPerSocket string `json:"Core(s) per socket"` + Sockets string `json:"Socket(s)"` + Stepping string `json:"Stepping"` + L3Cache string `json:"L3 cache"` + NUMANodes string `json:"NUMA node(s)"` + TMAVersion string `json:"TMA version"` +} + +type MetricStats struct { + Min float64 `json:"MIN"` + Max float64 `json:"MAX"` + Mean float64 `json:"MEAN"` +} + +type RetireLatency struct { + Platform PlatformInfo `json:"Platform"` + Data map[string]MetricStats `json:"Data"` +} + +func LoadRetireLatencies(metadata Metadata) (retireLatencies map[string]string, err error) { + uarch := strings.ToLower(strings.Split(metadata.Microarchitecture, "_")[0]) + uarch = strings.Split(uarch, " ")[0] + filename := fmt.Sprintf("%s_retire_latency.json", uarch) + var bytes []byte + if bytes, err = resources.ReadFile(filepath.Join("resources", "metrics", metadata.Architecture, metadata.Vendor, filename)); err != nil { + // not all architectures have retire latencies defined + err = nil + return + } + var retireLatency RetireLatency + if err = json.Unmarshal(bytes, &retireLatency); err != nil { + slog.Error("failed to unmarshal retire latencies", slog.String("error", err.Error())) + return + } + // create a map of retire latencies + retireLatencies = make(map[string]string) + for event, stats := range retireLatency.Data { + // use the mean value for the retire latency + retireLatencies[event] = fmt.Sprintf("%f", stats.Mean) + } + slog.Debug("loaded retire latencies", slog.Any("latencies", retireLatencies)) + return +} diff --git a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json new file mode 100644 index 00000000..f3932bd6 --- /dev/null +++ b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr_retire_latency.json @@ -0,0 +1,146 @@ +{ + "Platform": { + "Model name": "GENUINE INTEL(R) XEON(R)", + "CPU family": "6", + "Model": "173", + "Thread(s) per core": "1", + "Core(s) per socket": "64", + "Socket(s)": "2", + "Stepping": "0", + "L3 cache": "576 MiB (2 instances)", + "NUMA node(s)": "2", + "TMA version": "5.01-full-perf" + }, + "Data": { + "BR_MISP_RETIRED.COND_NTAKEN_COST": { + "MIN": 0, + "MAX": 888, + "MEAN": 6.11 + }, + "BR_MISP_RETIRED.COND_TAKEN_COST": { + "MIN": 0, + "MAX": 2750, + "MEAN": 5.09 + }, + "BR_MISP_RETIRED.INDIRECT_CALL_COST": { + "MIN": 0, + "MAX": 703, + "MEAN": 15.56 + }, + "BR_MISP_RETIRED.INDIRECT_COST": { + "MIN": 0, + "MAX": 1562, + "MEAN": 11.07 + }, + "BR_MISP_RETIRED.RET_COST": { + "MIN": 9, + "MAX": 1082, + "MEAN": 32.37 + }, + "FRONTEND_RETIRED.ANY_DSB_MISS": { + "MIN": 0, + "MAX": 65535, + "MEAN": 2.46 + }, + "FRONTEND_RETIRED.ITLB_MISS": { + "MIN": 0, + "MAX": 980, + "MEAN": 41.96 + }, + "FRONTEND_RETIRED.L1I_MISS": { + "MIN": 0, + "MAX": 1785, + "MEAN": 9.83 + }, + "FRONTEND_RETIRED.L2_MISS": { + "MIN": 0, + "MAX": 2854, + "MEAN": 137.41 + }, + "FRONTEND_RETIRED.MS_FLOWS": { + "MIN": 0, + "MAX": 65535, + "MEAN": 77.14 + }, + "FRONTEND_RETIRED.STLB_MISS": { + "MIN": 0, + "MAX": 754, + "MEAN": 206.85 + }, + "FRONTEND_RETIRED.UNKNOWN_BRANCH": { + "MIN": 0, + "MAX": 532, + "MEAN": 3.85 + }, + "MEM_INST_RETIRED.LOCK_LOADS": { + "MIN": 15, + "MAX": 5156, + "MEAN": 63.76 + }, + "MEM_INST_RETIRED.SPLIT_LOADS": { + "MIN": 0, + "MAX": 4704, + "MEAN": 3.97 + }, + "MEM_INST_RETIRED.SPLIT_STORES": { + "MIN": 0, + "MAX": 65535, + "MEAN": 19.0 + }, + "MEM_INST_RETIRED.STLB_HIT_LOADS": { + "MIN": 0, + "MAX": 3424, + "MEAN": 1.57 + }, + "MEM_INST_RETIRED.STLB_HIT_STORES": { + "MIN": 0, + "MAX": 65535, + "MEAN": 5.24 + }, + "MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD": { + "MIN": 0, + "MAX": 4472, + "MEAN": 353.04 + }, + "MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS": { + "MIN": 0, + "MAX": 830, + "MEAN": 125.27 + }, + "MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD": { + "MIN": 0, + "MAX": 3939, + "MEAN": 289.9 + }, + "MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM": { + "MIN": 0, + "MAX": 4146, + "MEAN": 115.83 + }, + "MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM": { + "MIN": 0, + "MAX": 3572, + "MEAN": 430.22 + }, + "MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD": { + "MIN": 0, + "MAX": 8552, + "MEAN": 125.36 + }, + "MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM": { + "MIN": 0, + "MAX": 2580, + "MEAN": 135.29 + }, + "MEM_LOAD_RETIRED.L2_HIT": { + "MIN": 0, + "MAX": 7140, + "MEAN": 5.71 + }, + "MEM_LOAD_RETIRED.L3_HIT": { + "MIN": 0, + "MAX": 5630, + "MEAN": 57.64 + } + } +} diff --git a/scripts/check_events.py b/scripts/check_events.py index f386a119..850c3528 100755 --- a/scripts/check_events.py +++ b/scripts/check_events.py @@ -56,6 +56,7 @@ def main(): "CORES_PER_SOCKET", "HYPERTHREADING_ON", "CONST_THREAD_COUNT", + "TXN", ]: if event.find(":") > 0 and event[-1] != "k": event = event[0 : event.find(":")] diff --git a/scripts/perfmonevents2perfspect.py b/scripts/perfmonevents2perfspect.py index 145ad655..9e60be30 100755 --- a/scripts/perfmonevents2perfspect.py +++ b/scripts/perfmonevents2perfspect.py @@ -31,7 +31,7 @@ events = f.readlines() # for each event name, find corresponding event in perfmon json and create a perfspect formatted event - # example: cpu/event=0x71,umask=0x00,name='TOPDOWN_FE_BOUND.ALL'/ + # example: cpu/event=0x71,umask=0x00,period=1000003,name='TOPDOWN_FE_BOUND.ALL'/ # if event name is not found in perfmon json file, it is added to a list of not found events result = [] notfound = [] @@ -39,8 +39,30 @@ e = e.strip() for p in perfmon["Events"]: if p["EventName"] == e: - # event = f"cpu/event={p['EventCode']},umask={p['UMask']},cmask={p['CMask']},name='{p['EventName']}'/" - event = f"cpu/event={p['EventCode']},umask={p['UMask']},name='{p['EventName']}'/" + eventParts = [] + unit = p.get("Unit", "cpu") + unit = unit.split(" ")[0] # take the first part of the unit if it has multiple parts + unit = unit.lower() + eventParts.append(f"{unit}/event={p['EventCode']}") + eventParts.append(f"umask={p['UMask']}") + if p.get("SampleAfterValue", "") != "": + eventParts.append(f"period={p['SampleAfterValue']}") + eventParts.append(f"name='{p['EventName']}'") + event = ",".join(eventParts) + event += "/" + # Add optional comment with counter and takenAlone info + # if counter is not "0,1,2,3,4,5,6,7" or takenAlone is "1", add them to the comment + counter = "" + takenAlone = "" + comment = "" + if p["Counter"] != "0,1,2,3,4,5,6,7": + counter = p['Counter'] + if p.get("TakenAlone", "0") == "1": + takenAlone = "[*]" + if counter != "" or takenAlone != "": + comment = f" # {counter}{takenAlone}" + if comment != "": + event = event.ljust(80) + comment result.append(event) break else: diff --git a/scripts/perfmonmetrics2perfspect.py b/scripts/perfmonmetrics2perfspect.py index 12f09d10..4ed80973 100755 --- a/scripts/perfmonmetrics2perfspect.py +++ b/scripts/perfmonmetrics2perfspect.py @@ -64,16 +64,46 @@ def translate_perfmon_json_metrics_to_perfspect(inFile): vars = {} result = [] for m in mf["Metrics"]: + # if m.get("Category") != "TMA": + # continue + # if m.get("Category") == "TMA" and m.get("Level") > 4: + # continue + # if m.get("LegacyName") and m["LegacyName"].startswith("metric_TMA_Info_"): + # continue + # if m.get("LegacyName") and m["LegacyName"].startswith("metric_TMA_Bottleneck_"): + # continue vars.clear() metric = {} - metric["name"] = m["LegacyName"] + # strip metric_ prefix from the name + if m.get("LegacyName") is None: + print(f"ERROR: Metric {m['Name']} has no LegacyName", file=sys.stderr) + continue + if m["LegacyName"].startswith("metric_"): + metric["name"] = m["LegacyName"][len("metric_") :] + else: + metric["name"] = m["LegacyName"] + # not yet :metric["description"] = m.get("BriefDescription", "") # extract the events and constants for e in m["Events"]: vars[e["Alias"]] = e["Name"] for c in m["Constants"]: vars[c["Alias"]] = c["Name"] + # count the parentheses in the formula + if m["Formula"].count("(") != m["Formula"].count(")"): + print( + f"ERROR: Perfmon metric {m['Name']} has mismatched parentheses in Formula: {m['Formula']}", + file=sys.stderr, + ) + continue # convert the formula metric["expression"] = replace_vars_in_formula(vars, m["Formula"]) + # count the parentheses in the expression + if metric["expression"].count("(") != metric["expression"].count(")"): + print( + f"ERROR: PerfSpect metric {m['Name']} has mismatched parentheses in expression: {metric['expression']}", + file=sys.stderr, + ) + continue result.append(metric) return result From 185480f51c4b694431616dd64b39b9defe77202d Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 15:13:00 -0700 Subject: [PATCH 11/20] update TMA metrics/events Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 94 ++++++--- .../metrics/x86_64/GenuineIntel/gnr.json | 178 +++++++++++++----- 2 files changed, 199 insertions(+), 73 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 34868362..6fd677d8 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -5,8 +5,6 @@ cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, cpu/event=0xa6,umask=0x02,period=2000003,name='EXE_ACTIVITY.1_PORTS_UTIL'/, -cpu/event=0xa6,umask=0x04,period=2000003,name='EXE_ACTIVITY.2_PORTS_UTIL'/, -cpu/event=0xa6,umask=0xc,period=2000003,name='EXE_ACTIVITY.2_PORTS_UTIL:u0xc'/, cpu-cycles, ref-cycles, instructions; @@ -49,19 +47,8 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xcf,umask=0x10,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED2.512B_PACKED_HALF'/, -cpu/event=0xcf,umask=0x08,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED2.256B_PACKED_HALF'/, -cpu/event=0xc7,umask=0x80,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.512B_PACKED_SINGLE'/, -cpu/event=0xc7,umask=0x40,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.512B_PACKED_DOUBLE'/, -cpu/event=0xc7,umask=0x20,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE'/, -cpu/event=0xc7,umask=0x10,cmask=0x00,period=100003,name='FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE'/, -cpu-cycles, -ref-cycles, -instructions; - cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, cpu/event=0x47,umask=0x05,cmask=0x05,period=1000003,name='MEMORY_ACTIVITY.STALLS_L2_MISS'/, -cpu/event=0x12,umask=0x20,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.STLB_HIT:c1'/, cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_ACTIVE'/, cpu/event=0xa3,umask=0x10,cmask=0x10,period=1000003,name='CYCLE_ACTIVITY.CYCLES_MEM_ANY'/, cpu/event=0xad,umask=0x80,period=500009,name='INT_MISC.CLEAR_RESTEER_CYCLES'/, @@ -71,7 +58,6 @@ ref-cycles, instructions; cpu/event=0xd1,umask=0x08,cmask=0x00,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, -cpu/event=0xb1,umask=0x01,cmask=0x03,period=2000003,name='UOPS_EXECUTED.CYCLES_GE_3'/, cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, cpu-cycles, ref-cycles, @@ -79,8 +65,6 @@ instructions; cpu/event=0xd0,umask=0x21,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.LOCK_LOADS'/, cpu/event=0xd0,umask=0x82,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, -cpu/event=0x24,umask=0xe2,cmask=0x00,period=2000003,name='L2_RQSTS.ALL_RFO'/, -cpu/event=0x24,umask=0xc2,cmask=0x00,period=2000003,name='L2_RQSTS.RFO_HIT'/, cpu-cycles, ref-cycles, instructions; @@ -93,10 +77,6 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd3,umask=0x02,cmask=0x00,period=1000003,name='MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM'/, -cpu/event=0xd3,umask=0x01,cmask=0x00,period=100007,name='MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x104004477,name='OCR.READS_TO_CORE.LOCAL_DRAM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x730004477,name='OCR.READS_TO_CORE.REMOTE_DRAM'/, cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, cpu/event=0xb7,umask=0x02,period=2000003,name='EXE.AMX_BUSY'/, cpu-cycles, @@ -106,13 +86,11 @@ instructions; cpu/event=0xd2,umask=0x02,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, cpu/event=0xd2,umask=0x04,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x90002380,name='OCR.HWPF_L3.REMOTE'/, cpu-cycles, ref-cycles, instructions; cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x84002380,name='OCR.HWPF_L3.L3_MISS_LOCAL'/, cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, cpu-cycles, @@ -130,18 +108,12 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd3,umask=0x08,cmask=0x00,period=100007,name='MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD'/, -cpu/event=0xd3,umask=0x04,cmask=0x00,period=100007,name='MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM'/, cpu/event=0x2a,umask=0x01,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, cpu/event=0x2a,umask=0x01,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, cpu-cycles:k, ref-cycles:k, instructions:k; -#C6 -cstate_core/c6-residency/; -cstate_pkg/c6-residency/; - #UPI upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; @@ -172,6 +144,72 @@ imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; +cpu/event=0xc2,umask=0x02,name='UOPS_RETIRED.SLOTS'/, +cpu/event=0xae,umask=0x01,name='UOPS_ISSUED.ANY'/; + +cpu/event=0x87,umask=0x01,name='DECODE.LCP'/, +cpu/event=0x61,umask=0x02,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, +cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_ANY'/, +cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_OK'/; + +cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_ANY'/, +cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_OK'/, +cpu/event=0x79,umask=0x20,name='IDQ.MS_CYCLES_ANY'/; + +cpu/event=0xc5,umask=0x50,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, +cpu/event=0xc5,umask=0x41,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, +cpu/event=0xc5,umask=0x42,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, +cpu/event=0xc5,umask=0xc0,name='BR_MISP_RETIRED.INDIRECT_COST'/, +cpu/event=0xc5,umask=0x48,name='BR_MISP_RETIRED.RET_COST'/; + +cpu/event=0xad,umask=0x01,name='INT_MISC.CLEARS_COUNT'/, +cpu/event=0xc3,umask=0x01,name='MACHINE_CLEARS.COUNT'/, +cpu/event=0xc3,umask=0x02,name='MACHINE_CLEARS.MEMORY_ORDERING'/, +cpu/event=0xd0,umask=0x09,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, +cpu/event=0x03,umask=0x82,name='LD_BLOCKS.STORE_FORWARD'/, +cpu/event=0xd0,umask=0x81,name='MEM_INST_RETIRED.ALL_LOADS'/, +cpu/event=0xd0,umask=0x41,name='MEM_INST_RETIRED.SPLIT_LOADS'/; + +cpu/event=0x48,umask=0x01,name='L1D_PEND_MISS.PENDING'/, +cpu/event=0x43,umask=0xfd,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, +cpu/event=0x48,umask=0x02,name='L1D_PEND_MISS.FB_FULL'/, +cpu/event=0xd2,umask=0x01,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; + +cpu/event=0xd1,umask=0x04,name='MEM_LOAD_RETIRED.L3_HIT'/, +cpu/event=0x2d,umask=0x01,name='XQ.FULL_CYCLES'/; + +cpu/event=0x48,umask=0x04,name='L1D_PEND_MISS.L2_STALLS'/, +cpu/event=0x44,umask=0x01,name='MEM_STORE_RETIRED.L2_HIT'/, +cpu/event=0x2A,umask=0x01,name='OCR.DEMAND_RFO.L3_MISS'/, +cpu/event=0xd0,umask=0x42,name='MEM_INST_RETIRED.SPLIT_STORES'/; + +cpu/event=0x2A,umask=0x01,name='OCR.STREAMING_WR.ANY_RESPONSE'/, +cpu/event=0xd0,umask=0x0a,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, +cpu/event=0x13,umask=0x10,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; + +cpu/event=0xb0,umask=0x09,name='ARITH.DIV_ACTIVE'/, +cpu/event=0xa2,umask=0x02,name='RESOURCE_STALLS.SCOREBOARD'/, +cpu/event=0xec,umask=0x20,name='CPU_CLK_UNHALTED.C02'/, +cpu/event=0xa6,umask=0x80,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, +cpu/event=0xa6,umask=0xC,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, +cpu/event=0xa3,umask=0x04,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; + +cpu/event=0xb1,umask=0x10,name='UOPS_EXECUTED.X87'/, +cpu/event=0xb1,umask=0x01,name='UOPS_EXECUTED.THREAD'/, +cpu/event=0xc7,umask=0x03,name='FP_ARITH_INST_RETIRED.SCALAR'/, +cpu/event=0xcf,umask=0x03,name='FP_ARITH_INST_RETIRED2.SCALAR'/, +cpu/event=0xc7,umask=0xfc,name='FP_ARITH_INST_RETIRED.VECTOR'/, +cpu/event=0xcf,umask=0x1c,name='FP_ARITH_INST_RETIRED2.VECTOR'/, +cpu/event=0xe7,umask=0x03,name='INT_VEC_RETIRED.ADD_128'/, +cpu/event=0xe7,umask=0x10,name='INT_VEC_RETIRED.VNNI_128'/; + +cpu/event=0xe5,umask=0x03,name='MEM_UOP_RETIRED.ANY'/, +cpu/event=0xc0,umask=0x10,name='INST_RETIRED.MACRO_FUSED'/; + +#C6 +cstate_core/c6-residency/; +cstate_pkg/c6-residency/; + #power power/energy-pkg/, power/energy-ram/; diff --git a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json index 9e7cb719..defd0460 100644 --- a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json +++ b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json @@ -179,14 +179,6 @@ "name": "% Uops delivered from legacy decode pipeline (MITE)", "expression": "100 * ([IDQ.MITE_UOPS] / ([IDQ.DSB_UOPS] + [IDQ.MITE_UOPS] + [IDQ.MS_UOPS] + [LSD.UOPS]))" }, - { - "name": "core initiated local dram read bandwidth (MB/sec)", - "expression": "([OCR.READS_TO_CORE.LOCAL_DRAM] + [OCR.HWPF_L3.L3_MISS_LOCAL]) * 64 / 1000000" - }, - { - "name": "core initiated remote dram read bandwidth (MB/sec)", - "expression": "([OCR.READS_TO_CORE.REMOTE_DRAM] + [OCR.HWPF_L3.REMOTE]) * 64 / 1000000" - }, { "name": "memory bandwidth read (MB/sec)", "expression": "([UNC_M_CAS_COUNT_SCH0.RD] + [UNC_M_CAS_COUNT_SCH1.RD]) * 64 / 1000000" @@ -272,32 +264,72 @@ "expression": "100 * ( [INT_MISC.CLEAR_RESTEER_CYCLES] / ( [cpu-cycles] ) + ( [INT_MISC.UNKNOWN_BRANCH_CYCLES] / ( [cpu-cycles] ) ) )" }, { - "name": "TMA_......Mispredicts_Resteers(%)", - "expression": "100 * ( ( ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) / ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) ) * [INT_MISC.CLEAR_RESTEER_CYCLES] / ( [cpu-cycles] ) )" + "name": "TMA_....MS_Switches(%)", + "expression": "100 * ( ( 3 ) * [UOPS_RETIRED.MS:c1:e1] / ( [UOPS_RETIRED.SLOTS] / [UOPS_ISSUED.ANY] ) / ( [cpu-cycles] ) )" }, { - "name": "TMA_......Clears_Resteers(%)", - "expression": "100 * ( ( 1 - ( ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) / ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) ) ) * [INT_MISC.CLEAR_RESTEER_CYCLES] / ( [cpu-cycles] ) )" + "name": "TMA_....LCP(%)", + "expression": "100 * ( [DECODE.LCP] / ( [cpu-cycles] ) )" }, { - "name": "TMA_......Unknown_Branches(%)", - "expression": "100 * ( [INT_MISC.UNKNOWN_BRANCH_CYCLES] / ( [cpu-cycles] ) )" + "name": "TMA_....DSB_Switches(%)", + "expression": "100 * ( [DSB2MITE_SWITCHES.PENALTY_CYCLES] / ( [cpu-cycles] ) )" }, { "name": "TMA_..Fetch_Bandwidth(%)", - "expression": "100 * ( max( ( 0 ) , ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) - ( ( [PERF_METRICS.FETCH_LATENCY] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) ) ) ) )" + "expression": "100 * ( max( 0 , ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) - ( ( [PERF_METRICS.FETCH_LATENCY] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) ) ) )" + }, + { + "name": "TMA_....MITE(%)", + "expression": "100 * ( ( [IDQ.MITE_CYCLES_ANY] - [IDQ.MITE_CYCLES_OK] ) / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) / 2 )" + }, + { + "name": "TMA_....DSB(%)", + "expression": "100 * ( ( [IDQ.DSB_CYCLES_ANY] - [IDQ.DSB_CYCLES_OK] ) / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) / 2 )" + }, + { + "name": "TMA_....MS(%)", + "expression": "100 * ( max( [IDQ.MS_CYCLES_ANY] , [UOPS_RETIRED.MS:c1] / ( [UOPS_RETIRED.SLOTS] / [UOPS_ISSUED.ANY] ) ) / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) / 2 )" }, { "name": "TMA_Bad_Speculation(%)", - "expression": "100 * ( max( ( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) , ( 0 ) ) )" + "expression": "100 * ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) )" }, { "name": "TMA_..Branch_Mispredicts(%)", "expression": "100 * ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) )" }, + { + "name": "TMA_....Cond_NT_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.COND_NTAKEN_COST] * [BR_MISP_RETIRED.COND_NTAKEN_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Cond_TK_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.COND_TAKEN_COST] * [BR_MISP_RETIRED.COND_TAKEN_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Ind_Call_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.INDIRECT_CALL_COST] * [BR_MISP_RETIRED.INDIRECT_CALL_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Ind_Jump_Mispredicts(%)", + "expression": "100 * ( max( ( ( [BR_MISP_RETIRED.INDIRECT_COST] * [BR_MISP_RETIRED.INDIRECT_COST:retire_latency] ) - ( [BR_MISP_RETIRED.INDIRECT_CALL_COST] * [BR_MISP_RETIRED.INDIRECT_CALL_COST:retire_latency] ) ) / ( [cpu-cycles] ) , 0 ) )" + }, + { + "name": "TMA_....Ret_Mispredicts(%)", + "expression": "100 * ( ( [BR_MISP_RETIRED.RET_COST] * [BR_MISP_RETIRED.RET_COST:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_....Other_Mispredicts(%)", + "expression": "100 * ( max( ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( 1 - [BR_MISP_RETIRED.ALL_BRANCHES] / ( [INT_MISC.CLEARS_COUNT] - [MACHINE_CLEARS.COUNT] ) ) , 0.0001 ) )" + }, { "name": "TMA_..Machine_Clears(%)", - "expression": "100 * ( max( ( 0 ) , ( ( max( ( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) , ( 0 ) ) ) - ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) )" + "expression": "100 * ( max( 0 , ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) - ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) )" + }, + { + "name": "TMA_....Other_Nukes(%)", + "expression": "100 * ( max( ( max( 0 , ( max( 1 - ( ( [PERF_METRICS.FRONTEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) - [INT_MISC.UOP_DROPPING] / ( [TOPDOWN.SLOTS] ) ) + ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) , 0 ) ) - ( [PERF_METRICS.BRANCH_MISPREDICTS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * ( 1 - [MACHINE_CLEARS.MEMORY_ORDERING] / [MACHINE_CLEARS.COUNT] ) , 0.0001 ) )" }, { "name": "TMA_Backend_Bound(%)", @@ -309,15 +341,31 @@ }, { "name": "TMA_....L1_Bound(%)", - "expression": "100 * ( max( ( ( [EXE_ACTIVITY.BOUND_ON_LOADS] - [MEMORY_ACTIVITY.STALLS_L1D_MISS] ) / ( [cpu-cycles] ) ) , ( 0 ) ) )" + "expression": "100 * ( max( ( [EXE_ACTIVITY.BOUND_ON_LOADS] - [MEMORY_ACTIVITY.STALLS_L1D_MISS] ) / ( [cpu-cycles] ) , 0 ) )" }, { "name": "TMA_......DTLB_Load(%)", - "expression": "100 * ( min( ( ( 7 ) * [DTLB_LOAD_MISSES.STLB_HIT:c1] + [DTLB_LOAD_MISSES.WALK_ACTIVE] ) , ( max( ( [CYCLE_ACTIVITY.CYCLES_MEM_ANY] - [MEMORY_ACTIVITY.CYCLES_L1D_MISS] ) , ( 0 ) ) ) ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.STLB_HIT_LOADS] * [MEM_INST_RETIRED.STLB_HIT_LOADS:retire_latency] ) , [MEM_INST_RETIRED.STLB_HIT_LOADS] * ( 7 ) ) if ( [MEM_INST_RETIRED.STLB_HIT_LOADS:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.STLB_HIT_LOADS] * ( 7 ) ) ) / ( [cpu-cycles] ) + ( [DTLB_LOAD_MISSES.WALK_ACTIVE] / ( [cpu-cycles] ) ) )" + }, + { + "name": "TMA_......Store_Fwd_Blk(%)", + "expression": "100 * ( 13 * [LD_BLOCKS.STORE_FORWARD] / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......L1_Latency_Dependency(%)", + "expression": "100 * ( min( 2 * ( [MEM_INST_RETIRED.ALL_LOADS] - [MEM_LOAD_RETIRED.FB_HIT] - [MEM_LOAD_RETIRED.L1_MISS] ) * 20 / 100 , max( [CYCLE_ACTIVITY.CYCLES_MEM_ANY] - [MEMORY_ACTIVITY.CYCLES_L1D_MISS] , 0 ) ) / ( [cpu-cycles] ) )" }, { "name": "TMA_......Lock_Latency(%)", - "expression": "100 * ( ( 16 * max( ( 0 ) , ( [MEM_INST_RETIRED.LOCK_LOADS] - [L2_RQSTS.ALL_RFO] ) ) + ( [MEM_INST_RETIRED.LOCK_LOADS] / [MEM_INST_RETIRED.ALL_STORES] ) * ( ( 10 ) * [L2_RQSTS.RFO_HIT] + ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO] - 0 ) ) ) ) ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( [MEM_INST_RETIRED.LOCK_LOADS] * [MEM_INST_RETIRED.LOCK_LOADS:retire_latency] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......Split_Loads(%)", + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.SPLIT_LOADS] * [MEM_INST_RETIRED.SPLIT_LOADS:retire_latency] ) , [MEM_INST_RETIRED.SPLIT_LOADS] * ( [L1D_PEND_MISS.PENDING] / [MEM_LOAD_COMPLETED.L1_MISS_ANY] ) ) if ( [MEM_INST_RETIRED.SPLIT_LOADS:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.SPLIT_LOADS] * ( [L1D_PEND_MISS.PENDING] / [MEM_LOAD_COMPLETED.L1_MISS_ANY] ) ) ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......FB_Full(%)", + "expression": "100 * ( [L1D_PEND_MISS.FB_FULL] / ( [cpu-cycles] ) )" }, { "name": "TMA_....L2_Bound(%)", @@ -327,49 +375,77 @@ "name": "TMA_....L3_Bound(%)", "expression": "100 * ( ( [MEMORY_ACTIVITY.STALLS_L2_MISS] - [MEMORY_ACTIVITY.STALLS_L3_MISS] ) / ( [cpu-cycles] ) )" }, + { + "name": "TMA_......Contested_Accesses(%)", + "expression": "100 * ( ( ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) + ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) * ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] / ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] + [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD] ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + }, { "name": "TMA_......Data_Sharing(%)", - "expression": "100 * ( ( ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) * ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] + [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 1 - ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] / ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] + [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD] ) ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) + ( min( ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] ) , [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD:retire_latency] >= 0 ) else ( [MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD] * ( 79 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) * ( 1 - ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] / ( [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM] + [OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD] ) ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......L3_Hit_Latency(%)", + "expression": "100 * ( ( min( ( [MEM_LOAD_RETIRED.L3_HIT] * [MEM_LOAD_RETIRED.L3_HIT:retire_latency] ) , [MEM_LOAD_RETIRED.L3_HIT] * ( 37 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) if ( [MEM_LOAD_RETIRED.L3_HIT:retire_latency] >= 0 ) else ( [MEM_LOAD_RETIRED.L3_HIT] * ( 37 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) - ( 4.4 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) ) ) * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) / 2 ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......SQ_Full(%)", + "expression": "100 * ( ( [XQ.FULL_CYCLES] + [L1D_PEND_MISS.L2_STALLS] ) / ( [cpu-cycles] ) )" }, { "name": "TMA_....DRAM_Bound(%)", - "expression": "100 * ( ( ( [MEMORY_ACTIVITY.STALLS_L3_MISS] / ( [cpu-cycles] ) ) - ( ( ( ( ( 1 - ( ( 19 * ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + 10 * ( ( [MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) ) ) / ( ( 19 * ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + 10 * ( ( [MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + ( [MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM] * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) ) ) + ( 25 * ( 1 * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) + 33 * ( 1 * ( 1 + ( [MEM_LOAD_RETIRED.FB_HIT] / [MEM_LOAD_RETIRED.L1_MISS] ) ) ) ) ) ) ) * ( [MEMORY_ACTIVITY.STALLS_L3_MISS] / ( [cpu-cycles] ) ) ) ) if ( ( ( 1000000 ) * 1 > [MEM_LOAD_RETIRED.L1_MISS] ) ) else 0 ) ) ) )" + "expression": "100 * ( ( [MEMORY_ACTIVITY.STALLS_L3_MISS] / ( [cpu-cycles] ) ) )" }, { "name": "TMA_......MEM_Bandwidth(%)", - "expression": "100 * ( ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] - 0 ) ) ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] ) ) / ( [cpu-cycles] ) )" }, { "name": "TMA_......MEM_Latency(%)", - "expression": "100 * ( ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD] - 0 ) ) ) / ( [cpu-cycles] ) - ( ( min( ( [cpu-cycles] - 0 ) , ( [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] - 0 ) ) ) / ( [cpu-cycles] ) ) )" + "expression": "100 * ( ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD] ) ) / ( [cpu-cycles] ) - ( ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4] ) ) / ( [cpu-cycles] ) ) )" }, { "name": "TMA_....Store_Bound(%)", "expression": "100 * ( [EXE_ACTIVITY.BOUND_ON_STORES] / ( [cpu-cycles] ) )" }, + { + "name": "TMA_......Store_Latency(%)", + "expression": "100 * ( ( ( [MEM_STORE_RETIRED.L2_HIT] * ( 10 ) * ( 1 - ( [MEM_INST_RETIRED.LOCK_LOADS] / [MEM_INST_RETIRED.ALL_STORES] ) ) ) + ( 1 - ( [MEM_INST_RETIRED.LOCK_LOADS] / [MEM_INST_RETIRED.ALL_STORES] ) ) * ( min( [cpu-cycles] , [OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO] ) ) ) / ( [cpu-cycles] ) )" + }, { "name": "TMA_......False_Sharing(%)", - "expression": "100 * ( ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] / ( [cpu-cycles] ) )" + "expression": "100 * ( ( ( 170 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_MISS:ocr_msr_val=0x103b800002] + ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......Split_Stores(%)", + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.SPLIT_STORES] * [MEM_INST_RETIRED.SPLIT_STORES:retire_latency] ) , [MEM_INST_RETIRED.SPLIT_STORES] * 1 ) if ( [MEM_INST_RETIRED.SPLIT_STORES:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.SPLIT_STORES] * 1 ) ) / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......Streaming_Stores(%)", + "expression": "100 * ( 9 * [OCR.STREAMING_WR.ANY_RESPONSE] / ( [cpu-cycles] ) )" + }, + { + "name": "TMA_......DTLB_Store(%)", + "expression": "100 * ( ( min( ( [MEM_INST_RETIRED.STLB_HIT_STORES] * [MEM_INST_RETIRED.STLB_HIT_STORES:retire_latency] ) , [MEM_INST_RETIRED.STLB_HIT_STORES] * ( 7 ) ) if ( [MEM_INST_RETIRED.STLB_HIT_STORES:retire_latency] >= 0 ) else ( [MEM_INST_RETIRED.STLB_HIT_STORES] * ( 7 ) ) ) / ( [cpu-cycles] ) + ( [DTLB_STORE_MISSES.WALK_ACTIVE] / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) ) )" }, { "name": "TMA_..Core_Bound(%)", - "expression": "100 * ( max( ( 0 ) , ( ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.MEMORY_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) )" + "expression": "100 * ( max( 0 , ( [PERF_METRICS.BACKEND_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.MEMORY_BOUND] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) )" }, { - "name": "TMA_........AMX_Busy(%)", - "expression": "100 * ( [EXE.AMX_BUSY] / ( [CPU_CLK_UNHALTED.DISTRIBUTED] ) )" + "name": "TMA_....Divider(%)", + "expression": "100 * ( [ARITH.DIV_ACTIVE] / ( [cpu-cycles] ) )" }, { - "name": "TMA_......Ports_Utilized_1(%)", - "expression": "100 * ( [EXE_ACTIVITY.1_PORTS_UTIL] / ( [cpu-cycles] ) )" + "name": "TMA_....Serializing_Operation(%)", + "expression": "100 * ( [RESOURCE_STALLS.SCOREBOARD] / ( [cpu-cycles] ) + ( [CPU_CLK_UNHALTED.C02] / ( [cpu-cycles] ) ) )" }, { - "name": "TMA_......Ports_Utilized_2(%)", - "expression": "100 * ( [EXE_ACTIVITY.2_PORTS_UTIL] / ( [cpu-cycles] ) )" + "name": "TMA_....AMX_Busy(%)", + "expression": "100 * ( [EXE.AMX_BUSY] / ( [CPU_CLK_UNHALTED.DISTRIBUTED] if [HYPERTHREADING_ON] else ( [cpu-cycles] ) ) )" }, { - "name": "TMA_......Ports_Utilized_3m(%)", - "expression": "100 * ( [UOPS_EXECUTED.CYCLES_GE_3] / ( [cpu-cycles] ) )" + "name": "TMA_....Ports_Utilization(%)", + "expression": "100 * ( ( ( max( [EXE_ACTIVITY.EXE_BOUND_0_PORTS] - [RESOURCE_STALLS.SCOREBOARD] , 0 ) / ( [cpu-cycles] ) ) * ( [cpu-cycles] ) + ( [EXE_ACTIVITY.1_PORTS_UTIL] + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [EXE_ACTIVITY.2_3_PORTS_UTIL] ) ) / ( [cpu-cycles] ) if ( [ARITH.DIV_ACTIVE] < ( [CYCLE_ACTIVITY.STALLS_TOTAL] - [EXE_ACTIVITY.BOUND_ON_LOADS] ) ) else ( [EXE_ACTIVITY.1_PORTS_UTIL] + ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [EXE_ACTIVITY.2_3_PORTS_UTIL] ) / ( [cpu-cycles] ) )" }, { "name": "TMA_Retiring(%)", @@ -377,30 +453,42 @@ }, { "name": "TMA_..Light_Operations(%)", - "expression": "100 * ( max( ( 0 ) , ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) )" + "expression": "100 * ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) )" + }, + { + "name": "TMA_....FP_Arith(%)", + "expression": "100 * ( ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [UOPS_EXECUTED.X87] / [UOPS_EXECUTED.THREAD] ) + ( ( [FP_ARITH_INST_RETIRED.SCALAR] + [FP_ARITH_INST_RETIRED2.SCALAR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [FP_ARITH_INST_RETIRED.VECTOR] + [FP_ARITH_INST_RETIRED2.VECTOR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) )" + }, + { + "name": "TMA_....Int_Operations(%)", + "expression": "100 * ( ( ( [INT_VEC_RETIRED.ADD_128] + [INT_VEC_RETIRED.VNNI_128] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [INT_VEC_RETIRED.ADD_256] + [INT_VEC_RETIRED.MUL_256] + [INT_VEC_RETIRED.VNNI_256] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) )" + }, + { + "name": "TMA_....Memory_Operations(%)", + "expression": "100 * ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [MEM_UOP_RETIRED.ANY] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" }, { - "name": "TMA_........FP_Vector_256b(%)", - "expression": "100 * ( ( [FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE] + [FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE] + [FP_ARITH_INST_RETIRED2.256B_PACKED_HALF] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" + "name": "TMA_....Fused_Instructions(%)", + "expression": "100 * ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [INST_RETIRED.MACRO_FUSED] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" }, { - "name": "TMA_........FP_Vector_512b(%)", - "expression": "100 * ( ( [FP_ARITH_INST_RETIRED.512B_PACKED_DOUBLE] + [FP_ARITH_INST_RETIRED.512B_PACKED_SINGLE] + [FP_ARITH_INST_RETIRED2.512B_PACKED_HALF] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" + "name": "TMA_....Non_Fused_Branches(%)", + "expression": "100 * ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * ( [BR_INST_RETIRED.ALL_BRANCHES] - [INST_RETIRED.MACRO_FUSED] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" }, { - "name": "TMA_......Int_Vector_256b(%)", - "expression": "100 * ( ( [INT_VEC_RETIRED.ADD_256] + [INT_VEC_RETIRED.MUL_256] + [INT_VEC_RETIRED.VNNI_256] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) )" + "name": "TMA_....Other_Light_Ops(%)", + "expression": "100 * ( max( 0 , ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) - ( ( ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * [UOPS_EXECUTED.X87] / [UOPS_EXECUTED.THREAD] ) + ( ( [FP_ARITH_INST_RETIRED.SCALAR] + [FP_ARITH_INST_RETIRED2.SCALAR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [FP_ARITH_INST_RETIRED.VECTOR] + [FP_ARITH_INST_RETIRED2.VECTOR] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) ) + ( ( ( [INT_VEC_RETIRED.ADD_128] + [INT_VEC_RETIRED.VNNI_128] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( [INT_VEC_RETIRED.ADD_256] + [INT_VEC_RETIRED.MUL_256] + [INT_VEC_RETIRED.VNNI_256] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) ) + ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [MEM_UOP_RETIRED.ANY] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * [INST_RETIRED.MACRO_FUSED] / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) + ( ( max( 0 , ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) ) ) * ( [BR_INST_RETIRED.ALL_BRANCHES] - [INST_RETIRED.MACRO_FUSED] ) / ( ( [PERF_METRICS.RETIRING] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) * ( [TOPDOWN.SLOTS] ) ) ) ) ) )" }, { "name": "TMA_..Heavy_Operations(%)", "expression": "100 * ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) )" }, { - "name": "TMA_....Microcode_Sequencer(%)", - "expression": "100 * ( [UOPS_RETIRED.MS] / ( [TOPDOWN.SLOTS] ) )" + "name": "TMA_....Few_Uops_Instructions(%)", + "expression": "100 * ( max( 0 , ( [PERF_METRICS.HEAVY_OPERATIONS] / ( [PERF_METRICS.FRONTEND_BOUND] + [PERF_METRICS.BAD_SPECULATION] + [PERF_METRICS.RETIRING] + [PERF_METRICS.BACKEND_BOUND] ) ) - ( [UOPS_RETIRED.MS] / ( [TOPDOWN.SLOTS] ) ) ) )" }, { - "name": "TMA_Info_Thread_IPC", - "expression": "[instructions] / ( [cpu-cycles] )" + "name": "TMA_....Microcode_Sequencer(%)", + "expression": "100 * ( [UOPS_RETIRED.MS] / ( [TOPDOWN.SLOTS] ) )" } ] \ No newline at end of file From 3dab1b3606ae874d4b3ece3b08bbc4f99ca9df76 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 18:49:14 -0700 Subject: [PATCH 12/20] reorder Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 6fd677d8..3a1ea102 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -114,36 +114,6 @@ cpu-cycles:k, ref-cycles:k, instructions:k; -#UPI -upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; - -#CHA (Cache) -cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, -cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, -cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; - -cha/event=0x35,umask=0xC816FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, -cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, -cha/event=0x35,umask=0xC896FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, -cha/event=0x35,umask=0xC8977E01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; - -cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, -cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, -cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, -cha/event=0x36,umask=0xC817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; - -#CHA (IO Bandwidth) -cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, -cha/event=0x35,umask=0xCC43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, -cha/event=0x35,umask=0xCD43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, -cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; - -#IMC (memory read/writes) -imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, -imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, -imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, -imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; - cpu/event=0xc2,umask=0x02,name='UOPS_RETIRED.SLOTS'/, cpu/event=0xae,umask=0x01,name='UOPS_ISSUED.ANY'/; @@ -206,6 +176,36 @@ cpu/event=0xe7,umask=0x10,name='INT_VEC_RETIRED.VNNI_128'/; cpu/event=0xe5,umask=0x03,name='MEM_UOP_RETIRED.ANY'/, cpu/event=0xc0,umask=0x10,name='INST_RETIRED.MACRO_FUSED'/; +#UPI +upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; + +#CHA (Cache) +cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, +cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, +cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; + +cha/event=0x35,umask=0xC816FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, +cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, +cha/event=0x35,umask=0xC896FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, +cha/event=0x35,umask=0xC8977E01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; + +cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, +cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, +cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, +cha/event=0x36,umask=0xC817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; + +#CHA (IO Bandwidth) +cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, +cha/event=0x35,umask=0xCC43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, +cha/event=0x35,umask=0xCD43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, +cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; + +#IMC (memory read/writes) +imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, +imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, +imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, +imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; + #C6 cstate_core/c6-residency/; cstate_pkg/c6-residency/; From 7d9381c95fd03627e25f58981902644ee509b3eb Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 19:33:51 -0700 Subject: [PATCH 13/20] support comments at end of event line Signed-off-by: Harper, Jason M --- cmd/metrics/event_defs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/metrics/event_defs.go b/cmd/metrics/event_defs.go index 5b5a6544..b790f921 100644 --- a/cmd/metrics/event_defs.go +++ b/cmd/metrics/event_defs.go @@ -63,6 +63,12 @@ func LoadEventGroups(eventDefinitionOverridePath string, metadata Metadata) (gro if len(line) == 0 || line[0] == '#' { continue } + // strip end of line comment + if idx := strings.Index(line, "#"); idx != -1 { + line = line[:idx] + } + // remove trailing spaces + line = strings.TrimSpace(line) var event EventDefinition if event, err = parseEventDefinition(line[:len(line)-1]); err != nil { return From ff6638d5598e16d36e8912d8939057dd2fdb18ee Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Wed, 18 Jun 2025 19:34:02 -0700 Subject: [PATCH 14/20] add cmask and period Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 212 +++++++++--------- 1 file changed, 107 insertions(+), 105 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 3a1ea102..d788f679 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -1,37 +1,37 @@ # GraniteRapids event list -cpu/event=0x51,umask=0x01,period=100003,name='L1D.REPLACEMENT'/, -cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, -cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, -cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, +cpu/event=0x51,umask=0x01,period=100003,name='L1D.REPLACEMENT'/, # 0,1,2,3 +cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, # 0,1,2,3 +cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, # 0,1,2,3 +cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, # 0,1,2,3 cpu/event=0xa6,umask=0x02,period=2000003,name='EXE_ACTIVITY.1_PORTS_UTIL'/, cpu-cycles, ref-cycles, instructions; -cpu/event=0xd1,umask=0x10,period=100021,name='MEM_LOAD_RETIRED.L2_MISS'/, -cpu/event=0x24,umask=0x24,period=200003,name='L2_RQSTS.CODE_RD_MISS'/, -cpu/event=0x11,umask=0x0e,period=100003,name='ITLB_MISSES.WALK_COMPLETED'/, -cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, +cpu/event=0xd1,umask=0x10,period=100021,name='MEM_LOAD_RETIRED.L2_MISS'/, # 0,1,2,3 +cpu/event=0x24,umask=0x24,period=200003,name='L2_RQSTS.CODE_RD_MISS'/, # 0,1,2,3 +cpu/event=0x11,umask=0x0e,period=100003,name='ITLB_MISSES.WALK_COMPLETED'/, # 0,1,2,3 +cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, # 0,1,2,3 cpu/event=0xa6,umask=0x40,cmask=0x02,period=1000003,name='EXE_ACTIVITY.BOUND_ON_STORES'/, cpu/event=0xa6,umask=0x21,cmask=0x05,period=2000003,name='EXE_ACTIVITY.BOUND_ON_LOADS'/, cpu/event=0xad,umask=0x10,period=1000003,name='INT_MISC.UOP_DROPPING'/, -cpu/event=0xad,umask=0x40,period=1000003,name='INT_MISC.UNKNOWN_BRANCH_CYCLES'/, +cpu/event=0xad,umask=0x40,period=1000003,name='INT_MISC.UNKNOWN_BRANCH_CYCLES'/, # [*] cpu-cycles, ref-cycles, instructions; -cpu/event=0xc4,umask=0x00,period=100003,name='BR_INST_RETIRED.ALL_BRANCHES'/, -cpu/event=0xc5,umask=0x00,period=100003,name='BR_MISP_RETIRED.ALL_BRANCHES'/, -cpu/event=0x12,umask=0x0e,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED'/, -cpu/event=0x12,umask=0x04,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M'/, -cpu/event=0x13,umask=0x0e,period=100003,name='DTLB_STORE_MISSES.WALK_COMPLETED'/, -cpu/event=0xd1,umask=0x02,period=200003,name='MEM_LOAD_RETIRED.L2_HIT'/, +cpu/event=0xc4,umask=0x00,period=400009,name='BR_INST_RETIRED.ALL_BRANCHES'/, +cpu/event=0xc5,umask=0x00,period=400009,name='BR_MISP_RETIRED.ALL_BRANCHES'/, +cpu/event=0x12,umask=0x0e,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED'/, # 0,1,2,3 +cpu/event=0x12,umask=0x04,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M'/, # 0,1,2,3 +cpu/event=0x13,umask=0x0e,period=100003,name='DTLB_STORE_MISSES.WALK_COMPLETED'/, # 0,1,2,3 +cpu/event=0xd1,umask=0x02,period=200003,name='MEM_LOAD_RETIRED.L2_HIT'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x00,umask=0x04,period=10000003,name='TOPDOWN.SLOTS'/, +cpu/event=0x00,umask=0x04,period=10000003,name='TOPDOWN.SLOTS'/, # Fixed counter 3 cpu/event=0x00,umask=0x81,period=10000003,name='PERF_METRICS.BAD_SPECULATION'/, cpu/event=0x00,umask=0x83,period=10000003,name='PERF_METRICS.BACKEND_BOUND'/, cpu/event=0x00,umask=0x82,period=10000003,name='PERF_METRICS.FRONTEND_BOUND'/, @@ -40,16 +40,16 @@ cpu/event=0x00,umask=0x86,period=10000003,name='PERF_METRICS.FETCH_LATENCY'/, cpu/event=0x00,umask=0x87,period=10000003,name='PERF_METRICS.MEMORY_BOUND'/, cpu/event=0x00,umask=0x85,period=10000003,name='PERF_METRICS.BRANCH_MISPREDICTS'/, cpu/event=0x00,umask=0x84,period=10000003,name='PERF_METRICS.HEAVY_OPERATIONS'/, -cpu/event=0x47,umask=0x09,cmask=0x09,period=1000003,name='MEMORY_ACTIVITY.STALLS_L3_MISS'/, -cpu/event=0x80,umask=0x04,period=500009,name='ICACHE_DATA.STALLS'/, -cpu/event=0x83,umask=0x04,period=200003,name='ICACHE_TAG.STALLS'/, +cpu/event=0x47,umask=0x09,cmask=0x09,period=1000003,name='MEMORY_ACTIVITY.STALLS_L3_MISS'/, # 0,1,2,3 +cpu/event=0x80,umask=0x04,period=500009,name='ICACHE_DATA.STALLS'/, # 0,1,2,3 +cpu/event=0x83,umask=0x04,period=200003,name='ICACHE_TAG.STALLS'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, -cpu/event=0x47,umask=0x05,cmask=0x05,period=1000003,name='MEMORY_ACTIVITY.STALLS_L2_MISS'/, -cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_ACTIVE'/, +cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, # 0,1,2,3 +cpu/event=0x47,umask=0x05,cmask=0x05,period=1000003,name='MEMORY_ACTIVITY.STALLS_L2_MISS'/, # 0,1,2,3 +cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_ACTIVE'/, # 0,1,2,3 cpu/event=0xa3,umask=0x10,cmask=0x10,period=1000003,name='CYCLE_ACTIVITY.CYCLES_MEM_ANY'/, cpu/event=0xad,umask=0x80,period=500009,name='INT_MISC.CLEAR_RESTEER_CYCLES'/, cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, @@ -57,22 +57,24 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd1,umask=0x08,cmask=0x00,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, -cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, +cpu/event=0xd1,umask=0x08,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, # 0,1,2,3 +cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, # [*] cpu-cycles, ref-cycles, instructions; -cpu/event=0xd0,umask=0x21,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.LOCK_LOADS'/, -cpu/event=0xd0,umask=0x82,cmask=0x00,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, +cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1'/, # [*] +cpu/event=0xd0,umask=0x21,period=100007,name='MEM_INST_RETIRED.LOCK_LOADS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x82,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, -cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, -cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, -cpu/event=0xd1,umask=0x40,cmask=0x00,period=100007,name='MEM_LOAD_RETIRED.FB_HIT'/, +cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1:e1'/, # [*] +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 +cpu/event=0x2b,umask=0x01,period=100003,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, # 0,1,2,3 +cpu/event=0xd1,umask=0x40,period=100007,name='MEM_LOAD_RETIRED.FB_HIT'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; @@ -83,98 +85,98 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xd2,umask=0x02,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, -cpu/event=0xd2,umask=0x04,cmask=0x00,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, -cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, +cpu/event=0xd2,umask=0x02,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, # 0,1,2,3 +cpu/event=0xd2,umask=0x04,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, # 0,1,2,3 +cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; -cpu/event=0x2a,umask=0x01,cmask=0x00,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, -cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, # 0,1,2,3 cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, cpu-cycles, ref-cycles, instructions; -cpu/event=0xe7,umask=0x0c,cmask=0x00,period=100003,name='INT_VEC_RETIRED.ADD_256'/, -cpu/event=0xe7,umask=0x20,cmask=0x00,period=100003,name='INT_VEC_RETIRED.VNNI_256'/, -cpu/event=0xe7,umask=0x80,cmask=0x00,period=100003,name='INT_VEC_RETIRED.MUL_256'/, -cpu/event=0x79,umask=0x08,cmask=0x00,period=2000003,name='IDQ.DSB_UOPS'/, -cpu/event=0x79,umask=0x04,period=100003,name='IDQ.MITE_UOPS'/, -cpu/event=0x79,umask=0x20,period=100003,name='IDQ.MS_UOPS'/, -cpu/event=0xa8,umask=0x01,cmask=0x00,period=2000003,name='LSD.UOPS'/, +cpu/event=0xe7,umask=0x0c,period=1000003,name='INT_VEC_RETIRED.ADD_256'/, +cpu/event=0xe7,umask=0x20,period=1000003,name='INT_VEC_RETIRED.VNNI_256'/, +cpu/event=0xe7,umask=0x80,period=1000003,name='INT_VEC_RETIRED.MUL_256'/, +cpu/event=0x79,umask=0x08,period=2000003,name='IDQ.DSB_UOPS'/, # 0,1,2,3 +cpu/event=0x79,umask=0x04,period=2000003,name='IDQ.MITE_UOPS'/, # 0,1,2,3 +cpu/event=0x79,umask=0x20,period=1000003,name='IDQ.MS_UOPS'/, # 0,1,2,3 +cpu/event=0xa8,umask=0x01,period=2000003,name='LSD.UOPS'/, cpu-cycles, ref-cycles, instructions; -cpu/event=0x2a,umask=0x01,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, -cpu/event=0x2a,umask=0x01,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 cpu-cycles:k, ref-cycles:k, instructions:k; -cpu/event=0xc2,umask=0x02,name='UOPS_RETIRED.SLOTS'/, -cpu/event=0xae,umask=0x01,name='UOPS_ISSUED.ANY'/; - -cpu/event=0x87,umask=0x01,name='DECODE.LCP'/, -cpu/event=0x61,umask=0x02,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, -cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_ANY'/, -cpu/event=0x79,umask=0x04,name='IDQ.MITE_CYCLES_OK'/; - -cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_ANY'/, -cpu/event=0x79,umask=0x08,name='IDQ.DSB_CYCLES_OK'/, -cpu/event=0x79,umask=0x20,name='IDQ.MS_CYCLES_ANY'/; - -cpu/event=0xc5,umask=0x50,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, -cpu/event=0xc5,umask=0x41,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, -cpu/event=0xc5,umask=0x42,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, -cpu/event=0xc5,umask=0xc0,name='BR_MISP_RETIRED.INDIRECT_COST'/, -cpu/event=0xc5,umask=0x48,name='BR_MISP_RETIRED.RET_COST'/; - -cpu/event=0xad,umask=0x01,name='INT_MISC.CLEARS_COUNT'/, -cpu/event=0xc3,umask=0x01,name='MACHINE_CLEARS.COUNT'/, -cpu/event=0xc3,umask=0x02,name='MACHINE_CLEARS.MEMORY_ORDERING'/, -cpu/event=0xd0,umask=0x09,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, -cpu/event=0x03,umask=0x82,name='LD_BLOCKS.STORE_FORWARD'/, -cpu/event=0xd0,umask=0x81,name='MEM_INST_RETIRED.ALL_LOADS'/, -cpu/event=0xd0,umask=0x41,name='MEM_INST_RETIRED.SPLIT_LOADS'/; - -cpu/event=0x48,umask=0x01,name='L1D_PEND_MISS.PENDING'/, -cpu/event=0x43,umask=0xfd,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, -cpu/event=0x48,umask=0x02,name='L1D_PEND_MISS.FB_FULL'/, -cpu/event=0xd2,umask=0x01,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; - -cpu/event=0xd1,umask=0x04,name='MEM_LOAD_RETIRED.L3_HIT'/, -cpu/event=0x2d,umask=0x01,name='XQ.FULL_CYCLES'/; - -cpu/event=0x48,umask=0x04,name='L1D_PEND_MISS.L2_STALLS'/, -cpu/event=0x44,umask=0x01,name='MEM_STORE_RETIRED.L2_HIT'/, -cpu/event=0x2A,umask=0x01,name='OCR.DEMAND_RFO.L3_MISS'/, -cpu/event=0xd0,umask=0x42,name='MEM_INST_RETIRED.SPLIT_STORES'/; - -cpu/event=0x2A,umask=0x01,name='OCR.STREAMING_WR.ANY_RESPONSE'/, -cpu/event=0xd0,umask=0x0a,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, -cpu/event=0x13,umask=0x10,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; - -cpu/event=0xb0,umask=0x09,name='ARITH.DIV_ACTIVE'/, -cpu/event=0xa2,umask=0x02,name='RESOURCE_STALLS.SCOREBOARD'/, -cpu/event=0xec,umask=0x20,name='CPU_CLK_UNHALTED.C02'/, -cpu/event=0xa6,umask=0x80,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, -cpu/event=0xa6,umask=0xC,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, -cpu/event=0xa3,umask=0x04,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; - -cpu/event=0xb1,umask=0x10,name='UOPS_EXECUTED.X87'/, -cpu/event=0xb1,umask=0x01,name='UOPS_EXECUTED.THREAD'/, -cpu/event=0xc7,umask=0x03,name='FP_ARITH_INST_RETIRED.SCALAR'/, -cpu/event=0xcf,umask=0x03,name='FP_ARITH_INST_RETIRED2.SCALAR'/, -cpu/event=0xc7,umask=0xfc,name='FP_ARITH_INST_RETIRED.VECTOR'/, -cpu/event=0xcf,umask=0x1c,name='FP_ARITH_INST_RETIRED2.VECTOR'/, -cpu/event=0xe7,umask=0x03,name='INT_VEC_RETIRED.ADD_128'/, -cpu/event=0xe7,umask=0x10,name='INT_VEC_RETIRED.VNNI_128'/; - -cpu/event=0xe5,umask=0x03,name='MEM_UOP_RETIRED.ANY'/, -cpu/event=0xc0,umask=0x10,name='INST_RETIRED.MACRO_FUSED'/; +cpu/event=0xc2,umask=0x02,period=2000003,name='UOPS_RETIRED.SLOTS'/, +cpu/event=0xae,umask=0x01,period=2000003,name='UOPS_ISSUED.ANY'/; + +cpu/event=0x87,umask=0x01,period=500009,name='DECODE.LCP'/, # 0,1,2,3 +cpu/event=0x61,umask=0x02,period=100003,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, # 0,1,2,3 +cpu/event=0x79,umask=0x04,cmask=0x01,period=2000003,name='IDQ.MITE_CYCLES_ANY'/, # 0,1,2,3 +cpu/event=0x79,umask=0x04,cmask=0x06,period=2000003,name='IDQ.MITE_CYCLES_OK'/; # 0,1,2,3 + +cpu/event=0x79,umask=0x08,cmask=0x01,period=2000003,name='IDQ.DSB_CYCLES_ANY'/, # 0,1,2,3 +cpu/event=0x79,umask=0x08,cmask=0x06,period=2000003,name='IDQ.DSB_CYCLES_OK'/, # 0,1,2,3 +cpu/event=0x79,umask=0x20,cmask=0x01,period=2000003,name='IDQ.MS_CYCLES_ANY'/; # 0,1,2,3 + +cpu/event=0xc5,umask=0x50,period=400009,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, +cpu/event=0xc5,umask=0x41,period=400009,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, +cpu/event=0xc5,umask=0x42,period=400009,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, +cpu/event=0xc5,umask=0xc0,period=100003,name='BR_MISP_RETIRED.INDIRECT_COST'/, +cpu/event=0xc5,umask=0x48,period=100007,name='BR_MISP_RETIRED.RET_COST'/; + +cpu/event=0xad,umask=0x01,cmask=0x01,period=500009,name='INT_MISC.CLEARS_COUNT'/, +cpu/event=0xc3,umask=0x01,cmask=0x01,period=100003,name='MACHINE_CLEARS.COUNT'/, +cpu/event=0xc3,umask=0x02,period=100003,name='MACHINE_CLEARS.MEMORY_ORDERING'/, +cpu/event=0xd0,umask=0x09,period=100003,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, # 0,1,2,3 +cpu/event=0x03,umask=0x82,period=100003,name='LD_BLOCKS.STORE_FORWARD'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x81,period=1000003,name='MEM_INST_RETIRED.ALL_LOADS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x41,period=100003,name='MEM_INST_RETIRED.SPLIT_LOADS'/; # 0,1,2,3 + +cpu/event=0x48,umask=0x01,period=1000003,name='L1D_PEND_MISS.PENDING'/, # 0,1,2,3 +cpu/event=0x43,umask=0xfd,period=1000003,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, # 0,1,2,3 +cpu/event=0x48,umask=0x02,period=1000003,name='L1D_PEND_MISS.FB_FULL'/, # 0,1,2,3 +cpu/event=0xd2,umask=0x01,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; # 0,1,2,3 + +cpu/event=0xd1,umask=0x04,period=100021,name='MEM_LOAD_RETIRED.L3_HIT'/, # 0,1,2,3 +cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/; # 0,1,2,3 + +cpu/event=0x48,umask=0x04,period=1000003,name='L1D_PEND_MISS.L2_STALLS'/, # 0,1,2,3 +cpu/event=0x44,umask=0x01,period=200003,name='MEM_STORE_RETIRED.L2_HIT'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/; # 0,1,2,3 + +cpu/event=0x2a,umask=0x01,period=100003,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x0a,period=100003,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, # 0,1,2,3 +cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; # 0,1,2,3 + +cpu/event=0xb0,umask=0x09,cmask=0x01,period=1000003,name='ARITH.DIV_ACTIVE'/, +cpu/event=0xa2,umask=0x02,period=100003,name='RESOURCE_STALLS.SCOREBOARD'/, +cpu/event=0xec,umask=0x20,period=2000003,name='CPU_CLK_UNHALTED.C02'/, +cpu/event=0xa6,umask=0x80,period=1000003,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, +cpu/event=0xa6,umask=0xC,period=2000003,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, +cpu/event=0xa3,umask=0x04,cmask=0x04,period=1000003,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; + +cpu/event=0xb1,umask=0x10,period=2000003,name='UOPS_EXECUTED.X87'/, +cpu/event=0xb1,umask=0x01,period=2000003,name='UOPS_EXECUTED.THREAD'/, +cpu/event=0xc7,umask=0x03,period=1000003,name='FP_ARITH_INST_RETIRED.SCALAR'/, +cpu/event=0xcf,umask=0x03,period=100003,name='FP_ARITH_INST_RETIRED2.SCALAR'/, +cpu/event=0xc7,umask=0xfc,period=1000003,name='FP_ARITH_INST_RETIRED.VECTOR'/, +cpu/event=0xcf,umask=0x1c,period=100003,name='FP_ARITH_INST_RETIRED2.VECTOR'/, +cpu/event=0xe7,umask=0x03,period=1000003,name='INT_VEC_RETIRED.ADD_128'/, +cpu/event=0xe7,umask=0x10,period=1000003,name='INT_VEC_RETIRED.VNNI_128'/; + +cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, +cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/; #UPI upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; From f8528aa2ad3d70c128c0bc6c2a3de7640036bcdf Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Thu, 19 Jun 2025 05:51:08 -0700 Subject: [PATCH 15/20] ocr Signed-off-by: Harper, Jason M --- .../resources/events/x86_64/GenuineIntel/gnr.txt | 10 +++++----- .../resources/metrics/x86_64/GenuineIntel/gnr.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index d788f679..c037de29 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -71,9 +71,9 @@ ref-cycles, instructions; cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1:e1'/, # [*] -cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 -cpu/event=0x2b,umask=0x01,period=100003,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 -cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 +cpu/event=0x2b,umask=0x01,period=100003,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, # 0,1,2,3 cpu/event=0xd1,umask=0x40,period=100007,name='MEM_LOAD_RETIRED.FB_HIT'/, # 0,1,2,3 cpu-cycles, ref-cycles, @@ -152,10 +152,10 @@ cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/; cpu/event=0x48,umask=0x04,period=1000003,name='L1D_PEND_MISS.L2_STALLS'/, # 0,1,2,3 cpu/event=0x44,umask=0x01,period=200003,name='MEM_STORE_RETIRED.L2_HIT'/, # 0,1,2,3 -cpu/event=0x2a,umask=0x01,period=100003,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x103b800002,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/; # 0,1,2,3 -cpu/event=0x2a,umask=0x01,period=100003,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x10800,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 cpu/event=0xd0,umask=0x0a,period=100003,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, # 0,1,2,3 cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; # 0,1,2,3 diff --git a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json index defd0460..91b6de82 100644 --- a/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json +++ b/cmd/metrics/resources/metrics/x86_64/GenuineIntel/gnr.json @@ -413,7 +413,7 @@ }, { "name": "TMA_......False_Sharing(%)", - "expression": "100 * ( ( ( 170 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_MISS:ocr_msr_val=0x103b800002] + ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] ) / ( [cpu-cycles] ) )" + "expression": "100 * ( ( ( 170 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_MISS] + ( 81 * ( ( ( [cpu-cycles] ) / [ref-cycles] ) * [SYSTEM_TSC_FREQ] / ( 1000000000 ) / ( ( 1000 / 1000 ) ) ) ) * [OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM] ) / ( [cpu-cycles] ) )" }, { "name": "TMA_......Split_Stores(%)", From 11ef1cfb9101d6e28df7d58b17cd8719d3065e71 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Thu, 19 Jun 2025 06:57:44 -0700 Subject: [PATCH 16/20] format uncore Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 40 ++--- scripts/perfmonevents2perfspect.py | 145 ++++++++++++------ 2 files changed, 118 insertions(+), 67 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index c037de29..4041d605 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -179,34 +179,34 @@ cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/; #UPI -upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; +upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; # 0,1,2,3 #CHA (Cache) -cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, -cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, -cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; +cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, # 0,1,2,3 +cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, # 0,1,2,3 +cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; # 0 -cha/event=0x35,umask=0xC816FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, -cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, -cha/event=0x35,umask=0xC896FE01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, -cha/event=0x35,umask=0xC8977E01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; +cha/event=0x35,umask=0xc816fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, # 0,1,2,3 +cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, # 0 +cha/event=0x35,umask=0xc896fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, # 0,1,2,3 +cha/event=0x35,umask=0xc8977e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; # 0,1,2,3 -cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, -cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, -cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, -cha/event=0x36,umask=0xC817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; +cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, # 0,1,2,3 +cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, # 0,1,2,3 +cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, # 0,1,2,3 +cha/event=0x36,umask=0xc817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; # 0 #CHA (IO Bandwidth) -cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, -cha/event=0x35,umask=0xCC43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, -cha/event=0x35,umask=0xCD43FF04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, -cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; +cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, # 0,1,2,3 +cha/event=0x35,umask=0xcc43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, # 0,1,2,3 +cha/event=0x35,umask=0xcd43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, # 0,1,2,3 +cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; # 0,1,2,3 #IMC (memory read/writes) -imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, -imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, -imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, -imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; +imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, # 0,1,2,3 +imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, # 0,1,2,3 +imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, # 0,1,2,3 +imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; # 0,1,2,3 #C6 cstate_core/c6-residency/; diff --git a/scripts/perfmonevents2perfspect.py b/scripts/perfmonevents2perfspect.py index 9e60be30..0ba0a336 100755 --- a/scripts/perfmonevents2perfspect.py +++ b/scripts/perfmonevents2perfspect.py @@ -12,12 +12,92 @@ import sys import json -# arg1 - perfmon event json file (exported from perfmon.intel.com) -# arg2 - file containing list of event names, one event name per line +def format_event(p): + """ + Format a single event from perfmon to perfspect format. + """ + eventParts = [] + unit = p.get("Unit", "cpu") + unit = unit.split(" ")[0] # take the first part of the unit if it has multiple parts + unit = unit.lower() + # /event + eventParts.append(f"{unit}/event={p['EventCode']}") + # umask + if p.get("UMaskExt", "") != "": # only uncore events + umask_value = int(p["UMask"], 16) # convert hex to int + umask_hex = f"{umask_value:02x}" + umaskext_value = int(p["UMaskExt"], 16) # convert hex to int + umaskext_hex = f"{umaskext_value:x}" + eventParts.append(f"umask=0x{umaskext_hex}{umask_hex}") + else: + eventParts.append(f"umask={p['UMask']}") + # cmask + if p.get("CounterMask", "") != "": # only core events + if p["CounterMask"] != "0": + # convert to int + cmask_value = int(p["CounterMask"]) + # convert to hex, pad with zeros to 2 digits for consistency + cmask_hex = f"0x{cmask_value:02x}" + eventParts.append(f"cmask={cmask_hex}") + # period + if p.get("SampleAfterValue", "") != "": # only core events + eventParts.append(f"period={p['SampleAfterValue']}") + # offcore_rsp + if p.get("Offcore", "") != "": # only core events + if p["Offcore"] == "1": + eventParts.append(f"offcore_rsp={p['MSRValue']}") + # name + eventParts.append(f"name='{p['EventName']}'") + event = ",".join(eventParts) + event += "/" + # Add optional comment with counter and takenAlone info + # if counter is not "0,1,2,3,4,5,6,7" or takenAlone is "1", add them to the comment + counter = "" + takenAlone = "" + comment = "" + if p["Counter"] != "0,1,2,3,4,5,6,7": + counter = p['Counter'] + if p.get("TakenAlone", "") != "": # only core events + if p["TakenAlone"] == "1": + takenAlone = "[*]" + if counter != "" or takenAlone != "": + comment = f" # {counter}{takenAlone}" + if comment != "": + event = event.ljust(100) + comment + return event + +def format_all_events(events): + """ + Format all events from perfmon to perfspect format. + """ + result = [] + for p in events: + result.append(format_event(p)) + return result + +def format_event_list(events, event_names): + """ + Format a list of events from perfmon to perfspect format. + """ + result = [] + not_found = [] + for e in event_names: + e = e.strip() + for p in events: + if p["EventName"] == e: + result.append(format_event(p)) + break + else: + not_found.append(e) + return result, not_found + +# arg1 - perfmon core event json file (downloaded from github.com/intel/perfmon) +# arg2 - file containing list of event names, one event name per line [optional] +# if 2nd argument is not provided, all events from perfmon json file are used if __name__ == "__main__": - if len(sys.argv) < 3: + if len(sys.argv) < 2: print( - "Usage: perfmonevents2perfspect.py ", + "Usage: perfmonevents2perfspect.py []", file=sys.stderr, ) sys.exit(1) @@ -27,52 +107,23 @@ perfmon = json.load(f) # read list of event names - with open(sys.argv[2], "r") as f: - events = f.readlines() - - # for each event name, find corresponding event in perfmon json and create a perfspect formatted event - # example: cpu/event=0x71,umask=0x00,period=1000003,name='TOPDOWN_FE_BOUND.ALL'/ - # if event name is not found in perfmon json file, it is added to a list of not found events - result = [] - notfound = [] - for e in events: - e = e.strip() - for p in perfmon["Events"]: - if p["EventName"] == e: - eventParts = [] - unit = p.get("Unit", "cpu") - unit = unit.split(" ")[0] # take the first part of the unit if it has multiple parts - unit = unit.lower() - eventParts.append(f"{unit}/event={p['EventCode']}") - eventParts.append(f"umask={p['UMask']}") - if p.get("SampleAfterValue", "") != "": - eventParts.append(f"period={p['SampleAfterValue']}") - eventParts.append(f"name='{p['EventName']}'") - event = ",".join(eventParts) - event += "/" - # Add optional comment with counter and takenAlone info - # if counter is not "0,1,2,3,4,5,6,7" or takenAlone is "1", add them to the comment - counter = "" - takenAlone = "" - comment = "" - if p["Counter"] != "0,1,2,3,4,5,6,7": - counter = p['Counter'] - if p.get("TakenAlone", "0") == "1": - takenAlone = "[*]" - if counter != "" or takenAlone != "": - comment = f" # {counter}{takenAlone}" - if comment != "": - event = event.ljust(80) + comment - result.append(event) - break - else: - notfound.append(e) + if len(sys.argv) < 3: + # if no event names file is provided, use all events from perfmon json + result = format_all_events(perfmon["Events"]) + not_found = [] + else: + # read event names from file + with open(sys.argv[2], "r") as f: + events = f.readlines() + events = [e.strip() for e in events if e.strip()] + result, not_found = format_event_list(perfmon["Events"], events) # print perfspect formatted events to stdout for r in result: print(r) # print the not found event names to stderr - print("\nNot Found Events:", file=sys.stderr) - for n in notfound: - print(n, file=sys.stderr) + if not_found: + print("\nNot Found Events:", file=sys.stderr) + for n in not_found: + print(n, file=sys.stderr) From 5903c7d2156d713eea87a90bc1c82f9e2c8bb6e4 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Fri, 20 Jun 2025 06:20:56 -0700 Subject: [PATCH 17/20] merge cpu groups Signed-off-by: Harper, Jason M --- .../events/x86_64/GenuineIntel/gnr.txt | 104 ++++++++++-------- 1 file changed, 58 insertions(+), 46 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 4041d605..4e0c4fbe 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -5,6 +5,8 @@ cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, # 0,1,2,3 cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, # 0,1,2,3 cpu/event=0xa6,umask=0x02,period=2000003,name='EXE_ACTIVITY.1_PORTS_UTIL'/, +cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, +cpu/event=0xb7,umask=0x02,period=2000003,name='EXE.AMX_BUSY'/, cpu-cycles, ref-cycles, instructions; @@ -21,6 +23,8 @@ cpu-cycles, ref-cycles, instructions; +cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, +cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/, cpu/event=0xc4,umask=0x00,period=400009,name='BR_INST_RETIRED.ALL_BRANCHES'/, cpu/event=0xc5,umask=0x00,period=400009,name='BR_MISP_RETIRED.ALL_BRANCHES'/, cpu/event=0x12,umask=0x0e,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED'/, # 0,1,2,3 @@ -43,6 +47,8 @@ cpu/event=0x00,umask=0x84,period=10000003,name='PERF_METRICS.HEAVY_OPERATIONS'/, cpu/event=0x47,umask=0x09,cmask=0x09,period=1000003,name='MEMORY_ACTIVITY.STALLS_L3_MISS'/, # 0,1,2,3 cpu/event=0x80,umask=0x04,period=500009,name='ICACHE_DATA.STALLS'/, # 0,1,2,3 cpu/event=0x83,umask=0x04,period=200003,name='ICACHE_TAG.STALLS'/, # 0,1,2,3 +cpu/event=0xc2,umask=0x02,period=2000003,name='UOPS_RETIRED.SLOTS'/, +cpu/event=0xae,umask=0x01,period=2000003,name='UOPS_ISSUED.ANY'/; cpu-cycles, ref-cycles, instructions; @@ -53,19 +59,15 @@ cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_A cpu/event=0xa3,umask=0x10,cmask=0x10,period=1000003,name='CYCLE_ACTIVITY.CYCLES_MEM_ANY'/, cpu/event=0xad,umask=0x80,period=500009,name='INT_MISC.CLEAR_RESTEER_CYCLES'/, cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, -cpu-cycles, -ref-cycles, -instructions; - cpu/event=0xd1,umask=0x08,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, # 0,1,2,3 cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, # [*] cpu-cycles, ref-cycles, instructions; -cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1'/, # [*] -cpu/event=0xd0,umask=0x21,period=100007,name='MEM_INST_RETIRED.LOCK_LOADS'/, # 0,1,2,3 -cpu/event=0xd0,umask=0x82,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, # 0,1,2,3 +cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1'/, # [*] +cpu/event=0xd0,umask=0x21,period=100007,name='MEM_INST_RETIRED.LOCK_LOADS'/, # 0,1,2,3 +cpu/event=0xd0,umask=0x82,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, # 0,1,2,3 cpu-cycles, ref-cycles, instructions; @@ -79,22 +81,14 @@ cpu-cycles, ref-cycles, instructions; -cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/, -cpu/event=0xb7,umask=0x02,period=2000003,name='EXE.AMX_BUSY'/, -cpu-cycles, -ref-cycles, -instructions; - cpu/event=0xd2,umask=0x02,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, # 0,1,2,3 cpu/event=0xd2,umask=0x04,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, # 0,1,2,3 cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, # 0,1,2,3 -cpu-cycles, -ref-cycles, -instructions; - -cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 -cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, # 0,1,2,3 -cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, +cpu/event=0xc5,umask=0x50,period=400009,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, +cpu/event=0xc5,umask=0x41,period=400009,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, +cpu/event=0xc5,umask=0x42,period=400009,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, +cpu/event=0xc5,umask=0xc0,period=100003,name='BR_MISP_RETIRED.INDIRECT_COST'/, +cpu/event=0xc5,umask=0x48,period=100007,name='BR_MISP_RETIRED.RET_COST'/, cpu-cycles, ref-cycles, instructions; @@ -112,27 +106,30 @@ instructions; cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, # 0,1,2,3 cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3 +cpu/event=0xb0,umask=0x09,cmask=0x01,period=1000003,name='ARITH.DIV_ACTIVE'/, +cpu/event=0xa2,umask=0x02,period=100003,name='RESOURCE_STALLS.SCOREBOARD'/, +cpu/event=0xec,umask=0x20,period=2000003,name='CPU_CLK_UNHALTED.C02'/, +cpu/event=0xa6,umask=0x80,period=1000003,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, +cpu/event=0xa6,umask=0xC,period=2000003,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, +cpu/event=0xa3,umask=0x04,cmask=0x04,period=1000003,name='CYCLE_ACTIVITY.STALLS_TOTAL'/, cpu-cycles:k, ref-cycles:k, instructions:k; -cpu/event=0xc2,umask=0x02,period=2000003,name='UOPS_RETIRED.SLOTS'/, -cpu/event=0xae,umask=0x01,period=2000003,name='UOPS_ISSUED.ANY'/; - cpu/event=0x87,umask=0x01,period=500009,name='DECODE.LCP'/, # 0,1,2,3 cpu/event=0x61,umask=0x02,period=100003,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, # 0,1,2,3 cpu/event=0x79,umask=0x04,cmask=0x01,period=2000003,name='IDQ.MITE_CYCLES_ANY'/, # 0,1,2,3 -cpu/event=0x79,umask=0x04,cmask=0x06,period=2000003,name='IDQ.MITE_CYCLES_OK'/; # 0,1,2,3 +cpu/event=0x79,umask=0x04,cmask=0x06,period=2000003,name='IDQ.MITE_CYCLES_OK'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x79,umask=0x08,cmask=0x01,period=2000003,name='IDQ.DSB_CYCLES_ANY'/, # 0,1,2,3 cpu/event=0x79,umask=0x08,cmask=0x06,period=2000003,name='IDQ.DSB_CYCLES_OK'/, # 0,1,2,3 -cpu/event=0x79,umask=0x20,cmask=0x01,period=2000003,name='IDQ.MS_CYCLES_ANY'/; # 0,1,2,3 - -cpu/event=0xc5,umask=0x50,period=400009,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/, -cpu/event=0xc5,umask=0x41,period=400009,name='BR_MISP_RETIRED.COND_TAKEN_COST'/, -cpu/event=0xc5,umask=0x42,period=400009,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/, -cpu/event=0xc5,umask=0xc0,period=100003,name='BR_MISP_RETIRED.INDIRECT_COST'/, -cpu/event=0xc5,umask=0x48,period=100007,name='BR_MISP_RETIRED.RET_COST'/; +cpu/event=0x79,umask=0x20,cmask=0x01,period=2000003,name='IDQ.MS_CYCLES_ANY'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0xad,umask=0x01,cmask=0x01,period=500009,name='INT_MISC.CLEARS_COUNT'/, cpu/event=0xc3,umask=0x01,cmask=0x01,period=100003,name='MACHINE_CLEARS.COUNT'/, @@ -140,31 +137,39 @@ cpu/event=0xc3,umask=0x02,period=100003,name='MACHINE_CLEARS.MEMORY_ORDERING'/, cpu/event=0xd0,umask=0x09,period=100003,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, # 0,1,2,3 cpu/event=0x03,umask=0x82,period=100003,name='LD_BLOCKS.STORE_FORWARD'/, # 0,1,2,3 cpu/event=0xd0,umask=0x81,period=1000003,name='MEM_INST_RETIRED.ALL_LOADS'/, # 0,1,2,3 -cpu/event=0xd0,umask=0x41,period=100003,name='MEM_INST_RETIRED.SPLIT_LOADS'/; # 0,1,2,3 +cpu/event=0xd0,umask=0x41,period=100003,name='MEM_INST_RETIRED.SPLIT_LOADS'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x48,umask=0x01,period=1000003,name='L1D_PEND_MISS.PENDING'/, # 0,1,2,3 cpu/event=0x43,umask=0xfd,period=1000003,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, # 0,1,2,3 cpu/event=0x48,umask=0x02,period=1000003,name='L1D_PEND_MISS.FB_FULL'/, # 0,1,2,3 -cpu/event=0xd2,umask=0x01,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/; # 0,1,2,3 +cpu/event=0xd2,umask=0x01,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0xd1,umask=0x04,period=100021,name='MEM_LOAD_RETIRED.L3_HIT'/, # 0,1,2,3 -cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/; # 0,1,2,3 +cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x48,umask=0x04,period=1000003,name='L1D_PEND_MISS.L2_STALLS'/, # 0,1,2,3 cpu/event=0x44,umask=0x01,period=200003,name='MEM_STORE_RETIRED.L2_HIT'/, # 0,1,2,3 cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x103b800002,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3 -cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/; # 0,1,2,3 +cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x10800,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3 cpu/event=0xd0,umask=0x0a,period=100003,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, # 0,1,2,3 -cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/; # 0,1,2,3 - -cpu/event=0xb0,umask=0x09,cmask=0x01,period=1000003,name='ARITH.DIV_ACTIVE'/, -cpu/event=0xa2,umask=0x02,period=100003,name='RESOURCE_STALLS.SCOREBOARD'/, -cpu/event=0xec,umask=0x20,period=2000003,name='CPU_CLK_UNHALTED.C02'/, -cpu/event=0xa6,umask=0x80,period=1000003,name='EXE_ACTIVITY.EXE_BOUND_0_PORTS'/, -cpu/event=0xa6,umask=0xC,period=2000003,name='EXE_ACTIVITY.2_3_PORTS_UTIL'/, -cpu/event=0xa3,umask=0x04,cmask=0x04,period=1000003,name='CYCLE_ACTIVITY.STALLS_TOTAL'/; +cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; cpu/event=0xb1,umask=0x10,period=2000003,name='UOPS_EXECUTED.X87'/, cpu/event=0xb1,umask=0x01,period=2000003,name='UOPS_EXECUTED.THREAD'/, @@ -173,10 +178,17 @@ cpu/event=0xcf,umask=0x03,period=100003,name='FP_ARITH_INST_RETIRED2.SCALAR'/, cpu/event=0xc7,umask=0xfc,period=1000003,name='FP_ARITH_INST_RETIRED.VECTOR'/, cpu/event=0xcf,umask=0x1c,period=100003,name='FP_ARITH_INST_RETIRED2.VECTOR'/, cpu/event=0xe7,umask=0x03,period=1000003,name='INT_VEC_RETIRED.ADD_128'/, -cpu/event=0xe7,umask=0x10,period=1000003,name='INT_VEC_RETIRED.VNNI_128'/; +cpu/event=0xe7,umask=0x10,period=1000003,name='INT_VEC_RETIRED.VNNI_128'/, +cpu-cycles, +ref-cycles, +instructions; -cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/, -cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/; +cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, # 0,1,2,3 +cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, # 0,1,2,3 +cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, # 0,1,2,3 +cpu-cycles, +ref-cycles, +instructions; #UPI upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; # 0,1,2,3 From 7cd5155807aeb5ef9baef3773593603a873d8075 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Fri, 20 Jun 2025 06:43:52 -0700 Subject: [PATCH 18/20] comments Signed-off-by: Harper, Jason M --- .../resources/events/x86_64/GenuineIntel/gnr.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt index 4e0c4fbe..0bf2987a 100644 --- a/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt +++ b/cmd/metrics/resources/events/x86_64/GenuineIntel/gnr.txt @@ -1,5 +1,6 @@ # GraniteRapids event list +# cpu groups cpu/event=0x51,umask=0x01,period=100003,name='L1D.REPLACEMENT'/, # 0,1,2,3 cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, # 0,1,2,3 cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, # 0,1,2,3 @@ -190,10 +191,10 @@ cpu-cycles, ref-cycles, instructions; -#UPI +# upi groups upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; # 0,1,2,3 -#CHA (Cache) +# cha groups cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, # 0,1,2,3 cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, # 0,1,2,3 cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; # 0 @@ -208,22 +209,23 @@ cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, # 0,1,2,3 cha/event=0x36,umask=0xc817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; # 0 -#CHA (IO Bandwidth) cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, # 0,1,2,3 cha/event=0x35,umask=0xcc43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, # 0,1,2,3 cha/event=0x35,umask=0xcd43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, # 0,1,2,3 cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; # 0,1,2,3 -#IMC (memory read/writes) +# imc groups imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, # 0,1,2,3 imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, # 0,1,2,3 imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, # 0,1,2,3 imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; # 0,1,2,3 -#C6 +# cstate_core groups cstate_core/c6-residency/; + +# cstate_pkg groups cstate_pkg/c6-residency/; -#power +# power groups power/energy-pkg/, power/energy-ram/; From ea5dd49ed845113b359f929a811a57d28619468a Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Mon, 23 Jun 2025 09:55:19 -0700 Subject: [PATCH 19/20] remove commented temporary code Signed-off-by: Harper, Jason M --- scripts/perfmonmetrics2perfspect.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scripts/perfmonmetrics2perfspect.py b/scripts/perfmonmetrics2perfspect.py index 4ed80973..461d513c 100755 --- a/scripts/perfmonmetrics2perfspect.py +++ b/scripts/perfmonmetrics2perfspect.py @@ -64,14 +64,6 @@ def translate_perfmon_json_metrics_to_perfspect(inFile): vars = {} result = [] for m in mf["Metrics"]: - # if m.get("Category") != "TMA": - # continue - # if m.get("Category") == "TMA" and m.get("Level") > 4: - # continue - # if m.get("LegacyName") and m["LegacyName"].startswith("metric_TMA_Info_"): - # continue - # if m.get("LegacyName") and m["LegacyName"].startswith("metric_TMA_Bottleneck_"): - # continue vars.clear() metric = {} # strip metric_ prefix from the name From 415fa37251e52b95926c75791c8b8a04d0961307 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Mon, 23 Jun 2025 10:07:53 -0700 Subject: [PATCH 20/20] refactor: optimize regex usage for constant number replacement in metric expressions Signed-off-by: Harper, Jason M --- cmd/metrics/metric_defs.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/metrics/metric_defs.go b/cmd/metrics/metric_defs.go index a0e5a262..a07fd1bd 100644 --- a/cmd/metrics/metric_defs.go +++ b/cmd/metrics/metric_defs.go @@ -105,6 +105,7 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st return } // configure each metric + reConstantInt := regexp.MustCompile(`\[(\d+)\]`) for metricIdx := range loadedMetrics { tmpMetric := loadedMetrics[metricIdx] // abbreviate event names in metric expressions to match abbreviations used in uncollectableEvents @@ -149,13 +150,16 @@ func ConfigureMetrics(loadedMetrics []MetricDefinition, uncollectableEvents []st } // replace constant numbers masquerading as variables with their values, e.g., [20] -> 20 // there may be more than one with differing values in the expression, so use a regex to find them all - re := regexp.MustCompile(`\[(\d+)\]`) - found := re.FindAllStringSubmatchIndex(tmpMetric.Expression, -1) - for _, match := range found { + for { + // find the first match + found := reConstantInt.FindStringSubmatchIndex(tmpMetric.Expression) + if found == nil { + break // no more matches + } // match[2] is the start of the number, match[3] is the end of the number - number := tmpMetric.Expression[match[2]:match[3]] + number := tmpMetric.Expression[found[2]:found[3]] // replace the whole match with the number - tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, tmpMetric.Expression[match[0]:match[1]], number) + tmpMetric.Expression = strings.ReplaceAll(tmpMetric.Expression, tmpMetric.Expression[found[0]:found[1]], number) } // get a list of the variables in the expression tmpMetric.Variables = make(map[string]int)