From 188c1ab9f2b84aee7c76e6ffd2e2578f97d2ae28 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Mon, 25 Aug 2025 15:17:57 -0700 Subject: [PATCH 1/5] Metric names modernized to match perfmon. "Legacy" names optional and deprecated. All metric descriptions in HTML report. Signed-off-by: Harper, Jason M --- cmd/metrics/loader.go | 16 +-- cmd/metrics/loader_perfmon.go | 26 ++-- cmd/metrics/metrics.go | 13 +- cmd/metrics/print.go | 68 ++++++++--- cmd/metrics/resources/base.html | 126 +++---------------- cmd/metrics/resources/perfmon/emr/emr.json | 111 ----------------- cmd/metrics/resources/perfmon/gnr/gnr.json | 116 ------------------ cmd/metrics/resources/perfmon/icx/icx.json | 108 ----------------- cmd/metrics/resources/perfmon/spr/spr.json | 111 ----------------- cmd/metrics/resources/perfmon/srf/srf.json | 72 ----------- cmd/metrics/summary.go | 135 +++++++++++---------- 11 files changed, 178 insertions(+), 724 deletions(-) diff --git a/cmd/metrics/loader.go b/cmd/metrics/loader.go index 6c0124b..0e6d0d8 100644 --- a/cmd/metrics/loader.go +++ b/cmd/metrics/loader.go @@ -13,9 +13,12 @@ import ( // MetricDefinition is the common (across loader implementations) representation of a single metric type MetricDefinition struct { - Name string `json:"name"` - Expression string `json:"expression"` - Description string `json:"description"` + Name string + LegacyName string + Expression string + Description string + Category string + Level int // Evaluation fields - used during metric expression evaluation // // Variables - map of variable names found in Expression to the indices of the event @@ -30,10 +33,9 @@ type MetricDefinition struct { // EventDefinition is the common (across loader implementations) representation of a single perf event type EventDefinition struct { - Raw string // the event string in perf format - Name string // the event name - Device string // the event device (e.g., "cpu" from cpu/event=0x3c/,umask=...) - Description string // the event description + Raw string // the event string in perf format + Name string // the event name + Device string // the event device (e.g., "cpu" from cpu/event=0x3c/,umask=...), currently used by legacy loader only } // GroupDefinition represents a group of perf events diff --git a/cmd/metrics/loader_perfmon.go b/cmd/metrics/loader_perfmon.go index c177756..ac46bb4 100644 --- a/cmd/metrics/loader_perfmon.go +++ b/cmd/metrics/loader_perfmon.go @@ -54,7 +54,6 @@ type MetricsConfigHeader struct { } type PerfspectMetric struct { MetricName string `json:"MetricName"` - LegacyName string `json:"LegacyName"` Origin string `json:"Origin"` } type MetricsConfig struct { @@ -236,7 +235,7 @@ func filterReportMetrics(reportMetrics []PerfspectMetric, selectedMetricNames [] for _, metricName := range selectedMetricNames { found := false for _, metric := range reportMetrics { - if metric.LegacyName == "metric_"+metricName { + if metric.MetricName == metricName { filteredMetrics = append(filteredMetrics, metric) found = true break @@ -256,13 +255,13 @@ func loadPerfmonMetrics(reportMetrics []PerfspectMetric, perfmonMetrics []Perfmo var perfmonMetric *PerfmonMetric var found bool if !metadata.SupportsFixedTMA { - perfmonMetric, found = findPerfmonMetric(alternateTMAMetrics, metric.LegacyName) + perfmonMetric, found = findPerfmonMetric(alternateTMAMetrics, metric.MetricName) } if !found { - perfmonMetric, found = findPerfmonMetric(allPerfmonMetrics, metric.LegacyName) + perfmonMetric, found = findPerfmonMetric(allPerfmonMetrics, metric.MetricName) } if !found { - slog.Warn("Metric not found in metric definitions", "metric", metric.LegacyName, "origin", metric.Origin) + slog.Warn("Metric not found in metric definitions", "metric", metric.MetricName, "origin", metric.Origin) continue } // Add the metric to the list of metrics to return @@ -338,13 +337,16 @@ func perfmonToMetricDefs(perfmonMetrics []PerfmonMetric) ([]MetricDefinition, er // get the expression for the metric expression, err := getExpression(perfmonMetric) if err != nil { - slog.Warn("Failed getting expression for metric", "metric", perfmonMetric.LegacyName, "error", err) + slog.Warn("Failed getting expression for metric", "metric", perfmonMetric.MetricName, "error", err) continue } // create a MetricDefinition from the perfmon metric metric := MetricDefinition{ - Name: perfmonMetric.LegacyName, + Name: perfmonMetric.MetricName, + LegacyName: perfmonMetric.LegacyName, Description: perfmonMetric.BriefDescription, + Category: perfmonMetric.Category, + Level: perfmonMetric.Level, Expression: expression, } // add the metric to the list of metrics @@ -363,7 +365,7 @@ func removeUncollectableMetrics(perfmonMetrics []PerfmonMetric, coreEvents CoreE } uncollectableEvents := getUncollectableEvents(eventNames, coreEvents, uncoreEvents, otherEvents, metadata) if len(uncollectableEvents) > 0 { - slog.Warn("Metric contains uncollectable events", "metric", perfmonMetric.LegacyName, "uncollectableEvents", uncollectableEvents) + slog.Warn("Metric contains uncollectable events", "metric", perfmonMetric.MetricName, "uncollectableEvents", uncollectableEvents) continue } // if the metric is collectable, add it to the list of collectable metrics @@ -389,11 +391,11 @@ func loadEventGroupsFromMetrics(perfmonMetrics []PerfmonMetric, coreEvents CoreE uncollectableEvents = util.UniqueAppend(uncollectableEvents, uncollectableMetricEvents...) // skip metrics that have uncollectable events if len(uncollectableMetricEvents) > 0 { - slog.Warn("Metric contains uncollectable events", "metric", perfmonMetric.LegacyName, "uncollectableEvents", uncollectableMetricEvents) + slog.Warn("Metric contains uncollectable events", "metric", perfmonMetric.MetricName, "uncollectableEvents", uncollectableMetricEvents) continue } metricCoreGroups, metricUncoreGroups, metricOtherGroups, err := groupsFromEventNames( - perfmonMetric.LegacyName, + perfmonMetric.MetricName, metricEventNames, coreEvents, uncoreEvents, @@ -401,7 +403,7 @@ func loadEventGroupsFromMetrics(perfmonMetrics []PerfmonMetric, coreEvents CoreE metadata, ) if err != nil { - slog.Error("Error creating groups from event names", "metric", perfmonMetric.LegacyName, "error", err) + slog.Error("Error creating groups from event names", "metric", perfmonMetric.MetricName, "error", err) continue } // Add the groups to the main lists @@ -565,7 +567,7 @@ func groupsFromEventNames(metricName string, eventNames []string, coreEvents Cor // findPerfmonMetric -- Helper function to find a metric by name func findPerfmonMetric(metricsList []PerfmonMetric, metricName string) (*PerfmonMetric, bool) { for _, metric := range metricsList { - if metric.LegacyName == metricName { + if metric.MetricName == metricName { return &metric, true } } diff --git a/cmd/metrics/metrics.go b/cmd/metrics/metrics.go index eda1e81..038a471 100644 --- a/cmd/metrics/metrics.go +++ b/cmd/metrics/metrics.go @@ -145,6 +145,7 @@ var ( flagTransactionRate float64 // advanced options flagShowMetricNames bool + flagLegacyNames bool flagMetricsList []string flagEventFilePath string flagMetricFilePath string @@ -177,6 +178,7 @@ const ( flagTransactionRateName = "txnrate" flagShowMetricNamesName = "list" + flagLegacyNamesName = "legacy-names" flagMetricsListName = "metrics" flagEventFilePathName = "eventfile" flagMetricFilePathName = "metricfile" @@ -231,6 +233,7 @@ func init() { Cmd.Flags().Float64Var(&flagTransactionRate, flagTransactionRateName, 0, "") Cmd.Flags().BoolVar(&flagShowMetricNames, flagShowMetricNamesName, false, "") + Cmd.Flags().BoolVar(&flagLegacyNames, flagLegacyNamesName, false, "") Cmd.Flags().StringSliceVar(&flagMetricsList, flagMetricsListName, []string{}, "") Cmd.Flags().StringVar(&flagEventFilePath, flagEventFilePathName, "", "") Cmd.Flags().StringVar(&flagMetricFilePath, flagMetricFilePathName, "", "") @@ -353,6 +356,10 @@ func getFlagGroups() []common.FlagGroup { Name: flagShowMetricNamesName, Help: "show metric names available on this platform and exit", }, + { + Name: flagLegacyNamesName, + Help: "use legacy metric names where applicable (Deprecated, will be removed in a future release)", + }, { Name: flagMetricsListName, Help: "a comma separated list of quoted metric names to include in output", @@ -819,10 +826,10 @@ func processRawData(localOutputDir string) error { if err != nil { return err } - filesWritten = printMetrics(metricFrames, frameCount, metadata.Hostname, metadata.CollectionStartTime, localOutputDir) + filesWritten = printMetrics(metricFrames, frameCount, metricDefinitions, metadata.Hostname, metadata.CollectionStartTime, localOutputDir) frameCount += len(metricFrames) } - summaryFiles, err := summarizeMetrics(localOutputDir, metadata.Hostname, metadata) + summaryFiles, err := summarizeMetrics(localOutputDir, metadata.Hostname, metadata, metricDefinitions) if err != nil { return err } @@ -1103,7 +1110,7 @@ func runCmd(cmd *cobra.Command, args []string) error { _ = multiSpinner.Status(targetContext.target.GetName(), "no metrics collected") } else { targetContext.metadata.PerfSpectVersion = appContext.Version - summaryFiles, err := summarizeMetrics(localOutputDir, targetContext.target.GetName(), targetContext.metadata) + summaryFiles, err := summarizeMetrics(localOutputDir, targetContext.target.GetName(), targetContext.metadata, targetContext.metricDefinitions) if err != nil { err = fmt.Errorf("failed to summarize metrics: %w", err) exitErrs = append(exitErrs, err) diff --git a/cmd/metrics/print.go b/cmd/metrics/print.go index d89deae..497b355 100644 --- a/cmd/metrics/print.go +++ b/cmd/metrics/print.go @@ -16,9 +16,9 @@ import ( "time" ) -func printMetrics(metricFrames []MetricFrame, frameCount int, targetName string, collectionStartTime time.Time, outputDir string) (printedFiles []string) { +func printMetrics(metricFrames []MetricFrame, frameCount int, metricDefinitions []MetricDefinition, targetName string, collectionStartTime time.Time, outputDir string) (printedFiles []string) { printToFile := !flagLive && !flagPrometheusServer && slices.Contains(flagOutputFormat, formatTxt) - fileName, err := printMetricsTxt(metricFrames, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatTxt, printToFile, outputDir) + fileName, err := printMetricsTxt(metricFrames, metricDefinitions, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatTxt, printToFile, outputDir) if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) slog.Error(err.Error()) @@ -26,7 +26,7 @@ func printMetrics(metricFrames []MetricFrame, frameCount int, targetName string, printedFiles = util.UniqueAppend(printedFiles, fileName) } printToFile = !flagLive && !flagPrometheusServer && slices.Contains(flagOutputFormat, formatJSON) - fileName, err = printMetricsJSON(metricFrames, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatJSON, printToFile, outputDir) + fileName, err = printMetricsJSON(metricFrames, metricDefinitions, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatJSON, printToFile, outputDir) if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) slog.Error(err.Error()) @@ -35,7 +35,7 @@ func printMetrics(metricFrames []MetricFrame, frameCount int, targetName string, } // csv is always written to file unless no files are requested -- we need it to create the summary reports printToFile = !flagLive && !flagPrometheusServer - fileName, err = printMetricsCSV(metricFrames, frameCount, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatCSV, printToFile, outputDir) + fileName, err = printMetricsCSV(metricFrames, frameCount, metricDefinitions, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatCSV, printToFile, outputDir) if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) slog.Error(err.Error()) @@ -43,7 +43,7 @@ func printMetrics(metricFrames []MetricFrame, frameCount int, targetName string, printedFiles = util.UniqueAppend(printedFiles, fileName) } printToFile = !flagLive && !flagPrometheusServer && slices.Contains(flagOutputFormat, formatWide) - fileName, err = printMetricsWide(metricFrames, frameCount, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatWide, printToFile, outputDir) + fileName, err = printMetricsWide(metricFrames, frameCount, metricDefinitions, targetName, collectionStartTime, flagLive && flagOutputFormat[0] == formatWide, printToFile, outputDir) if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) slog.Error(err.Error()) @@ -80,7 +80,7 @@ func printMetricsAsync(targetContext *targetContext, outputDir string, frameChan frameCount := 1 // block until next set of metric frames arrives, will exit loop when frameChannel is closed for metricFrames := range frameChannel { - printedFiles := printMetrics(metricFrames, frameCount, targetContext.target.GetName(), targetContext.perfStartTime, outputDir) + printedFiles := printMetrics(metricFrames, frameCount, targetContext.metricDefinitions, targetContext.target.GetName(), targetContext.perfStartTime, outputDir) if flagPrometheusServer { updatePrometheusMetrics(metricFrames) } @@ -92,17 +92,53 @@ func printMetricsAsync(targetContext *targetContext, outputDir string, frameChan doneChannel <- allPrintedFiles } -func printMetricsJSON(metricFrames []MetricFrame, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { +func getMetricDisplayName(metric MetricDefinition) string { + var name string + switch flagLegacyNames { + case false: + if metric.Category == "TMA" { + name = "TMA_" + for range metric.Level - 1 { + name += ".." + } + name += metric.Name + } else { + name = metric.Name + } + case true: + name, _ = strings.CutPrefix(metric.LegacyName, "metric_") + } + return name +} + +func getMetricDefinitionByName(metricDefinitions []MetricDefinition, name string) (metric MetricDefinition, found bool) { + for _, def := range metricDefinitions { + if def.Name == name { + return def, true + } + } + return MetricDefinition{}, false +} + +func nameFromMetricDefinition(metricDefinitions []MetricDefinition, s string) string { + if def, found := getMetricDefinitionByName(metricDefinitions, s); found { + return getMetricDisplayName(def) + } + return s +} + +func printMetricsJSON(metricFrames []MetricFrame, metricDefinitions []MetricDefinition, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { if !printToStdout && !printToFile { return } - filename := outputDir + "/" + targetName + "_" + "metrics.json" + filename := outputDir + "/" + targetName + "_" + "metrics.jsonl" for _, metricFrame := range metricFrames { // can't Marshal NaN or Inf values in JSON, so no need to set them to a specific value filteredMetricFrame := metricFrame filteredMetricFrame.Metrics = make([]Metric, 0, len(metricFrame.Metrics)) filteredMetricFrame.Timestamp = float64(collectionStartTime.Unix() + int64(metricFrame.Timestamp)) for _, metric := range metricFrame.Metrics { + metric.Name = nameFromMetricDefinition(metricDefinitions, metric.Name) if math.IsNaN(metric.Value) || math.IsInf(metric.Value, 0) { filteredMetricFrame.Metrics = append(filteredMetricFrame.Metrics, Metric{Name: metric.Name, Value: -1}) } else { @@ -134,7 +170,7 @@ func printMetricsJSON(metricFrames []MetricFrame, targetName string, collectionS return } -func printMetricsCSV(metricFrames []MetricFrame, frameCount int, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { +func printMetricsCSV(metricFrames []MetricFrame, frameCount int, metricDefinitions []MetricDefinition, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { if !printToStdout && !printToFile { return } @@ -162,7 +198,8 @@ func printMetricsCSV(metricFrames []MetricFrame, frameCount int, targetName stri } names := make([]string, 0, len(metricFrame.Metrics)) for _, metric := range metricFrame.Metrics { - names = append(names, metric.Name) + name := nameFromMetricDefinition(metricDefinitions, metric.Name) + names = append(names, name) } metricNames := strings.Join(names, ",") if printToStdout { @@ -195,7 +232,7 @@ func printMetricsCSV(metricFrames []MetricFrame, frameCount int, targetName stri return } -func printMetricsWide(metricFrames []MetricFrame, frameCount int, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { +func printMetricsWide(metricFrames []MetricFrame, frameCount int, metricDefinitions []MetricDefinition, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { if !printToStdout && !printToFile { return } @@ -213,6 +250,7 @@ func printMetricsWide(metricFrames []MetricFrame, frameCount int, targetName str var names []string var values []float64 for _, metric := range metricFrame.Metrics { + metric.Name = nameFromMetricDefinition(metricDefinitions, metric.Name) names = append(names, metric.Name) values = append(values, metric.Value) } @@ -294,7 +332,7 @@ func printMetricsWide(metricFrames []MetricFrame, frameCount int, targetName str return } -func printMetricsTxt(metricFrames []MetricFrame, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { +func printMetricsTxt(metricFrames []MetricFrame, metricDefinitions []MetricDefinition, targetName string, collectionStartTime time.Time, printToStdout bool, printToFile bool, outputDir string) (outputFilename string, err error) { if !printToStdout && !printToFile { return } @@ -314,7 +352,8 @@ func printMetricsTxt(metricFrames []MetricFrame, targetName string, collectionSt } outputLines = append(outputLines, line) for i := range metricFrames[0].Metrics { - line = fmt.Sprintf("%-70s ", metricFrames[0].Metrics[i].Name) + name := nameFromMetricDefinition(metricDefinitions, metricFrames[0].Metrics[i].Name) + line = fmt.Sprintf("%-70s ", name) for _, metricFrame := range metricFrames { line += fmt.Sprintf("%15s", strconv.FormatFloat(metricFrame.Metrics[i].Value, 'g', 4, 64)) } @@ -339,7 +378,8 @@ func printMetricsTxt(metricFrames []MetricFrame, targetName string, collectionSt outputLines = append(outputLines, fmt.Sprintf("%-70s %15s", "metric", "value")) outputLines = append(outputLines, fmt.Sprintf("%-70s %15s", "------------------------", "----------")) for _, metric := range metricFrame.Metrics { - outputLines = append(outputLines, fmt.Sprintf("%-70s %15s", metric.Name, strconv.FormatFloat(metric.Value, 'g', 4, 64))) + name := nameFromMetricDefinition(metricDefinitions, metric.Name) + outputLines = append(outputLines, fmt.Sprintf("%-70s %15s", name, strconv.FormatFloat(metric.Value, 'g', 4, 64))) } } } diff --git a/cmd/metrics/resources/base.html b/cmd/metrics/resources/base.html index 2dcb864..d8fbad9 100644 --- a/cmd/metrics/resources/base.html +++ b/cmd/metrics/resources/base.html @@ -165,101 +165,9 @@ const all_metrics = <<.ALLMETRICS>> const [current_metrics, setCurrent_metrics] = React.useState(JSON.parse(JSON.stringify(all_metrics))); - const description = { - "CPU operating frequency (in GHz)": "CPU operating frequency (in GHz)", - "CPU utilization %": "Percentage of time spent in the active CPU power state C0", - "CPI": "Cycles per instruction retired; indicating how much time each executed instruction took; in units of cycles.", - "L1D MPI (includes data+rfo w/ prefetches)": "Ratio of number of requests missing L1 data cache (includes data+rfo w/ prefetches) to the total number of completed instructions", - "L1D demand data read hits per instr": "Ratio of number of demand load requests hitting in L1 data cache to the total number of completed instructions ", - "L1-I code read misses (w/ prefetches) per instr": "Ratio of number of code read requests missing in L1 instruction cache (includes prefetches) to the total number of completed instructions", - "L2 demand data read hits per instr": "Ratio of number of completed demand load requests hitting in L2 cache to the total number of completed instructions ", - "L2 MPI (includes code+data+rfo w/ prefetches)": "Ratio of number of requests missing L2 cache (includes code+data+rfo w/ prefetches) to the total number of completed instructions", - "L2 demand data read MPI": "Ratio of number of completed data read request missing L2 cache to the total number of completed instructions", - "L2 demand code MPI": "Ratio of number of code read request missing L2 cache to the total number of completed instructions", - "LLC code read MPI (demand+prefetch)": "Ratio of number of code read requests missing last level core cache (includes demand w/ prefetches) to the total number of completed instructions", - "LLC data read MPI (demand+prefetch)": "Ratio of number of data read requests missing last level core cache (includes demand w/ prefetches) to the total number of completed instructions", - "cycles per txn": "Cycles per transaction retired; indicating how much time each executed transaction took; in units of cycles.", - "L1D misses per txn (includes data+rfo w/ prefetches)": "Ratio of number of requests missing L1 data cache (includes data+rfo w/ prefetches) to the total number of completed transactions", - "L1D demand data read hits per txn": "Ratio of number of demand load requests hitting in L1 data cache to the total number of completed transactions", - "L1-I code read misses (w/ prefetches) per txn": "Ratio of number of code read requests missing in L1 instruction cache (includes prefetches) to the total number of completed transactions", - "L2 demand data read hits per txn": "Ratio of number of completed demand load requests hitting in L2 cache to the total number of completed transactions", - "L2 misses per txn (includes code+data+rfo w/ prefetches)": "Ratio of number of requests missing L2 cache (includes code+data+rfo w/ prefetches) to the total number of completed transactions", - "L2 demand data read misses per txn": "Ratio of number of completed data read request missing L2 cache to the total number of completed transactions", - "L2 demand code misses per txn": "Ratio of number of code read request missing L2 cache to the total number of completed transactions", - "LLC code read misses per txn (demand+prefetch)": "Ratio of number of code read requests missing last level core cache (includes demand w/ prefetches) to the total number of completed transactions", - "LLC data read misses per txn (demand+prefetch)": "Ratio of number of data read requests missing last level core cache (includes demand w/ prefetches) to the total number of completed transactions", - "NUMA %_Reads addressed to local DRAM": "Memory read that miss the last level cache (LLC) addressed to local DRAM as a percentage of total memory read accesses, does not include LLC prefetches.", - "NUMA %_Reads addressed to remote DRAM": "Memory reads that miss the last level cache (LLC) addressed to remote DRAM as a percentage of total memory read accesses, does not include LLC prefetches.", - "uncore frequency GHz": "Uncore operating frequency in GHz", - "% Uops delivered from decoded Icache (DSB)": "Uops delivered from decoded instruction cache (decoded stream buffer or DSB) as a percent of total uops delivered to Instruction Decode Queue", - "% Uops delivered from legacy decode pipeline (MITE)": "Uops delivered from legacy decode pipeline (Micro-instruction Translation Engine or MITE) as a percent of total uops delivered to Instruction Decode Queue", - "memory bandwidth read (MB/sec)": "DDR memory read bandwidth (MB/sec)", - "memory bandwidth write (MB/sec)": "DDR memory write bandwidth (MB/sec)", - "memory bandwidth total (MB/sec)": "DDR memory bandwidth (MB/sec)", - "TMA_Frontend_Bound(%)": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.", - "TMA_....ICache_Misses(%)": "This metric represents fraction of cycles the CPU was stalled due to instruction cache misses.", - "TMA_....ITLB_Misses(%)": "This metric represents fraction of cycles the CPU was stalled due to Instruction TLB (ITLB) misses.", - "TMA_....Branch_Resteers(%)": "This metric represents fraction of cycles the CPU was stalled due to Branch Resteers. Branch Resteers estimates the Frontend delay in fetching operations from corrected path; following all sorts of miss-predicted branches. For example; branchy code with lots of miss-predictions might get categorized under Branch Resteers. Note the value of this node may overlap with its siblings.", - "TMA_......Mispredicts_Resteers(%)": "This metric represents fraction of cycles the CPU was stalled due to Branch Resteers as a result of Branch Misprediction at execution stage. ", - "TMA_......Clears_Resteers(%)": "This metric represents fraction of cycles the CPU was stalled due to Branch Resteers as a result of Machine Clears. ", - "TMA_....MITE(%)": "This metric represents Core fraction of cycles in which CPU was likely limited due to the MITE pipeline (the legacy decode pipeline). This pipeline is used for code that was not pre-cached in the DSB or LSD. For example; inefficiencies due to asymmetric decoders; use of long immediate or LCP can manifest as MITE fetch bandwidth bottleneck.", - "TMA_....DSB(%)": "This metric represents Core fraction of cycles in which CPU was likely limited due to DSB (decoded uop cache) fetch pipeline. For example; inefficient utilization of the DSB cache structure or bank conflict when reading from it; are categorized here.", - "TMA_Bad_Speculation(%)": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.", - "TMA_..Branch_Mispredicts(%)": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path.", - "TMA_..Machine_Clears(%)": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes.", - "TMA_Backend_Bound(%)": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.", - "TMA_..Memory_Bound(%)": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).", - "TMA_....L1_Bound(%)": "This metric estimates how often the CPU was stalled without loads missing the L1 data cache. The L1 data cache typically has the shortest latency. However; in certain cases like loads blocked on older stores; a load might suffer due to high latency even though it is being satisfied by the L1. Another example is loads who miss in the TLB. These cases are characterized by execution unit stalls; while some non-completed demand load lives in the machine without having that demand load missing the L1 cache.", - "TMA_......DTLB_Load(%)": "This metric roughly estimates the fraction of cycles where the Data TLB (DTLB) was missed by load accesses. TLBs (Translation Look-aside Buffers) are processor caches for recently used entries out of the Page Tables that are used to map virtual- to physical-addresses by the operating system. This metric approximates the potential delay of demand loads missing the first-level data TLB (assuming worst case scenario with back to back misses to different pages). This includes hitting in the second-level TLB (STLB) as well as performing a hardware page walk on an STLB miss.", - "TMA_....L2_Bound(%)": "This metric estimates how often the CPU was stalled due to L2 cache accesses by loads. Avoiding cache misses (i.e. L1 misses/L2 hits) can improve the latency and increase performance.", - "TMA_....L3_Bound(%)": "This metric estimates how often the CPU was stalled due to loads accesses to L3 cache or contended with a sibling Core. Avoiding cache misses (i.e. L2 misses/L3 hits) can improve the latency and increase performance.", - "TMA_......Data_Sharing(%)": "This metric estimates fraction of cycles while the memory subsystem was handling synchronizations due to data-sharing accesses. Data shared by multiple Logical Processors (even just read shared) may cause increased access latency due to cache coherency. Excessive data sharing can drastically harm multithreaded performance.", - "TMA_......MEM_Bandwidth(%)": "This metric estimates fraction of cycles where the core's performance was likely hurt due to approaching bandwidth limits of external memory (DRAM). The underlying heuristic assumes that a similar off-core traffic is generated by all IA cores. This metric does not aggregate non-data-read requests by this logical processor; requests from other IA Logical Processors/Physical Cores/sockets; or other non-IA devices like GPU; hence the maximum external memory bandwidth limits may or may not be approached when this metric is flagged (see Uncore counters for that).", - "TMA_......MEM_Latency(%)": "This metric estimates fraction of cycles where the performance was likely hurt due to latency from external memory (DRAM). This metric does not aggregate requests from other Logical Processors/Physical Cores/sockets (see Uncore counters for that).", - "TMA_....Store_Bound(%)": "This metric estimates how often CPU was stalled due to RFO store memory accesses; RFO store issue a read-for-ownership request before the write. Even though store accesses do not typically stall out-of-order CPUs; there are few cases where stores can lead to actual stalls. This metric will be flagged should RFO stores be a bottleneck.", - "TMA_..Core_Bound(%)": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).", - "TMA_....Ports_Utilization(%)": "This metric estimates fraction of cycles the CPU performance was potentially limited due to Core computation issues (non divider-related). Two distinct categories can be attributed into this metric: (1) heavy data-dependency among contiguous instructions would manifest in this metric - such cases are often referred to as low Instruction Level Parallelism (ILP). (2) Contention on some hardware execution unit other than Divider. For example; when there are too many multiply operations.", - "TMA_Retiring(%)": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. ", - "TMA_..Light_Operations(%)": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved.", - "TMA_....FP_Arith(%)": "This metric represents overall arithmetic floating-point (FP) operations fraction the CPU has executed (retired). Note this metric's value may exceed its parent due to use of \"Uops\" CountDomain and FMA double-counting.", - "TMA_..Heavy_Operations(%)": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.", - "IO_bandwidth_disk_or_network_writes (MB/sec)": "Bandwidth of IO reads that are initiated by end device controllers that are requesting memory from the CPU.", - "IO_bandwidth_disk_or_network_reads (MB/sec)": "Bandwidth of IO writes that are initiated by end device controllers that are writing memory to the CPU.", - "TMA_..Fetch_Latency(%)": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period.", - "TMA_......Unknown_Branches(%)": "This metric represents fraction of cycles the CPU was stalled due to new branch address clears. These are fetched branches the Branch Prediction Unit was unable to recognize (e.g. first time the branch is fetched or hitting BTB capacity limit).", - "TMA_..Fetch_Bandwidth(%)": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend.", - "TMA_......FP_Scalar(%)": "This metric approximates arithmetic floating-point (FP) scalar uops fraction the CPU has retired. May overcount due to FMA double counting.", - "TMA_......FP_Vector(%)": "This metric approximates arithmetic floating-point (FP) vector uops fraction the CPU has retired aggregated across all vector widths. May overcount due to FMA double counting.", - "UPI Data transmit BW (MB/sec) (only data)": "Intel(R) Ultra Path Interconnect (UPI) data transmit bandwidth (MB/sec)", - "TMA_......Lock_Latency(%)": "This metric represents fraction of cycles the CPU spent handling cache misses due to lock operations. Due to the microarchitecture handling of locks; they are classified as L1_Bound regardless of what memory source satisfied them.", - "TMA_......False_Sharing(%)": "This metric roughly estimates how often CPU was handling synchronizations due to False Sharing. False Sharing is a multithreading hiccup; where multiple Logical Processors contend on different data-elements mapped into the same cache line. ", - "Average LLC data read miss latency (in ns)": "Average latency of a last level cache (LLC) demand and prefetch data read miss (read memory access) in nano seconds", - "Average LLC data read miss latency for LOCAL requests (in ns)": "Average latency of a last level cache (LLC) demand and prefetch data read miss (read memory access) addressed to local memory in nano seconds", - "Average LLC data read miss latency for REMOTE requests (in ns)": "Average latency of a last level cache (LLC) demand and prefetch data read miss (read memory access) addressed to remote memory in nano seconds", - "ITLB MPI": "Ratio of number of completed page walks (for all page sizes) caused by a code fetch to the total number of completed instructions. This implies it missed in the ITLB (Instruction TLB) and further levels of TLB.", - "ITLB large page MPI": "Ratio of number of completed page walks (for 2 megabyte and 4 megabyte page sizes) caused by a code fetch to the total number of completed instructions. This implies it missed in the Instruction Translation Lookaside Buffer (ITLB) and further levels of TLB.", - "DTLB load MPI": "Ratio of number of completed page walks (for all page sizes) caused by demand data loads to the total number of completed instructions. This implies it missed in the DTLB and further levels of TLB.", - "DTLB 2MB large page load MPI": "Ratio of number of completed page walks (for 2 megabyte page sizes) caused by demand data loads to the total number of completed instructions. This implies it missed in the Data Translation Lookaside Buffer (DTLB) and further levels of TLB.", - "DTLB store MPI": "Ratio of number of completed page walks (for all page sizes) caused by demand data stores to the total number of completed instructions. This implies it missed in the DTLB and further levels of TLB.", - "Average LLC demand data read miss latency (in ns)": "Average latency of a last level cache (LLC) demand data read miss (read memory access) in nano seconds", - "Average LLC demand data read miss latency for LOCAL requests (in ns)": "Average latency of a last level cache (LLC) demand data read miss (read memory access) addressed to local memory in nano seconds", - "Average LLC demand data read miss latency for REMOTE requests (in ns)": "Average latency of a last level cache (LLC) demand data read miss (read memory access) addressed to remote memory in nano seconds", - "ITLB (2nd level) MPI": "Ratio of number of completed page walks (for all page sizes) caused by a code fetch to the total number of completed instructions. This implies it missed in the ITLB (Instruction TLB) and further levels of TLB.", - "DTLB (2nd level) load MPI": "Ratio of number of completed page walks (for all page sizes) caused by demand data loads to the total number of completed instructions. This implies it missed in the DTLB and further levels of TLB.", - "DTLB (2nd level) 2MB large page load MPI": "Ratio of number of completed page walks (for 2 megabyte page sizes) caused by demand data loads to the total number of completed instructions. This implies it missed in the Data Translation Lookaside Buffer (DTLB) and further levels of TLB.", - "DTLB (2nd level) store MPI": "Ratio of number of completed page walks (for all page sizes) caused by demand data stores to the total number of completed instructions. This implies it missed in the DTLB and further levels of TLB.", - "TMA_....DRAM_Bound(%)": "This metric estimates how often the CPU was stalled on accesses to external memory (DRAM) by loads. Better caching can improve the latency and increase performance.", - "TMA_......Ports_Utilized_0(%)": "This metric represents fraction of cycles CPU executed no uops on any execution port (Logical Processor cycles since ICL, Physical Core cycles otherwise). Long-latency instructions like divides may contribute to this metric.", - "TMA_......Ports_Utilized_1(%)": "This metric represents fraction of cycles where the CPU executed total of 1 uop per cycle on all execution ports (Logical Processor cycles since ICL, Physical Core cycles otherwise). This can be due to heavy data-dependency among software instructions; or over oversubscribing a particular hardware resource. In some other cases with high 1_Port_Utilized and L1_Bound; this metric can point to L1 data-cache latency bottleneck that may not necessarily manifest with complete execution starvation (due to the short L1 latency e.g. walking a linked list) - looking at the assembly can be helpful.", - "TMA_......Ports_Utilized_2(%)": "This metric represents fraction of cycles CPU executed total of 2 uops per cycle on all execution ports (Logical Processor cycles since ICL, Physical Core cycles otherwise). Loop Vectorization -most compilers feature auto-Vectorization options today- reduces pressure on the execution ports as multiple elements are calculated with same uop.", - "TMA_......Ports_Utilized_3m(%)": "This metric represents fraction of cycles CPU executed total of 3 or more uops per cycle on all execution ports (Logical Processor cycles since ICL, Physical Core cycles otherwise).", - "TMA_....Microcode_Sequencer(%)": "This metric represents fraction of slots the CPU was retiring uops fetched by the Microcode Sequencer (MS) unit. The MS is used for CISC instructions not supported by the default decoders (like repeat move strings; or CPUID); or by microcode assists used to address some operation modes (like in Floating Point assists). These cases can often be avoided.", - "TMA_Info_System_SMT_2T_Utilization": "Fraction of cycles where both hardware Logical Processors were active", - } - + const description = <<.DESCRIPTION>> const metadata = <<.METADATA>> const system_info = <<.SYSTEMINFO>> - const transactions = <<.TRANSACTIONS>> const base_line = { xAxis: { type: "category", @@ -522,57 +430,57 @@ }, data: [ { - name: "<<.TMA_FRONTEND>>", + name: "<<.FRONTEND_LABEL>>", value: Math.round(<<.FRONTEND>> * 10) / 10, children:[ { - name: "<<.TMA_FETCHBANDWIDTH>>", + name: "<<.FETCHBANDWIDTH_LABEL>>", value: Math.round(<<.FETCHBANDWIDTH>> * 10) / 10, }, { - name: "<<.TMA_FETCHLATENCY>>", + name: "<<.FETCHLATENCY_LABEL>>", value: Math.round(<<.FETCHLATENCY>> * 10) / 10, }, ] }, { - name: "<<.TMA_BADSPECULATION>>", + name: "<<.BADSPECULATION_LABEL>>", value: Math.round(<<.BADSPECULATION>> * 10) / 10, children: [ { - name: "<<.TMA_BRANCHMISPREDICTS>>", + name: "<<.BRANCHMISPREDICTS_LABEL>>", value: Math.round(<<.BRANCHMISPREDICTS>> * 10) / 10, }, { - name: "<<.TMA_MACHINECLEARS>>", + name: "<<.MACHINECLEARS_LABEL>>", value: Math.round(<<.MACHINECLEARS>> * 10) / 10, }, ] }, { - name: "<<.TMA_BACKEND>>", + name: "<<.BACKEND_LABEL>>", value: Math.round(<<.BACKEND>> * 10) / 10, children: [ { - name: "<<.TMA_CORE>>", + name: "<<.CORE_LABEL>>", value: Math.round(<<.COREDATA>> * 10) / 10, }, { - name: "<<.TMA_MEMORY>>", + name: "<<.MEMORY_LABEL>>", value: Math.round(<<.MEMORY>> * 10) / 10, }, ], }, { - name: "<<.TMA_RETIRING>>", + name: "<<.RETIRING_LABEL>>", value: Math.round(<<.RETIRING>> * 10) / 10, children: [ { - name: "<<.TMA_LIGHTOPS>>", + name: "<<.LIGHTOPS_LABEL>>", value: Math.round(<<.LIGHTOPS>> * 10) / 10, }, { - name: "<<.TMA_HEAVYOPS>>", + name: "<<.HEAVYOPS_LABEL>>", value: Math.round(<<.HEAVYOPS>> * 10) / 10, }, ] @@ -620,10 +528,10 @@ - {transactions ? "Cycles per transaction" : "CPI"} + CPI - {transactions ? "Cycles per transaction retired; indicating how much time each executed transaction took; in units of cycles. Often this metric shows how efficiently applications are using the underlying hardware. A lower \"Cycles per TXN\" could indicate that transactions are not hitting bottlenecks and retiring quickly." : "Cycles per instruction retired; indicating how much time each executed instruction took; in units of cycles. Often this metric shows how efficiently applications are using the underlying hardware. A lower CPI could indicate that instructions are not hitting bottlenecks and retiring quickly."} + Cycles per instruction retired; indicating how much time each executed instruction took; in units of cycles. Often this metric shows how efficiently applications are using the underlying hardware. A lower CPI could indicate that instructions are not hitting bottlenecks and retiring quickly. @@ -677,10 +585,10 @@ - {transactions ? "Cache misses per transaction" : "Cache MPI (misses per instruction)"} + Cache MPI (misses per instruction) - {transactions ? "The ratio of the number of requests missing cache to the total number of completed transactions, at each level of cache (L1, L2 and LLC)" : "The ratio of the number of requests missing cache to the total number of completed instructions, at each level of cache (L1, L2 and LLC)"} + The ratio of the number of requests missing cache to the total number of completed instructions, at each level of cache (L1, L2 and LLC) diff --git a/cmd/metrics/resources/perfmon/emr/emr.json b/cmd/metrics/resources/perfmon/emr/emr.json index 4cdb21b..a1749de 100644 --- a/cmd/metrics/resources/perfmon/emr/emr.json +++ b/cmd/metrics/resources/perfmon/emr/emr.json @@ -12,557 +12,446 @@ "ReportMetrics": [ { "MetricName": "cpu_operating_frequency", - "LegacyName": "metric_CPU operating frequency (in GHz)", "Origin": "perfmon" }, { "MetricName": "cpu_utilization", - "LegacyName": "metric_CPU utilization %", "Origin": "perfmon" }, { "MetricName": "cpu_util_kernel", - "LegacyName": "metric_CPU utilization % in kernel mode", "Origin": "perfspect" }, { "MetricName": "cpi", - "LegacyName": "metric_CPI", "Origin": "perfmon" }, { "MetricName": "cycles_per_txn", - "LegacyName": "metric_cycles per txn", "Origin": "perfspect" }, { "MetricName": "kernel_cpi", - "LegacyName": "metric_kernel_CPI", "Origin": "perfspect" }, { "MetricName": "kernel_cycles_per_txn", - "LegacyName": "metric_kernel_cycles per txn", "Origin": "perfspect" }, { "MetricName": "ipc", - "LegacyName": "metric_IPC", "Origin": "perfspect" }, { "MetricName": "giga_instructions_per_sec", - "LegacyName": "metric_giga_instructions_per_sec", "Origin": "perfspect" }, { "MetricName": "branch_misprediction_ratio", - "LegacyName": "metric_branch misprediction ratio", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_instr", - "LegacyName": "metric_locks retired per instr", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_txn", - "LegacyName": "metric_locks retired per txn", "Origin": "perfspect" }, { "MetricName": "l1d_mpi", - "LegacyName": "metric_L1D MPI (includes data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l1d_misses_per_txn", - "LegacyName": "metric_L1D misses per txn (includes data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l1d_demand_data_read_hits_per_instr", - "LegacyName": "metric_L1D demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l1d_demand_data_read_hits_per_txn", - "LegacyName": "metric_L1D demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l1_i_code_read_misses_with_prefetches_per_instr", - "LegacyName": "metric_L1-I code read misses (w/ prefetches) per instr", "Origin": "perfmon" }, { "MetricName": "l1i_code_read_misses_per_txn", - "LegacyName": "metric_L1I code read misses (includes prefetches) per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_hits_per_instr", - "LegacyName": "metric_L2 demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_hits_per_txn", - "LegacyName": "metric_L2 demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l2_mpi", - "LegacyName": "metric_L2 MPI (includes code+data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l2_misses_per_txn", - "LegacyName": "metric_L2 misses per txn (includes code+data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_mpi", - "LegacyName": "metric_L2 demand data read MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_misses_per_txn", - "LegacyName": "metric_L2 demand data read misses per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_code_mpi", - "LegacyName": "metric_L2 demand code MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_code_misses_per_txn", - "LegacyName": "metric_L2 demand code misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_code_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC code read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_code_read_misses_per_txn", - "LegacyName": "metric_LLC code read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_data_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC data read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_data_read_misses_per_txn", - "LegacyName": "metric_LLC data read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_demand_data_read_miss_latency", - "LegacyName": "metric_Average LLC demand data read miss latency (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_local_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for LOCAL requests (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_remote_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for REMOTE requests (in ns)", "Origin": "perfmon" }, { "MetricName": "upi_data_transmit_bw", - "LegacyName": "metric_UPI Data transmit BW (MB/sec) (only data)", "Origin": "perfmon" }, { "MetricName": "package_power", - "LegacyName": "metric_package power (watts)", "Origin": "perfspect" }, { "MetricName": "dram_power", - "LegacyName": "metric_DRAM power (watts)", "Origin": "perfspect" }, { "MetricName": "core_c6_residency", - "LegacyName": "metric_core c6 residency %", "Origin": "perfspect" }, { "MetricName": "package_c6_residency", - "LegacyName": "metric_package c6 residency %", "Origin": "perfspect" }, { "MetricName": "percent_uops_delivered_from_decoded_icache", - "LegacyName": "metric_% Uops delivered from decoded Icache (DSB)", "Origin": "perfmon" }, { "MetricName": "percent_uops_delivered_from_legacy_decode_pipeline", - "LegacyName": "metric_% Uops delivered from legacy decode pipeline (MITE)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_read", - "LegacyName": "metric_memory bandwidth read (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_write", - "LegacyName": "metric_memory bandwidth write (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_total", - "LegacyName": "metric_memory bandwidth total (MB/sec)", "Origin": "perfmon" }, { "MetricName": "itlb_2nd_level_mpi", - "LegacyName": "metric_ITLB (2nd level) MPI", "Origin": "perfmon" }, { "MetricName": "itlb_misses_per_txn", - "LegacyName": "metric_ITLB (2nd level) misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_load_mpi", - "LegacyName": "metric_DTLB (2nd level) load MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_load_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) load misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_store_mpi", - "LegacyName": "metric_DTLB (2nd level) store MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_store_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) store misses per txn", "Origin": "perfspect" }, { "MetricName": "numa_reads_addressed_to_local_dram", - "LegacyName": "metric_NUMA %_Reads addressed to local DRAM", "Origin": "perfmon" }, { "MetricName": "numa_reads_addressed_to_remote_dram", - "LegacyName": "metric_NUMA %_Reads addressed to remote DRAM", "Origin": "perfmon" }, { "MetricName": "uncore_frequency", - "LegacyName": "metric_uncore frequency GHz", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_write", - "LegacyName": "metric_IO_bandwidth_disk_or_network_writes (MB/sec)", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_read", - "LegacyName": "metric_IO_bandwidth_disk_or_network_reads (MB/sec)", "Origin": "perfmon" }, { "MetricName": "Frontend_Bound", - "LegacyName": "metric_TMA_Frontend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Latency", - "LegacyName": "metric_TMA_..Fetch_Latency(%)", "Origin": "perfmon" }, { "MetricName": "ICache_Misses", - "LegacyName": "metric_TMA_....ICache_Misses(%)", "Origin": "perfmon" }, { "MetricName": "ITLB_Misses", - "LegacyName": "metric_TMA_....ITLB_Misses(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Resteers", - "LegacyName": "metric_TMA_....Branch_Resteers(%)", "Origin": "perfmon" }, { "MetricName": "MS_Switches", - "LegacyName": "metric_TMA_....MS_Switches(%)", "Origin": "perfmon" }, { "MetricName": "LCP", - "LegacyName": "metric_TMA_....LCP(%)", "Origin": "perfmon" }, { "MetricName": "DSB_Switches", - "LegacyName": "metric_TMA_....DSB_Switches(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Bandwidth", - "LegacyName": "metric_TMA_..Fetch_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MITE", - "LegacyName": "metric_TMA_....MITE(%)", "Origin": "perfmon" }, { "MetricName": "DSB", - "LegacyName": "metric_TMA_....DSB(%)", "Origin": "perfmon" }, { "MetricName": "MS", - "LegacyName": "metric_TMA_....MS(%)", "Origin": "perfmon" }, { "MetricName": "Bad_Speculation", - "LegacyName": "metric_TMA_Bad_Speculation(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Mispredicts", - "LegacyName": "metric_TMA_..Branch_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Other_Mispredicts", - "LegacyName": "metric_TMA_....Other_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Machine_Clears", - "LegacyName": "metric_TMA_..Machine_Clears(%)", "Origin": "perfmon" }, { "MetricName": "Other_Nukes", - "LegacyName": "metric_TMA_....Other_Nukes(%)", "Origin": "perfmon" }, { "MetricName": "Backend_Bound", - "LegacyName": "metric_TMA_Backend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Bound", - "LegacyName": "metric_TMA_..Memory_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L1_Bound", - "LegacyName": "metric_TMA_....L1_Bound(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Load", - "LegacyName": "metric_TMA_......DTLB_Load(%)", "Origin": "perfmon" }, { "MetricName": "Store_Fwd_Blk", - "LegacyName": "metric_TMA_......Store_Fwd_Blk(%)", "Origin": "perfmon" }, { "MetricName": "L1_Latency_Dependency", - "LegacyName": "metric_TMA_......L1_Latency_Dependency(%)", "Origin": "perfmon" }, { "MetricName": "Lock_Latency", - "LegacyName": "metric_TMA_......Lock_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Split_Loads", - "LegacyName": "metric_TMA_......Split_Loads(%)", "Origin": "perfmon" }, { "MetricName": "FB_Full", - "LegacyName": "metric_TMA_......FB_Full(%)", "Origin": "perfmon" }, { "MetricName": "L2_Bound", - "LegacyName": "metric_TMA_....L2_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L3_Bound", - "LegacyName": "metric_TMA_....L3_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Contested_Accesses", - "LegacyName": "metric_TMA_......Contested_Accesses(%)", "Origin": "perfmon" }, { "MetricName": "Data_Sharing", - "LegacyName": "metric_TMA_......Data_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "L3_Hit_Latency", - "LegacyName": "metric_TMA_......L3_Hit_Latency(%)", "Origin": "perfmon" }, { "MetricName": "SQ_Full", - "LegacyName": "metric_TMA_......SQ_Full(%)", "Origin": "perfmon" }, { "MetricName": "DRAM_Bound", - "LegacyName": "metric_TMA_....DRAM_Bound(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Bandwidth", - "LegacyName": "metric_TMA_......MEM_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Latency", - "LegacyName": "metric_TMA_......MEM_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Store_Bound", - "LegacyName": "metric_TMA_....Store_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Store_Latency", - "LegacyName": "metric_TMA_......Store_Latency(%)", "Origin": "perfmon" }, { "MetricName": "False_Sharing", - "LegacyName": "metric_TMA_......False_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "Split_Stores", - "LegacyName": "metric_TMA_......Split_Stores(%)", "Origin": "perfmon" }, { "MetricName": "Streaming_Stores", - "LegacyName": "metric_TMA_......Streaming_Stores(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Store", - "LegacyName": "metric_TMA_......DTLB_Store(%)", "Origin": "perfmon" }, { "MetricName": "Core_Bound", - "LegacyName": "metric_TMA_..Core_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Divider", - "LegacyName": "metric_TMA_....Divider(%)", "Origin": "perfmon" }, { "MetricName": "Serializing_Operation", - "LegacyName": "metric_TMA_....Serializing_Operation(%)", "Origin": "perfmon" }, { "MetricName": "AMX_Busy", - "LegacyName": "metric_TMA_....AMX_Busy(%)", "Origin": "perfmon" }, { "MetricName": "Ports_Utilization", - "LegacyName": "metric_TMA_....Ports_Utilization(%)", "Origin": "perfmon" }, { "MetricName": "Retiring", - "LegacyName": "metric_TMA_Retiring(%)", "Origin": "perfmon" }, { "MetricName": "Light_Operations", - "LegacyName": "metric_TMA_..Light_Operations(%)", "Origin": "perfmon" }, { "MetricName": "FP_Arith", - "LegacyName": "metric_TMA_....FP_Arith(%)", "Origin": "perfmon" }, { "MetricName": "Int_Operations", - "LegacyName": "metric_TMA_....Int_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Operations", - "LegacyName": "metric_TMA_....Memory_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Fused_Instructions", - "LegacyName": "metric_TMA_....Fused_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Non_Fused_Branches", - "LegacyName": "metric_TMA_....Non_Fused_Branches(%)", "Origin": "perfmon" }, { "MetricName": "Other_Light_Ops", - "LegacyName": "metric_TMA_....Other_Light_Ops(%)", "Origin": "perfmon" }, { "MetricName": "Heavy_Operations", - "LegacyName": "metric_TMA_..Heavy_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Few_Uops_Instructions", - "LegacyName": "metric_TMA_....Few_Uops_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Microcode_Sequencer", - "LegacyName": "metric_TMA_....Microcode_Sequencer(%)", "Origin": "perfmon" } ] diff --git a/cmd/metrics/resources/perfmon/gnr/gnr.json b/cmd/metrics/resources/perfmon/gnr/gnr.json index df227ae..fd499d9 100644 --- a/cmd/metrics/resources/perfmon/gnr/gnr.json +++ b/cmd/metrics/resources/perfmon/gnr/gnr.json @@ -12,582 +12,466 @@ "ReportMetrics": [ { "MetricName": "cpu_operating_frequency", - "LegacyName": "metric_CPU operating frequency (in GHz)", "Origin": "perfmon" }, { "MetricName": "cpu_utilization", - "LegacyName": "metric_CPU utilization %", "Origin": "perfmon" }, { "MetricName": "cpu_util_kernel", - "LegacyName": "metric_CPU utilization % in kernel mode", "Origin": "perfspect" }, { "MetricName": "cpi", - "LegacyName": "metric_CPI", "Origin": "perfmon" }, { "MetricName": "cycles_per_txn", - "LegacyName": "metric_cycles per txn", "Origin": "perfspect" }, { "MetricName": "kernel_cpi", - "LegacyName": "metric_kernel_CPI", "Origin": "perfspect" }, { "MetricName": "kernel_cycles_per_txn", - "LegacyName": "metric_kernel_cycles per txn", "Origin": "perfspect" }, { "MetricName": "ipc", - "LegacyName": "metric_IPC", "Origin": "perfspect" }, { "MetricName": "giga_instructions_per_sec", - "LegacyName": "metric_giga_instructions_per_sec", "Origin": "perfspect" }, { "MetricName": "branch_misprediction_ratio", - "LegacyName": "metric_branch misprediction ratio", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_instr", - "LegacyName": "metric_locks retired per instr", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_txn", - "LegacyName": "metric_locks retired per txn", "Origin": "perfspect" }, { "MetricName": "l1d_mpi", - "LegacyName": "metric_L1D MPI (includes data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l1d_misses_per_txn", - "LegacyName": "metric_L1D misses per txn (includes data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l1d_demand_data_read_hits_per_instr", - "LegacyName": "metric_L1D demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l1d_demand_data_read_hits_per_txn", - "LegacyName": "metric_L1D demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l1_i_code_read_misses_with_prefetches_per_instr", - "LegacyName": "metric_L1-I code read misses (w/ prefetches) per instr", "Origin": "perfmon" }, { "MetricName": "l1i_code_read_misses_per_txn", - "LegacyName": "metric_L1I code read misses (includes prefetches) per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_hits_per_instr", - "LegacyName": "metric_L2 demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_hits_per_txn", - "LegacyName": "metric_L2 demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l2_mpi", - "LegacyName": "metric_L2 MPI (includes code+data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l2_misses_per_txn", - "LegacyName": "metric_L2 misses per txn (includes code+data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_mpi", - "LegacyName": "metric_L2 demand data read MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_misses_per_txn", - "LegacyName": "metric_L2 demand data read misses per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_code_mpi", - "LegacyName": "metric_L2 demand code MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_code_misses_per_txn", - "LegacyName": "metric_L2 demand code misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_code_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC code read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_code_read_misses_per_txn", - "LegacyName": "metric_LLC code read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_data_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC data read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_data_read_misses_per_txn", - "LegacyName": "metric_LLC data read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_demand_data_read_miss_latency", - "LegacyName": "metric_Average LLC demand data read miss latency (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_local_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for LOCAL requests (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_remote_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for REMOTE requests (in ns)", "Origin": "perfmon" }, { "MetricName": "upi_data_transmit_bw", - "LegacyName": "metric_UPI Data transmit BW (MB/sec) (only data)", "Origin": "perfmon" }, { "MetricName": "package_power", - "LegacyName": "metric_package power (watts)", "Origin": "perfspect" }, { "MetricName": "dram_power", - "LegacyName": "metric_DRAM power (watts)", "Origin": "perfspect" }, { "MetricName": "core_c6_residency", - "LegacyName": "metric_core c6 residency %", "Origin": "perfspect" }, { "MetricName": "package_c6_residency", - "LegacyName": "metric_package c6 residency %", "Origin": "perfspect" }, { "MetricName": "percent_uops_delivered_from_decoded_icache", - "LegacyName": "metric_% Uops delivered from decoded Icache (DSB)", "Origin": "perfmon" }, { "MetricName": "percent_uops_delivered_from_legacy_decode_pipeline", - "LegacyName": "metric_% Uops delivered from legacy decode pipeline (MITE)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_read", - "LegacyName": "metric_memory bandwidth read (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_write", - "LegacyName": "metric_memory bandwidth write (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_total", - "LegacyName": "metric_memory bandwidth total (MB/sec)", "Origin": "perfmon" }, { "MetricName": "itlb_2nd_level_mpi", - "LegacyName": "metric_ITLB (2nd level) MPI", "Origin": "perfmon" }, { "MetricName": "itlb_misses_per_txn", - "LegacyName": "metric_ITLB (2nd level) misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_load_mpi", - "LegacyName": "metric_DTLB (2nd level) load MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_load_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) load misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_store_mpi", - "LegacyName": "metric_DTLB (2nd level) store MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_store_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) store misses per txn", "Origin": "perfspect" }, { "MetricName": "numa_reads_addressed_to_local_dram", - "LegacyName": "metric_NUMA %_Reads addressed to local DRAM", "Origin": "perfmon" }, { "MetricName": "numa_reads_addressed_to_remote_dram", - "LegacyName": "metric_NUMA %_Reads addressed to remote DRAM", "Origin": "perfmon" }, { "MetricName": "uncore_frequency", - "LegacyName": "metric_uncore frequency GHz", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_write", - "LegacyName": "metric_IO_bandwidth_disk_or_network_writes (MB/sec)", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_read", - "LegacyName": "metric_IO_bandwidth_disk_or_network_reads (MB/sec)", "Origin": "perfmon" }, { "MetricName": "Frontend_Bound", - "LegacyName": "metric_TMA_Frontend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Latency", - "LegacyName": "metric_TMA_..Fetch_Latency(%)", "Origin": "perfmon" }, { "MetricName": "ICache_Misses", - "LegacyName": "metric_TMA_....ICache_Misses(%)", "Origin": "perfmon" }, { "MetricName": "ITLB_Misses", - "LegacyName": "metric_TMA_....ITLB_Misses(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Resteers", - "LegacyName": "metric_TMA_....Branch_Resteers(%)", "Origin": "perfmon" }, { "MetricName": "MS_Switches", - "LegacyName": "metric_TMA_....MS_Switches(%)", "Origin": "perfmon" }, { "MetricName": "LCP", - "LegacyName": "metric_TMA_....LCP(%)", "Origin": "perfmon" }, { "MetricName": "DSB_Switches", - "LegacyName": "metric_TMA_....DSB_Switches(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Bandwidth", - "LegacyName": "metric_TMA_..Fetch_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MITE", - "LegacyName": "metric_TMA_....MITE(%)", "Origin": "perfmon" }, { "MetricName": "DSB", - "LegacyName": "metric_TMA_....DSB(%)", "Origin": "perfmon" }, { "MetricName": "MS", - "LegacyName": "metric_TMA_....MS(%)", "Origin": "perfmon" }, { "MetricName": "Bad_Speculation", - "LegacyName": "metric_TMA_Bad_Speculation(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Mispredicts", - "LegacyName": "metric_TMA_..Branch_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Cond_NT_Mispredicts", - "LegacyName": "metric_TMA_....Cond_NT_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Cond_TK_Mispredicts", - "LegacyName": "metric_TMA_....Cond_TK_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Ind_Call_Mispredicts", - "LegacyName": "metric_TMA_....Ind_Call_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Ind_Jump_Mispredicts", - "LegacyName": "metric_TMA_....Ind_Jump_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Ret_Mispredicts", - "LegacyName": "metric_TMA_....Ret_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Other_Mispredicts", - "LegacyName": "metric_TMA_....Other_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Machine_Clears", - "LegacyName": "metric_TMA_..Machine_Clears(%)", "Origin": "perfmon" }, { "MetricName": "Other_Nukes", - "LegacyName": "metric_TMA_....Other_Nukes(%)", "Origin": "perfmon" }, { "MetricName": "Backend_Bound", - "LegacyName": "metric_TMA_Backend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Bound", - "LegacyName": "metric_TMA_..Memory_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L1_Bound", - "LegacyName": "metric_TMA_....L1_Bound(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Load", - "LegacyName": "metric_TMA_......DTLB_Load(%)", "Origin": "perfmon" }, { "MetricName": "Store_Fwd_Blk", - "LegacyName": "metric_TMA_......Store_Fwd_Blk(%)", "Origin": "perfmon" }, { "MetricName": "L1_Latency_Dependency", - "LegacyName": "metric_TMA_......L1_Latency_Dependency(%)", "Origin": "perfmon" }, { "MetricName": "Lock_Latency", - "LegacyName": "metric_TMA_......Lock_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Split_Loads", - "LegacyName": "metric_TMA_......Split_Loads(%)", "Origin": "perfmon" }, { "MetricName": "FB_Full", - "LegacyName": "metric_TMA_......FB_Full(%)", "Origin": "perfmon" }, { "MetricName": "L2_Bound", - "LegacyName": "metric_TMA_....L2_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L3_Bound", - "LegacyName": "metric_TMA_....L3_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Contested_Accesses", - "LegacyName": "metric_TMA_......Contested_Accesses(%)", "Origin": "perfmon" }, { "MetricName": "Data_Sharing", - "LegacyName": "metric_TMA_......Data_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "L3_Hit_Latency", - "LegacyName": "metric_TMA_......L3_Hit_Latency(%)", "Origin": "perfmon" }, { "MetricName": "SQ_Full", - "LegacyName": "metric_TMA_......SQ_Full(%)", "Origin": "perfmon" }, { "MetricName": "DRAM_Bound", - "LegacyName": "metric_TMA_....DRAM_Bound(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Bandwidth", - "LegacyName": "metric_TMA_......MEM_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Latency", - "LegacyName": "metric_TMA_......MEM_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Store_Bound", - "LegacyName": "metric_TMA_....Store_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Store_Latency", - "LegacyName": "metric_TMA_......Store_Latency(%)", "Origin": "perfmon" }, { "MetricName": "False_Sharing", - "LegacyName": "metric_TMA_......False_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "Split_Stores", - "LegacyName": "metric_TMA_......Split_Stores(%)", "Origin": "perfmon" }, { "MetricName": "Streaming_Stores", - "LegacyName": "metric_TMA_......Streaming_Stores(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Store", - "LegacyName": "metric_TMA_......DTLB_Store(%)", "Origin": "perfmon" }, { "MetricName": "Core_Bound", - "LegacyName": "metric_TMA_..Core_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Divider", - "LegacyName": "metric_TMA_....Divider(%)", "Origin": "perfmon" }, { "MetricName": "Serializing_Operation", - "LegacyName": "metric_TMA_....Serializing_Operation(%)", "Origin": "perfmon" }, { "MetricName": "AMX_Busy", - "LegacyName": "metric_TMA_....AMX_Busy(%)", "Origin": "perfmon" }, { "MetricName": "Ports_Utilization", - "LegacyName": "metric_TMA_....Ports_Utilization(%)", "Origin": "perfmon" }, { "MetricName": "Retiring", - "LegacyName": "metric_TMA_Retiring(%)", "Origin": "perfmon" }, { "MetricName": "Light_Operations", - "LegacyName": "metric_TMA_..Light_Operations(%)", "Origin": "perfmon" }, { "MetricName": "FP_Arith", - "LegacyName": "metric_TMA_....FP_Arith(%)", "Origin": "perfmon" }, { "MetricName": "Int_Operations", - "LegacyName": "metric_TMA_....Int_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Operations", - "LegacyName": "metric_TMA_....Memory_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Fused_Instructions", - "LegacyName": "metric_TMA_....Fused_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Non_Fused_Branches", - "LegacyName": "metric_TMA_....Non_Fused_Branches(%)", "Origin": "perfmon" }, { "MetricName": "Other_Light_Ops", - "LegacyName": "metric_TMA_....Other_Light_Ops(%)", "Origin": "perfmon" }, { "MetricName": "Heavy_Operations", - "LegacyName": "metric_TMA_..Heavy_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Few_Uops_Instructions", - "LegacyName": "metric_TMA_....Few_Uops_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Microcode_Sequencer", - "LegacyName": "metric_TMA_....Microcode_Sequencer(%)", "Origin": "perfmon" } ] diff --git a/cmd/metrics/resources/perfmon/icx/icx.json b/cmd/metrics/resources/perfmon/icx/icx.json index 690a98b..1d92d3d 100644 --- a/cmd/metrics/resources/perfmon/icx/icx.json +++ b/cmd/metrics/resources/perfmon/icx/icx.json @@ -12,542 +12,434 @@ "ReportMetrics": [ { "MetricName": "cpu_operating_frequency", - "LegacyName": "metric_CPU operating frequency (in GHz)", "Origin": "perfmon" }, { "MetricName": "cpu_utilization", - "LegacyName": "metric_CPU utilization %", "Origin": "perfmon" }, { "MetricName": "cpu_util_kernel", - "LegacyName": "metric_CPU utilization % in kernel mode", "Origin": "perfspect" }, { "MetricName": "cpi", - "LegacyName": "metric_CPI", "Origin": "perfmon" }, { "MetricName": "cycles_per_txn", - "LegacyName": "metric_cycles per txn", "Origin": "perfspect" }, { "MetricName": "kernel_cpi", - "LegacyName": "metric_kernel_CPI", "Origin": "perfspect" }, { "MetricName": "kernel_cycles_per_txn", - "LegacyName": "metric_kernel_cycles per txn", "Origin": "perfspect" }, { "MetricName": "ipc", - "LegacyName": "metric_IPC", "Origin": "perfspect" }, { "MetricName": "giga_instructions_per_sec", - "LegacyName": "metric_giga_instructions_per_sec", "Origin": "perfspect" }, { "MetricName": "branch_misprediction_ratio", - "LegacyName": "metric_branch misprediction ratio", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_instr", - "LegacyName": "metric_locks retired per instr", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_txn", - "LegacyName": "metric_locks retired per txn", "Origin": "perfspect" }, { "MetricName": "l1d_mpi", - "LegacyName": "metric_L1D MPI (includes data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l1d_misses_per_txn", - "LegacyName": "metric_L1D misses per txn (includes data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l1d_demand_data_read_hits_per_instr", - "LegacyName": "metric_L1D demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l1d_demand_data_read_hits_per_txn", - "LegacyName": "metric_L1D demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l1_i_code_read_misses_with_prefetches_per_instr", - "LegacyName": "metric_L1-I code read misses (w/ prefetches) per instr", "Origin": "perfmon" }, { "MetricName": "l1i_code_read_misses_per_txn", - "LegacyName": "metric_L1I code read misses (includes prefetches) per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_hits_per_instr", - "LegacyName": "metric_L2 demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_hits_per_txn", - "LegacyName": "metric_L2 demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l2_mpi", - "LegacyName": "metric_L2 MPI (includes code+data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l2_misses_per_txn", - "LegacyName": "metric_L2 misses per txn (includes code+data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_mpi", - "LegacyName": "metric_L2 demand data read MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_misses_per_txn", - "LegacyName": "metric_L2 demand data read misses per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_code_mpi", - "LegacyName": "metric_L2 demand code MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_code_misses_per_txn", - "LegacyName": "metric_L2 demand code misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_code_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC code read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_code_read_misses_per_txn", - "LegacyName": "metric_LLC code read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_data_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC data read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_data_read_misses_per_txn", - "LegacyName": "metric_LLC data read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_demand_data_read_miss_latency", - "LegacyName": "metric_Average LLC demand data read miss latency (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_local_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for LOCAL requests (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_remote_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for REMOTE requests (in ns)", "Origin": "perfmon" }, { "MetricName": "upi_data_transmit_bw", - "LegacyName": "metric_UPI Data transmit BW (MB/sec) (only data)", "Origin": "perfmon" }, { "MetricName": "package_power", - "LegacyName": "metric_package power (watts)", "Origin": "perfspect" }, { "MetricName": "dram_power", - "LegacyName": "metric_DRAM power (watts)", "Origin": "perfspect" }, { "MetricName": "core_c6_residency", - "LegacyName": "metric_core c6 residency %", "Origin": "perfspect" }, { "MetricName": "package_c6_residency", - "LegacyName": "metric_package c6 residency %", "Origin": "perfspect" }, { "MetricName": "percent_uops_delivered_from_decoded_icache", - "LegacyName": "metric_% Uops delivered from decoded Icache (DSB)", "Origin": "perfmon" }, { "MetricName": "percent_uops_delivered_from_legacy_decode_pipeline", - "LegacyName": "metric_% Uops delivered from legacy decode pipeline (MITE)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_read", - "LegacyName": "metric_memory bandwidth read (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_write", - "LegacyName": "metric_memory bandwidth write (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_total", - "LegacyName": "metric_memory bandwidth total (MB/sec)", "Origin": "perfmon" }, { "MetricName": "itlb_2nd_level_mpi", - "LegacyName": "metric_ITLB (2nd level) MPI", "Origin": "perfmon" }, { "MetricName": "itlb_misses_per_txn", - "LegacyName": "metric_ITLB (2nd level) misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_load_mpi", - "LegacyName": "metric_DTLB (2nd level) load MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_load_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) load misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_store_mpi", - "LegacyName": "metric_DTLB (2nd level) store MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_store_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) store misses per txn", "Origin": "perfspect" }, { "MetricName": "numa_reads_addressed_to_local_dram", - "LegacyName": "metric_NUMA %_Reads addressed to local DRAM", "Origin": "perfmon" }, { "MetricName": "numa_reads_addressed_to_remote_dram", - "LegacyName": "metric_NUMA %_Reads addressed to remote DRAM", "Origin": "perfmon" }, { "MetricName": "uncore_frequency", - "LegacyName": "metric_uncore frequency GHz", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_write", - "LegacyName": "metric_IO_bandwidth_disk_or_network_writes (MB/sec)", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_read", - "LegacyName": "metric_IO_bandwidth_disk_or_network_reads (MB/sec)", "Origin": "perfmon" }, { "MetricName": "Frontend_Bound", - "LegacyName": "metric_TMA_Frontend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Latency", - "LegacyName": "metric_TMA_..Fetch_Latency(%)", "Origin": "perfmon" }, { "MetricName": "ICache_Misses", - "LegacyName": "metric_TMA_....ICache_Misses(%)", "Origin": "perfmon" }, { "MetricName": "ITLB_Misses", - "LegacyName": "metric_TMA_....ITLB_Misses(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Resteers", - "LegacyName": "metric_TMA_....Branch_Resteers(%)", "Origin": "perfmon" }, { "MetricName": "MS_Switches", - "LegacyName": "metric_TMA_....MS_Switches(%)", "Origin": "perfmon" }, { "MetricName": "LCP", - "LegacyName": "metric_TMA_....LCP(%)", "Origin": "perfmon" }, { "MetricName": "DSB_Switches", - "LegacyName": "metric_TMA_....DSB_Switches(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Bandwidth", - "LegacyName": "metric_TMA_..Fetch_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MITE", - "LegacyName": "metric_TMA_....MITE(%)", "Origin": "perfmon" }, { "MetricName": "DSB", - "LegacyName": "metric_TMA_....DSB(%)", "Origin": "perfmon" }, { "MetricName": "MS", - "LegacyName": "metric_TMA_....MS(%)", "Origin": "perfmon" }, { "MetricName": "Bad_Speculation", - "LegacyName": "metric_TMA_Bad_Speculation(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Mispredicts", - "LegacyName": "metric_TMA_..Branch_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Other_Mispredicts", - "LegacyName": "metric_TMA_....Other_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Machine_Clears", - "LegacyName": "metric_TMA_..Machine_Clears(%)", "Origin": "perfmon" }, { "MetricName": "Other_Nukes", - "LegacyName": "metric_TMA_....Other_Nukes(%)", "Origin": "perfmon" }, { "MetricName": "Backend_Bound", - "LegacyName": "metric_TMA_Backend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Bound", - "LegacyName": "metric_TMA_..Memory_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L1_Bound", - "LegacyName": "metric_TMA_....L1_Bound(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Load", - "LegacyName": "metric_TMA_......DTLB_Load(%)", "Origin": "perfmon" }, { "MetricName": "Store_Fwd_Blk", - "LegacyName": "metric_TMA_......Store_Fwd_Blk(%)", "Origin": "perfmon" }, { "MetricName": "L1_Latency_Dependency", - "LegacyName": "metric_TMA_......L1_Latency_Dependency(%)", "Origin": "perfmon" }, { "MetricName": "Lock_Latency", - "LegacyName": "metric_TMA_......Lock_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Split_Loads", - "LegacyName": "metric_TMA_......Split_Loads(%)", "Origin": "perfmon" }, { "MetricName": "FB_Full", - "LegacyName": "metric_TMA_......FB_Full(%)", "Origin": "perfmon" }, { "MetricName": "L2_Bound", - "LegacyName": "metric_TMA_....L2_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L3_Bound", - "LegacyName": "metric_TMA_....L3_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Contested_Accesses", - "LegacyName": "metric_TMA_......Contested_Accesses(%)", "Origin": "perfmon" }, { "MetricName": "Data_Sharing", - "LegacyName": "metric_TMA_......Data_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "L3_Hit_Latency", - "LegacyName": "metric_TMA_......L3_Hit_Latency(%)", "Origin": "perfmon" }, { "MetricName": "SQ_Full", - "LegacyName": "metric_TMA_......SQ_Full(%)", "Origin": "perfmon" }, { "MetricName": "DRAM_Bound", - "LegacyName": "metric_TMA_....DRAM_Bound(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Bandwidth", - "LegacyName": "metric_TMA_......MEM_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Latency", - "LegacyName": "metric_TMA_......MEM_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Store_Bound", - "LegacyName": "metric_TMA_....Store_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Store_Latency", - "LegacyName": "metric_TMA_......Store_Latency(%)", "Origin": "perfmon" }, { "MetricName": "False_Sharing", - "LegacyName": "metric_TMA_......False_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "Split_Stores", - "LegacyName": "metric_TMA_......Split_Stores(%)", "Origin": "perfmon" }, { "MetricName": "Streaming_Stores", - "LegacyName": "metric_TMA_......Streaming_Stores(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Store", - "LegacyName": "metric_TMA_......DTLB_Store(%)", "Origin": "perfmon" }, { "MetricName": "Core_Bound", - "LegacyName": "metric_TMA_..Core_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Divider", - "LegacyName": "metric_TMA_....Divider(%)", "Origin": "perfmon" }, { "MetricName": "Serializing_Operation", - "LegacyName": "metric_TMA_....Serializing_Operation(%)", "Origin": "perfmon" }, { "MetricName": "Ports_Utilization", - "LegacyName": "metric_TMA_....Ports_Utilization(%)", "Origin": "perfmon" }, { "MetricName": "Retiring", - "LegacyName": "metric_TMA_Retiring(%)", "Origin": "perfmon" }, { "MetricName": "Light_Operations", - "LegacyName": "metric_TMA_..Light_Operations(%)", "Origin": "perfmon" }, { "MetricName": "FP_Arith", - "LegacyName": "metric_TMA_....FP_Arith(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Operations", - "LegacyName": "metric_TMA_....Memory_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Instructions", - "LegacyName": "metric_TMA_....Branch_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Other_Light_Ops", - "LegacyName": "metric_TMA_....Other_Light_Ops(%)", "Origin": "perfmon" }, { "MetricName": "Heavy_Operations", - "LegacyName": "metric_TMA_..Heavy_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Few_Uops_Instructions", - "LegacyName": "metric_TMA_....Few_Uops_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Microcode_Sequencer", - "LegacyName": "metric_TMA_....Microcode_Sequencer(%)", "Origin": "perfmon" } ] diff --git a/cmd/metrics/resources/perfmon/spr/spr.json b/cmd/metrics/resources/perfmon/spr/spr.json index d5c3a08..5158cbe 100644 --- a/cmd/metrics/resources/perfmon/spr/spr.json +++ b/cmd/metrics/resources/perfmon/spr/spr.json @@ -12,557 +12,446 @@ "ReportMetrics": [ { "MetricName": "cpu_operating_frequency", - "LegacyName": "metric_CPU operating frequency (in GHz)", "Origin": "perfmon" }, { "MetricName": "cpu_utilization", - "LegacyName": "metric_CPU utilization %", "Origin": "perfmon" }, { "MetricName": "cpu_util_kernel", - "LegacyName": "metric_CPU utilization % in kernel mode", "Origin": "perfspect" }, { "MetricName": "cpi", - "LegacyName": "metric_CPI", "Origin": "perfmon" }, { "MetricName": "cycles_per_txn", - "LegacyName": "metric_cycles per txn", "Origin": "perfspect" }, { "MetricName": "kernel_cpi", - "LegacyName": "metric_kernel_CPI", "Origin": "perfspect" }, { "MetricName": "kernel_cycles_per_txn", - "LegacyName": "metric_kernel_cycles per txn", "Origin": "perfspect" }, { "MetricName": "ipc", - "LegacyName": "metric_IPC", "Origin": "perfspect" }, { "MetricName": "giga_instructions_per_sec", - "LegacyName": "metric_giga_instructions_per_sec", "Origin": "perfspect" }, { "MetricName": "branch_misprediction_ratio", - "LegacyName": "metric_branch misprediction ratio", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_instr", - "LegacyName": "metric_locks retired per instr", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_txn", - "LegacyName": "metric_locks retired per txn", "Origin": "perfspect" }, { "MetricName": "l1d_mpi", - "LegacyName": "metric_L1D MPI (includes data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l1d_misses_per_txn", - "LegacyName": "metric_L1D misses per txn (includes data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l1d_demand_data_read_hits_per_instr", - "LegacyName": "metric_L1D demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l1d_demand_data_read_hits_per_txn", - "LegacyName": "metric_L1D demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l1_i_code_read_misses_with_prefetches_per_instr", - "LegacyName": "metric_L1-I code read misses (w/ prefetches) per instr", "Origin": "perfmon" }, { "MetricName": "l1i_code_read_misses_per_txn", - "LegacyName": "metric_L1I code read misses (includes prefetches) per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_hits_per_instr", - "LegacyName": "metric_L2 demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_hits_per_txn", - "LegacyName": "metric_L2 demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l2_mpi", - "LegacyName": "metric_L2 MPI (includes code+data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l2_misses_per_txn", - "LegacyName": "metric_L2 misses per txn (includes code+data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_mpi", - "LegacyName": "metric_L2 demand data read MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_misses_per_txn", - "LegacyName": "metric_L2 demand data read misses per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_code_mpi", - "LegacyName": "metric_L2 demand code MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_code_misses_per_txn", - "LegacyName": "metric_L2 demand code misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_code_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC code read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_code_read_misses_per_txn", - "LegacyName": "metric_LLC code read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_data_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC data read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_data_read_misses_per_txn", - "LegacyName": "metric_LLC data read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_demand_data_read_miss_latency", - "LegacyName": "metric_Average LLC demand data read miss latency (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_local_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for LOCAL requests (in ns)", "Origin": "perfmon" }, { "MetricName": "llc_demand_data_read_miss_latency_for_remote_requests", - "LegacyName": "metric_Average LLC demand data read miss latency for REMOTE requests (in ns)", "Origin": "perfmon" }, { "MetricName": "upi_data_transmit_bw", - "LegacyName": "metric_UPI Data transmit BW (MB/sec) (only data)", "Origin": "perfmon" }, { "MetricName": "package_power", - "LegacyName": "metric_package power (watts)", "Origin": "perfspect" }, { "MetricName": "dram_power", - "LegacyName": "metric_DRAM power (watts)", "Origin": "perfspect" }, { "MetricName": "core_c6_residency", - "LegacyName": "metric_core c6 residency %", "Origin": "perfspect" }, { "MetricName": "package_c6_residency", - "LegacyName": "metric_package c6 residency %", "Origin": "perfspect" }, { "MetricName": "percent_uops_delivered_from_decoded_icache", - "LegacyName": "metric_% Uops delivered from decoded Icache (DSB)", "Origin": "perfmon" }, { "MetricName": "percent_uops_delivered_from_legacy_decode_pipeline", - "LegacyName": "metric_% Uops delivered from legacy decode pipeline (MITE)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_read", - "LegacyName": "metric_memory bandwidth read (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_write", - "LegacyName": "metric_memory bandwidth write (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_total", - "LegacyName": "metric_memory bandwidth total (MB/sec)", "Origin": "perfmon" }, { "MetricName": "itlb_2nd_level_mpi", - "LegacyName": "metric_ITLB (2nd level) MPI", "Origin": "perfmon" }, { "MetricName": "itlb_misses_per_txn", - "LegacyName": "metric_ITLB (2nd level) misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_load_mpi", - "LegacyName": "metric_DTLB (2nd level) load MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_load_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) load misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_store_mpi", - "LegacyName": "metric_DTLB (2nd level) store MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_store_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) store misses per txn", "Origin": "perfspect" }, { "MetricName": "numa_reads_addressed_to_local_dram", - "LegacyName": "metric_NUMA %_Reads addressed to local DRAM", "Origin": "perfmon" }, { "MetricName": "numa_reads_addressed_to_remote_dram", - "LegacyName": "metric_NUMA %_Reads addressed to remote DRAM", "Origin": "perfmon" }, { "MetricName": "uncore_frequency", - "LegacyName": "metric_uncore frequency GHz", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_write", - "LegacyName": "metric_IO_bandwidth_disk_or_network_writes (MB/sec)", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_read", - "LegacyName": "metric_IO_bandwidth_disk_or_network_reads (MB/sec)", "Origin": "perfmon" }, { "MetricName": "Frontend_Bound", - "LegacyName": "metric_TMA_Frontend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Latency", - "LegacyName": "metric_TMA_..Fetch_Latency(%)", "Origin": "perfmon" }, { "MetricName": "ICache_Misses", - "LegacyName": "metric_TMA_....ICache_Misses(%)", "Origin": "perfmon" }, { "MetricName": "ITLB_Misses", - "LegacyName": "metric_TMA_....ITLB_Misses(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Resteers", - "LegacyName": "metric_TMA_....Branch_Resteers(%)", "Origin": "perfmon" }, { "MetricName": "MS_Switches", - "LegacyName": "metric_TMA_....MS_Switches(%)", "Origin": "perfmon" }, { "MetricName": "LCP", - "LegacyName": "metric_TMA_....LCP(%)", "Origin": "perfmon" }, { "MetricName": "DSB_Switches", - "LegacyName": "metric_TMA_....DSB_Switches(%)", "Origin": "perfmon" }, { "MetricName": "Fetch_Bandwidth", - "LegacyName": "metric_TMA_..Fetch_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MITE", - "LegacyName": "metric_TMA_....MITE(%)", "Origin": "perfmon" }, { "MetricName": "DSB", - "LegacyName": "metric_TMA_....DSB(%)", "Origin": "perfmon" }, { "MetricName": "MS", - "LegacyName": "metric_TMA_....MS(%)", "Origin": "perfmon" }, { "MetricName": "Bad_Speculation", - "LegacyName": "metric_TMA_Bad_Speculation(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Mispredicts", - "LegacyName": "metric_TMA_..Branch_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Other_Mispredicts", - "LegacyName": "metric_TMA_....Other_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Machine_Clears", - "LegacyName": "metric_TMA_..Machine_Clears(%)", "Origin": "perfmon" }, { "MetricName": "Other_Nukes", - "LegacyName": "metric_TMA_....Other_Nukes(%)", "Origin": "perfmon" }, { "MetricName": "Backend_Bound", - "LegacyName": "metric_TMA_Backend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Bound", - "LegacyName": "metric_TMA_..Memory_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L1_Bound", - "LegacyName": "metric_TMA_....L1_Bound(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Load", - "LegacyName": "metric_TMA_......DTLB_Load(%)", "Origin": "perfmon" }, { "MetricName": "Store_Fwd_Blk", - "LegacyName": "metric_TMA_......Store_Fwd_Blk(%)", "Origin": "perfmon" }, { "MetricName": "L1_Latency_Dependency", - "LegacyName": "metric_TMA_......L1_Latency_Dependency(%)", "Origin": "perfmon" }, { "MetricName": "Lock_Latency", - "LegacyName": "metric_TMA_......Lock_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Split_Loads", - "LegacyName": "metric_TMA_......Split_Loads(%)", "Origin": "perfmon" }, { "MetricName": "FB_Full", - "LegacyName": "metric_TMA_......FB_Full(%)", "Origin": "perfmon" }, { "MetricName": "L2_Bound", - "LegacyName": "metric_TMA_....L2_Bound(%)", "Origin": "perfmon" }, { "MetricName": "L3_Bound", - "LegacyName": "metric_TMA_....L3_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Contested_Accesses", - "LegacyName": "metric_TMA_......Contested_Accesses(%)", "Origin": "perfmon" }, { "MetricName": "Data_Sharing", - "LegacyName": "metric_TMA_......Data_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "L3_Hit_Latency", - "LegacyName": "metric_TMA_......L3_Hit_Latency(%)", "Origin": "perfmon" }, { "MetricName": "SQ_Full", - "LegacyName": "metric_TMA_......SQ_Full(%)", "Origin": "perfmon" }, { "MetricName": "DRAM_Bound", - "LegacyName": "metric_TMA_....DRAM_Bound(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Bandwidth", - "LegacyName": "metric_TMA_......MEM_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "MEM_Latency", - "LegacyName": "metric_TMA_......MEM_Latency(%)", "Origin": "perfmon" }, { "MetricName": "Store_Bound", - "LegacyName": "metric_TMA_....Store_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Store_Latency", - "LegacyName": "metric_TMA_......Store_Latency(%)", "Origin": "perfmon" }, { "MetricName": "False_Sharing", - "LegacyName": "metric_TMA_......False_Sharing(%)", "Origin": "perfmon" }, { "MetricName": "Split_Stores", - "LegacyName": "metric_TMA_......Split_Stores(%)", "Origin": "perfmon" }, { "MetricName": "Streaming_Stores", - "LegacyName": "metric_TMA_......Streaming_Stores(%)", "Origin": "perfmon" }, { "MetricName": "DTLB_Store", - "LegacyName": "metric_TMA_......DTLB_Store(%)", "Origin": "perfmon" }, { "MetricName": "Core_Bound", - "LegacyName": "metric_TMA_..Core_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Divider", - "LegacyName": "metric_TMA_....Divider(%)", "Origin": "perfmon" }, { "MetricName": "Serializing_Operation", - "LegacyName": "metric_TMA_....Serializing_Operation(%)", "Origin": "perfmon" }, { "MetricName": "AMX_Busy", - "LegacyName": "metric_TMA_....AMX_Busy(%)", "Origin": "perfmon" }, { "MetricName": "Ports_Utilization", - "LegacyName": "metric_TMA_....Ports_Utilization(%)", "Origin": "perfmon" }, { "MetricName": "Retiring", - "LegacyName": "metric_TMA_Retiring(%)", "Origin": "perfmon" }, { "MetricName": "Light_Operations", - "LegacyName": "metric_TMA_..Light_Operations(%)", "Origin": "perfmon" }, { "MetricName": "FP_Arith", - "LegacyName": "metric_TMA_....FP_Arith(%)", "Origin": "perfmon" }, { "MetricName": "Int_Operations", - "LegacyName": "metric_TMA_....Int_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Memory_Operations", - "LegacyName": "metric_TMA_....Memory_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Fused_Instructions", - "LegacyName": "metric_TMA_....Fused_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Non_Fused_Branches", - "LegacyName": "metric_TMA_....Non_Fused_Branches(%)", "Origin": "perfmon" }, { "MetricName": "Other_Light_Ops", - "LegacyName": "metric_TMA_....Other_Light_Ops(%)", "Origin": "perfmon" }, { "MetricName": "Heavy_Operations", - "LegacyName": "metric_TMA_..Heavy_Operations(%)", "Origin": "perfmon" }, { "MetricName": "Few_Uops_Instructions", - "LegacyName": "metric_TMA_....Few_Uops_Instructions(%)", "Origin": "perfmon" }, { "MetricName": "Microcode_Sequencer", - "LegacyName": "metric_TMA_....Microcode_Sequencer(%)", "Origin": "perfmon" } ] diff --git a/cmd/metrics/resources/perfmon/srf/srf.json b/cmd/metrics/resources/perfmon/srf/srf.json index 3f50f1c..2e7ec8f 100644 --- a/cmd/metrics/resources/perfmon/srf/srf.json +++ b/cmd/metrics/resources/perfmon/srf/srf.json @@ -12,362 +12,290 @@ "ReportMetrics": [ { "MetricName": "cpu_operating_frequency", - "LegacyName": "metric_CPU operating frequency (in GHz)", "Origin": "perfmon" }, { "MetricName": "cpu_utilization", - "LegacyName": "metric_CPU utilization %", "Origin": "perfmon" }, { "MetricName": "cpu_util_kernel", - "LegacyName": "metric_CPU utilization % in kernel mode", "Origin": "perfspect" }, { "MetricName": "cpi", - "LegacyName": "metric_CPI", "Origin": "perfmon" }, { "MetricName": "cycles_per_txn", - "LegacyName": "metric_cycles per txn", "Origin": "perfspect" }, { "MetricName": "kernel_cpi", - "LegacyName": "metric_kernel_CPI", "Origin": "perfspect" }, { "MetricName": "kernel_cycles_per_txn", - "LegacyName": "metric_kernel_cycles per txn", "Origin": "perfspect" }, { "MetricName": "ipc", - "LegacyName": "metric_IPC", "Origin": "perfspect" }, { "MetricName": "giga_instructions_per_sec", - "LegacyName": "metric_giga_instructions_per_sec", "Origin": "perfspect" }, { "MetricName": "branch_misprediction_ratio", - "LegacyName": "metric_branch misprediction ratio", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_instr", - "LegacyName": "metric_locks retired per instr", "Origin": "perfspect" }, { "MetricName": "locks_retired_per_txn", - "LegacyName": "metric_locks retired per txn", "Origin": "perfspect" }, { "MetricName": "l1d_misses_per_txn", - "LegacyName": "metric_L1D misses per txn (includes data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l1d_demand_data_read_hits_per_instr", - "LegacyName": "metric_L1D demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l1d_demand_data_read_hits_per_txn", - "LegacyName": "metric_L1D demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l1_i_code_read_misses_with_prefetches_per_instr", - "LegacyName": "metric_L1-I code read misses (w/ prefetches) per instr", "Origin": "perfmon" }, { "MetricName": "l1i_code_read_misses_per_txn", - "LegacyName": "metric_L1I code read misses (includes prefetches) per txn", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_hits_per_instr", - "LegacyName": "metric_L2 demand data read hits per instr", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_hits_per_txn", - "LegacyName": "metric_L2 demand data read hits per txn", "Origin": "perfspect" }, { "MetricName": "l2_mpi", - "LegacyName": "metric_L2 MPI (includes code+data+rfo w/ prefetches)", "Origin": "perfmon" }, { "MetricName": "l2_misses_per_txn", - "LegacyName": "metric_L2 misses per txn (includes code+data+rfo w/ prefetches)", "Origin": "perfspect" }, { "MetricName": "l2_demand_data_read_mpi", - "LegacyName": "metric_L2 demand data read MPI", "Origin": "perfmon" }, { "MetricName": "l2_demand_data_read_misses_per_txn", - "LegacyName": "metric_L2 demand data read misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_code_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC code read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_code_read_misses_per_txn", - "LegacyName": "metric_LLC code read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_data_read_mpi_demand_plus_prefetch", - "LegacyName": "metric_LLC data read MPI (demand+prefetch)", "Origin": "perfmon" }, { "MetricName": "llc_data_read_misses_per_txn", - "LegacyName": "metric_LLC data read (demand+prefetch) misses per txn", "Origin": "perfspect" }, { "MetricName": "llc_demand_data_read_miss_latency", - "LegacyName": "metric_Average LLC demand data read miss latency (in ns)", "Origin": "perfmon" }, { "MetricName": "package_power", - "LegacyName": "metric_package power (watts)", "Origin": "perfspect" }, { "MetricName": "dram_power", - "LegacyName": "metric_DRAM power (watts)", "Origin": "perfspect" }, { "MetricName": "core_c6_residency", - "LegacyName": "metric_core c6 residency %", "Origin": "perfspect" }, { "MetricName": "package_c6_residency", - "LegacyName": "metric_package c6 residency %", "Origin": "perfspect" }, { "MetricName": "memory_bandwidth_read", - "LegacyName": "metric_memory bandwidth read (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_write", - "LegacyName": "metric_memory bandwidth write (MB/sec)", "Origin": "perfmon" }, { "MetricName": "memory_bandwidth_total", - "LegacyName": "metric_memory bandwidth total (MB/sec)", "Origin": "perfmon" }, { "MetricName": "itlb_2nd_level_mpi", - "LegacyName": "metric_ITLB (2nd level) MPI", "Origin": "perfmon" }, { "MetricName": "itlb_misses_per_txn", - "LegacyName": "metric_ITLB (2nd level) misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_load_mpi", - "LegacyName": "metric_DTLB (2nd level) load MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_load_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) load misses per txn", "Origin": "perfspect" }, { "MetricName": "dtlb_2nd_level_store_mpi", - "LegacyName": "metric_DTLB (2nd level) store MPI", "Origin": "perfmon" }, { "MetricName": "dtlb_store_misses_per_txn", - "LegacyName": "metric_DTLB (2nd level) store misses per txn", "Origin": "perfspect" }, { "MetricName": "numa_reads_addressed_to_local_dram", - "LegacyName": "metric_NUMA %_Reads addressed to local DRAM", "Origin": "perfmon" }, { "MetricName": "numa_reads_addressed_to_remote_dram", - "LegacyName": "metric_NUMA %_Reads addressed to remote DRAM", "Origin": "perfmon" }, { "MetricName": "uncore_frequency", - "LegacyName": "metric_uncore frequency GHz", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_write", - "LegacyName": "metric_IO_bandwidth_disk_or_network_writes (MB/sec)", "Origin": "perfmon" }, { "MetricName": "io_bandwidth_read", - "LegacyName": "metric_IO_bandwidth_disk_or_network_reads (MB/sec)", "Origin": "perfmon" }, { "MetricName": "Frontend_Bound", - "LegacyName": "metric_TMA_Frontend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "IFetch_Latency", - "LegacyName": "metric_TMA_..IFetch_Latency(%)", "Origin": "perfmon" }, { "MetricName": "ICache_Misses", - "LegacyName": "metric_TMA_....ICache_Misses(%)", "Origin": "perfmon" }, { "MetricName": "ITLB_Misses", - "LegacyName": "metric_TMA_....ITLB_Misses(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Detect", - "LegacyName": "metric_TMA_....Branch_Detect(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Resteer", - "LegacyName": "metric_TMA_....Branch_Resteer(%)", "Origin": "perfmon" }, { "MetricName": "IFetch_Bandwidth", - "LegacyName": "metric_TMA_..IFetch_Bandwidth(%)", "Origin": "perfmon" }, { "MetricName": "Cisc", - "LegacyName": "metric_TMA_....Cisc(%)", "Origin": "perfmon" }, { "MetricName": "Decode", - "LegacyName": "metric_TMA_....Decode(%)", "Origin": "perfmon" }, { "MetricName": "Predecode", - "LegacyName": "metric_TMA_....Predecode(%)", "Origin": "perfmon" }, { "MetricName": "Other_FB", - "LegacyName": "metric_TMA_....Other_FB(%)", "Origin": "perfmon" }, { "MetricName": "Bad_Speculation", - "LegacyName": "metric_TMA_Bad_Speculation(%)", "Origin": "perfmon" }, { "MetricName": "Branch_Mispredicts", - "LegacyName": "metric_TMA_..Branch_Mispredicts(%)", "Origin": "perfmon" }, { "MetricName": "Machine_Clears", - "LegacyName": "metric_TMA_..Machine_Clears(%)", "Origin": "perfmon" }, { "MetricName": "Nuke", - "LegacyName": "metric_TMA_....Nuke(%)", "Origin": "perfmon" }, { "MetricName": "Fast_Nuke", - "LegacyName": "metric_TMA_....Fast_Nuke(%)", "Origin": "perfmon" }, { "MetricName": "Backend_Bound", - "LegacyName": "metric_TMA_Backend_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Core_Bound", - "LegacyName": "metric_TMA_..Core_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Allocation_Restriction", - "LegacyName": "metric_TMA_....Allocation_Restriction(%)", "Origin": "perfmon" }, { "MetricName": "Resource_Bound", - "LegacyName": "metric_TMA_..Resource_Bound(%)", "Origin": "perfmon" }, { "MetricName": "Mem_Scheduler", - "LegacyName": "metric_TMA_....Mem_Scheduler(%)", "Origin": "perfmon" }, { "MetricName": "Non_Mem_Scheduler", - "LegacyName": "metric_TMA_....Non_Mem_Scheduler(%)", "Origin": "perfmon" }, { "MetricName": "Register", - "LegacyName": "metric_TMA_....Register(%)", "Origin": "perfmon" }, { "MetricName": "Reorder_Buffer", - "LegacyName": "metric_TMA_....Reorder_Buffer(%)", "Origin": "perfmon" }, { "MetricName": "Serialization", - "LegacyName": "metric_TMA_....Serialization(%)", "Origin": "perfmon" }, { "MetricName": "Retiring", - "LegacyName": "metric_TMA_Retiring(%)", "Origin": "perfmon" } ] diff --git a/cmd/metrics/summary.go b/cmd/metrics/summary.go index 84a2e14..1cb667e 100644 --- a/cmd/metrics/summary.go +++ b/cmd/metrics/summary.go @@ -22,11 +22,11 @@ import ( "time" ) -func summarizeMetrics(localOutputDir string, targetName string, metadata Metadata) ([]string, error) { +func summarizeMetrics(localOutputDir string, targetName string, metadata Metadata, metricDefinitions []MetricDefinition) ([]string, error) { filesCreated := []string{} csvMetricsFile := filepath.Join(localOutputDir, targetName+"_metrics.csv") // csv summary - out, err := summarize(csvMetricsFile, false, metadata) + out, err := summarize(csvMetricsFile, false, metadata, metricDefinitions) if err != nil { err = fmt.Errorf("failed to summarize output: %w", err) return filesCreated, err @@ -41,7 +41,7 @@ func summarizeMetrics(localOutputDir string, targetName string, metadata Metadat // html summary htmlSummary := (flagScope == scopeSystem || flagScope == scopeProcess) && flagGranularity == granularitySystem if htmlSummary { - out, err = summarize(csvMetricsFile, true, metadata) + out, err = summarize(csvMetricsFile, true, metadata, metricDefinitions) if err != nil { err = fmt.Errorf("failed to summarize output as HTML: %w", err) return filesCreated, err @@ -59,7 +59,7 @@ func summarizeMetrics(localOutputDir string, targetName string, metadata Metadat // summarize - generates formatted output from a CSV file containing metric values. // The output can be in CSV or HTML format. Set html to true to generate HTML output otherwise CSV is generated. -func summarize(csvInputPath string, html bool, metadata Metadata) (out string, err error) { +func summarize(csvInputPath string, html bool, metadata Metadata, metricDefinitions []MetricDefinition) (out string, err error) { var metrics []metricsFromCSV if metrics, err = newMetricsFromCSV(csvInputPath); err != nil { return @@ -73,7 +73,7 @@ func summarize(csvInputPath string, html bool, metadata Metadata) (out string, e err = fmt.Errorf("html format is supported only when data's scope is '%s' or '%s' and granularity is '%s'", scopeSystem, scopeProcess, granularitySystem) return } - out, err = metrics[0].getHTML(metadata) + out, err = metrics[0].getHTML(metadata, metricDefinitions) } else { if len(metrics) == 1 { // if there is only one metricsFromCSV, then it is system scope and granularity @@ -284,13 +284,13 @@ func (m *metricsFromCSV) getStats() (stats map[string]metricStats, err error) { } // getHTML - generate a string containing HTML representing the metrics -func (m *metricsFromCSV) getHTML(metadata Metadata) (out string, err error) { +func (m *metricsFromCSV) getHTML(metadata Metadata, metricDefinitions []MetricDefinition) (out string, err error) { var htmlTemplateBytes []byte if htmlTemplateBytes, err = resources.ReadFile("resources/base.html"); err != nil { slog.Error("failed to read base.html template", slog.String("error", err.Error())) return } - templateVals, err := m.loadHTMLTemplateValues(metadata) + templateVals, err := m.loadHTMLTemplateValues(metadata, metricDefinitions) if err != nil { slog.Error("failed to load template values", slog.String("error", err.Error())) return @@ -304,7 +304,7 @@ func (m *metricsFromCSV) getHTML(metadata Metadata) (out string, err error) { return buf.String(), nil } -func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata) (templateVals map[string]string, err error) { +func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata, metricDefinitions []MetricDefinition) (templateVals map[string]string, err error) { templateVals = make(map[string]string) var stats map[string]metricStats if stats, err = m.getStats(); err != nil { @@ -321,47 +321,47 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata) (templateVals metricNames []string // names per architecture, 0=Intel, 1=AMD } - templateVals["TRANSACTIONS"] = "false" // no transactions for now - - // TMA Tab's pie chart - // these are intended to be replaced with pie headers in html report - templateNameReplace := []tmplReplace{ - {"TMA_FRONTEND", []string{"Frontend", "Frontend"}}, - {"TMA_FETCHLATENCY", []string{"Fetch Latency", "Latency"}}, - {"TMA_FETCHBANDWIDTH", []string{"Fetch Bandwidth", "Bandwidth"}}, - {"TMA_BADSPECULATION", []string{"Bad Speculation", "Bad Speculation"}}, - {"TMA_BRANCHMISPREDICTS", []string{"Branch Mispredicts", "Mispredicts"}}, - {"TMA_MACHINECLEARS", []string{"Machine Clears", "Pipeline Restarts"}}, - {"TMA_BACKEND", []string{"Backend", "Backend"}}, - {"TMA_CORE", []string{"Core", "CPU"}}, - {"TMA_MEMORY", []string{"Memory", "Memory"}}, - {"TMA_RETIRING", []string{"Retiring", "Retiring"}}, - {"TMA_LIGHTOPS", []string{"Light Operations", "Fastpath"}}, - {"TMA_HEAVYOPS", []string{"Heavy Operations", "Microcode"}}, - } - // replace the template variables with the name header of the metric - for _, tmpl := range templateNameReplace { - var headerName string + // TMA Tab's pie chart (labels) + // templateLabelReplace is a list of template variables that are used as labels for the TMA pie chart + // The template variable is replaced with the label appropriate for the architecture + templateLabelReplace := []tmplReplace{ + {"FRONTEND_LABEL", []string{"Frontend", "Frontend"}}, // level 1 + {"FETCHLATENCY_LABEL", []string{"Fetch Latency", "Latency"}}, // level 2 + {"FETCHBANDWIDTH_LABEL", []string{"Fetch BW", "Bandwidth"}}, // level 2 + {"BADSPECULATION_LABEL", []string{"Bad Speculation", "Bad Speculation"}}, // level 1 + {"BRANCHMISPREDICTS_LABEL", []string{"Mispredicts", "Mispredicts"}}, // level 2 + {"MACHINECLEARS_LABEL", []string{"Machine Clears", "Pipeline Restarts"}}, // level 2 + {"BACKEND_LABEL", []string{"Backend", "Backend"}}, // level 1 + {"MEMORY_LABEL", []string{"Memory", "Memory"}}, // level 2 + {"CORE_LABEL", []string{"Core", "CPU"}}, // level 2 + {"RETIRING_LABEL", []string{"Retiring", "Retiring"}}, // level 1 + {"LIGHTOPS_LABEL", []string{"Light Ops", "Fastpath"}}, // level 2 + {"HEAVYOPS_LABEL", []string{"Heavy Ops", "Microcode"}}, // level 2 + } + // replace the template variables with the label of the metric for the pie chart + for _, tmpl := range templateLabelReplace { + var label string if len(tmpl.metricNames) > archIndex { - headerName = tmpl.metricNames[archIndex] + label = tmpl.metricNames[archIndex] } - templateVals[tmpl.tmplVar] = headerName + templateVals[tmpl.tmplVar] = label } - // TMA Tab's pie chart - // these are intended to be replaced with the mean value of the metric + // TMA Tab's pie chart (values) + // templateReplace is a list of template variables to replace with the mean value of + // the metric named in the metricNames field for the architecture templateReplace := []tmplReplace{ - {"FRONTEND", []string{"TMA_Frontend_Bound(%)", "Pipeline Utilization - Frontend Bound (%)"}}, - {"FETCHLATENCY", []string{"TMA_..Fetch_Latency(%)", "Pipeline Utilization - Frontend Bound - Latency (%)"}}, - {"FETCHBANDWIDTH", []string{"TMA_..Fetch_Bandwidth(%)", "Pipeline Utilization - Frontend Bound - Bandwidth (%)"}}, - {"BADSPECULATION", []string{"TMA_Bad_Speculation(%)", "Pipeline Utilization - Bad Speculation (%)"}}, - {"BRANCHMISPREDICTS", []string{"TMA_..Branch_Mispredicts(%)", "Pipeline Utilization - Bad Speculation - Mispredicts (%)"}}, - {"MACHINECLEARS", []string{"TMA_..Machine_Clears(%)", "Pipeline Utilization - Bad Speculation - Pipeline Restarts (%)"}}, - {"BACKEND", []string{"TMA_Backend_Bound(%)", "Pipeline Utilization - Backend Bound (%)"}}, - {"COREDATA", []string{"TMA_..Core_Bound(%)", "Pipeline Utilization - Backend Bound - CPU (%)"}}, - {"MEMORY", []string{"TMA_..Memory_Bound(%)", "Pipeline Utilization - Backend Bound - Memory (%)"}}, - {"RETIRING", []string{"TMA_Retiring(%)", "Pipeline Utilization - Retiring (%)"}}, - {"LIGHTOPS", []string{"TMA_..Light_Operations(%)", "Pipeline Utilization - Retiring - Fastpath (%)"}}, - {"HEAVYOPS", []string{"TMA_..Heavy_Operations(%)", "Pipeline Utilization - Retiring - Microcode (%)"}}, + {"FRONTEND", []string{"TMA_Frontend_Bound", "Pipeline Utilization - Frontend Bound (%)"}}, + {"FETCHLATENCY", []string{"TMA_..Fetch_Latency", "Pipeline Utilization - Frontend Bound - Latency (%)"}}, + {"FETCHBANDWIDTH", []string{"TMA_..Fetch_Bandwidth", "Pipeline Utilization - Frontend Bound - Bandwidth (%)"}}, + {"BADSPECULATION", []string{"TMA_Bad_Speculation", "Pipeline Utilization - Bad Speculation (%)"}}, + {"BRANCHMISPREDICTS", []string{"TMA_..Branch_Mispredicts", "Pipeline Utilization - Bad Speculation - Mispredicts (%)"}}, + {"MACHINECLEARS", []string{"TMA_..Machine_Clears", "Pipeline Utilization - Bad Speculation - Pipeline Restarts (%)"}}, + {"BACKEND", []string{"TMA_Backend_Bound", "Pipeline Utilization - Backend Bound (%)"}}, + {"COREDATA", []string{"TMA_..Core_Bound", "Pipeline Utilization - Backend Bound - CPU (%)"}}, + {"MEMORY", []string{"TMA_..Memory_Bound", "Pipeline Utilization - Backend Bound - Memory (%)"}}, + {"RETIRING", []string{"TMA_Retiring", "Pipeline Utilization - Retiring (%)"}}, + {"LIGHTOPS", []string{"TMA_..Light_Operations", "Pipeline Utilization - Retiring - Fastpath (%)"}}, + {"HEAVYOPS", []string{"TMA_..Heavy_Operations", "Pipeline Utilization - Retiring - Microcode (%)"}}, } // replace the template variables with the mean value of the metric for _, tmpl := range templateReplace { @@ -380,25 +380,25 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata) (templateVals // these get the series data for the graphs templateReplace = []tmplReplace{ // TMAM Tab - {"TMAFRONTEND", []string{"TMA_Frontend_Bound(%)", "Pipeline Utilization - Frontend Bound (%)"}}, - {"TMABACKEND", []string{"TMA_Backend_Bound(%)", "Pipeline Utilization - Backend Bound (%)"}}, - {"TMARETIRING", []string{"TMA_Retiring(%)", "Pipeline Utilization - Retiring (%)"}}, - {"TMABADSPECULATION", []string{"TMA_Bad_Speculation(%)", "Pipeline Utilization - Bad Speculation (%)"}}, + {"TMAFRONTEND", []string{"TMA_Frontend_Bound", "Pipeline Utilization - Frontend Bound (%)"}}, + {"TMABACKEND", []string{"TMA_Backend_Bound", "Pipeline Utilization - Backend Bound (%)"}}, + {"TMARETIRING", []string{"TMA_Retiring", "Pipeline Utilization - Retiring (%)"}}, + {"TMABADSPECULATION", []string{"TMA_Bad_Speculation", "Pipeline Utilization - Bad Speculation (%)"}}, // CPU Tab - {"CPUUTIL", []string{"CPU utilization %", "CPU utilization %"}}, - {"CPIDATA", []string{"CPI", "CPI"}}, - {"CPUFREQ", []string{"CPU operating frequency (in GHz)", "CPU operating frequency (in GHz)"}}, + {"CPUUTIL", []string{"cpu_utilization", "CPU utilization %"}}, + {"CPIDATA", []string{"cpi", "CPI"}}, + {"CPUFREQ", []string{"cpu_operating_frequency", "CPU operating frequency (in GHz)"}}, // Memory Tab - {"L1DATA", []string{"L1D MPI (includes data+rfo w/ prefetches)", ""}}, - {"L2DATA", []string{"L2 MPI (includes code+data+rfo w/ prefetches)", ""}}, - {"LLCDATA", []string{"LLC data read MPI (demand+prefetch)", ""}}, - {"READDATA", []string{"memory bandwidth read (MB/sec)", "Read Memory Bandwidth (MB/sec)"}}, - {"WRITEDATA", []string{"memory bandwidth write (MB/sec)", "Write Memory Bandwidth (MB/sec)"}}, - {"TOTALDATA", []string{"memory bandwidth total (MB/sec)", "Total Memory Bandwidth (MB/sec)"}}, - {"REMOTENUMA", []string{"NUMA %_Reads addressed to remote DRAM", "Remote DRAM Reads %"}}, + {"L1DATA", []string{"l1d_mpi", ""}}, + {"L2DATA", []string{"l2_mpi", ""}}, + {"LLCDATA", []string{"llc_data_read_mpi_demand_plus_prefetch", ""}}, + {"READDATA", []string{"memory_bandwidth_read", "Read Memory Bandwidth (MB/sec)"}}, + {"WRITEDATA", []string{"memory_bandwidth_write", "Write Memory Bandwidth (MB/sec)"}}, + {"TOTALDATA", []string{"memory_bandwidth_total", "Total Memory Bandwidth (MB/sec)"}}, + {"REMOTENUMA", []string{"numa_reads_addressed_to_remote_dram", "Remote DRAM Reads %"}}, // Power Tab - {"PKGPOWER", []string{"package power (watts)", "package power (watts)"}}, - {"DRAMPOWER", []string{"DRAM power (watts)", ""}}, + {"PKGPOWER", []string{"package_power", "package power (watts)"}}, + {"DRAMPOWER", []string{"dram_power", ""}}, } // replace the template variables with the series data for tIdx, tmpl := range templateReplace { @@ -427,6 +427,7 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata) (templateVals templateVals["TIMESTAMPS"] = string(timeStampsBytes) } } + // All Metrics Tab var metricHTMLStats [][]string for _, name := range m.names { @@ -444,6 +445,17 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata) (templateVals } jsonMetrics := string(jsonMetricsBytes) templateVals["ALLMETRICS"] = jsonMetrics + // Add metric descriptions for tooltip info + metricDescriptionMap := make(map[string]string, len(metricDefinitions)) + for _, def := range metricDefinitions { + metricDescriptionMap[getMetricDisplayName(def)] = def.Description + } + var jsonMetricDescBytes []byte + if jsonMetricDescBytes, err = json.Marshal(metricDescriptionMap); err != nil { + return + } + templateVals["DESCRIPTION"] = string(jsonMetricDescBytes) + // Metadata tab jsonMetadata, err := metadata.JSON() if err != nil { @@ -456,6 +468,7 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata) (templateVals re = regexp.MustCompile(`,"SystemSummaryFields":\[\[.*?\]\]`) jsonMetadataPurged = re.ReplaceAll(jsonMetadataPurged, []byte("")) templateVals["METADATA"] = string(jsonMetadataPurged) + // system info tab jsonSystemInfo, err := json.Marshal(metadata.SystemSummaryFields) if err != nil { From a2beca8371fc78b46de15ac11e5d1509c7e76499 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Tue, 26 Aug 2025 08:43:21 -0700 Subject: [PATCH 2/5] temporary threshold value Signed-off-by: Harper, Jason M --- cmd/metrics/resources/base.html | 129 +++++++++++++++++++++----------- cmd/metrics/summary.go | 14 +++- 2 files changed, 97 insertions(+), 46 deletions(-) diff --git a/cmd/metrics/resources/base.html b/cmd/metrics/resources/base.html index d8fbad9..3aab059 100644 --- a/cmd/metrics/resources/base.html +++ b/cmd/metrics/resources/base.html @@ -152,9 +152,11 @@ function App() { const [systemTabs, setSystemTabs] = React.useState(0); const [openlink, setOpenlink] = React.useState(true); - const [maxdiff, set_maxdiff] = React.useState(0) - const [mindiff, set_mindiff] = React.useState(0) - + const [maxdiff, set_maxdiff] = React.useState(0); + const [mindiff, set_mindiff] = React.useState(0); + // Thresholds are provided at HTML generation time + const metric_thresholds = <<.METRIC_THRESHOLDS>>; + const handleChange = (event, newSystemTabs) => { setSystemTabs(newSystemTabs); }; @@ -390,7 +392,7 @@
  • - The Back-end is responsible for monitoring when uOp’s data + The Back-end is responsible for monitoring when uOp's data operands are available and executing the uOp in an available execution unit. @@ -631,10 +633,17 @@ value={systemTabs} index={4} > - - - TMA metrics are a hierarchy where each sub-metric contains more periods "..." to designate its depth in the tree - + @@ -649,46 +658,76 @@ - {current_metrics.map((row) => ( - - - - {description.hasOwnProperty(row[0]) && - help - } - {!description.hasOwnProperty(row[0]) && - help - } - - {row[0]} - - - {Number(row[1]).toFixed(4)} - - - {Number(row[2]).toFixed(4)} - - - {Number(row[3]).toFixed(4)} - - - {Number(row[4]).toFixed(4)} - - {row.hasOwnProperty("other") && - {Number(row["other"]).toFixed(4)} - } - {row.hasOwnProperty("other") && 0 ? "rgba(255,0,0," + (row.diff / maxdiff * .5) + ")" : "rgba(0,0,255," + (row.diff / mindiff * .5) + ")") }}> - {Math.round(Number(row["diff"]))}% - } - - ))} + {current_metrics.map((row) => { + // Check if this metric has a threshold defined + const hasThreshold = metric_thresholds && metric_thresholds.hasOwnProperty(row[0]); + const exceedsThreshold = hasThreshold && Number(row[1]) > metric_thresholds[row[0]]; + + return ( + + + + {description.hasOwnProperty(row[0]) && + info + } + {!description.hasOwnProperty(row[0]) && + info + } + + {row[0]} + + + {Number(row[1]).toFixed(4)} + {exceedsThreshold && + + + warning + + + } + + + {Number(row[2]).toFixed(4)} + + + {Number(row[3]).toFixed(4)} + + + {Number(row[4]).toFixed(4)} + + {row.hasOwnProperty("other") && + {Number(row["other"]).toFixed(4)} + } + {row.hasOwnProperty("other") && 0 ? "rgba(255,0,0," + (row.diff / maxdiff * .5) + ")" : "rgba(0,0,255," + (row.diff / mindiff * .5) + ")") }}> + {Math.round(Number(row["diff"]))}% + } + + ); + })}
    + + TMA metrics are a hierarchy where each sub-metric contains more periods "..." to designate its depth in the tree + + + Metrics with values exceeding their specific thresholds are highlighted in yellow. Thresholds are defined based on typical performance characteristics for each metric. + Date: Tue, 26 Aug 2025 14:59:13 -0700 Subject: [PATCH 3/5] tma metric thresholds Signed-off-by: Harper, Jason M --- cmd/metrics/loader.go | 19 ++++--- cmd/metrics/loader_perfmon.go | 37 ++++++++++--- cmd/metrics/loader_util.go | 67 +++++++++++++++++++++--- cmd/metrics/resources/base.html | 12 ++--- cmd/metrics/summary.go | 93 +++++++++++++++++++++++++++------ 5 files changed, 183 insertions(+), 45 deletions(-) diff --git a/cmd/metrics/loader.go b/cmd/metrics/loader.go index 0e6d0d8..c4f209e 100644 --- a/cmd/metrics/loader.go +++ b/cmd/metrics/loader.go @@ -13,12 +13,13 @@ import ( // MetricDefinition is the common (across loader implementations) representation of a single metric type MetricDefinition struct { - Name string - LegacyName string - Expression string - Description string - Category string - Level int + Name string + LegacyName string + Expression string + Description string + Category string + Level int + ThresholdExpression string // Evaluation fields - used during metric expression evaluation // // Variables - map of variable names found in Expression to the indices of the event @@ -29,6 +30,12 @@ type MetricDefinition struct { // definitions are loaded and parsed, so that the expression does not need to be // parsed each time the metric is evaluated. Evaluable *govaluate.EvaluableExpression + // ThresholdVariables - list of variable names found in ThresholdExpression. + ThresholdVariables []string + // ThresholdEvaluable - parsed threshold expression from govaluate. These are set once when the metric + // definitions are loaded and parsed, so that the expression does not need to be + // parsed each time the metric is evaluated. + ThresholdEvaluable *govaluate.EvaluableExpression } // EventDefinition is the common (across loader implementations) representation of a single perf event diff --git a/cmd/metrics/loader_perfmon.go b/cmd/metrics/loader_perfmon.go index ac46bb4..543675b 100644 --- a/cmd/metrics/loader_perfmon.go +++ b/cmd/metrics/loader_perfmon.go @@ -331,6 +331,25 @@ func getExpression(perfmonMetric PerfmonMetric) (string, error) { return expression, nil } +func getThresholdExpression(perfmonMetric PerfmonMetric) (string, error) { + if perfmonMetric.Threshold == nil { + return "", nil // no threshold defined + } + expression := perfmonMetric.Threshold.Formula + if expression == "" { + return "", nil // no threshold defined + } + replacers := make(map[string]string) + for _, thresholdMetric := range perfmonMetric.Threshold.ThresholdMetrics { + replacers[thresholdMetric["Alias"]] = fmt.Sprintf("[%s]", thresholdMetric["Value"]) + } + for alias, replacement := range replacers { + // Replace alias as whole words only (not substrings) + expression = util.ReplaceWholeWord(expression, alias, replacement) + } + return expression, nil +} + func perfmonToMetricDefs(perfmonMetrics []PerfmonMetric) ([]MetricDefinition, error) { var metrics []MetricDefinition for _, perfmonMetric := range perfmonMetrics { @@ -340,14 +359,20 @@ func perfmonToMetricDefs(perfmonMetrics []PerfmonMetric) ([]MetricDefinition, er slog.Warn("Failed getting expression for metric", "metric", perfmonMetric.MetricName, "error", err) continue } + thresholdExpression, err := getThresholdExpression(perfmonMetric) + if err != nil { + slog.Warn("Failed getting threshold expression for metric", "metric", perfmonMetric.MetricName, "error", err) + continue + } // create a MetricDefinition from the perfmon metric metric := MetricDefinition{ - Name: perfmonMetric.MetricName, - LegacyName: perfmonMetric.LegacyName, - Description: perfmonMetric.BriefDescription, - Category: perfmonMetric.Category, - Level: perfmonMetric.Level, - Expression: expression, + Name: perfmonMetric.MetricName, + LegacyName: perfmonMetric.LegacyName, + Description: perfmonMetric.BriefDescription, + Category: perfmonMetric.Category, + Level: perfmonMetric.Level, + Expression: expression, + ThresholdExpression: thresholdExpression, } // add the metric to the list of metrics metrics = append(metrics, metric) diff --git a/cmd/metrics/loader_util.go b/cmd/metrics/loader_util.go index 257411e..f75eebd 100644 --- a/cmd/metrics/loader_util.go +++ b/cmd/metrics/loader_util.go @@ -6,6 +6,7 @@ package metrics import ( "fmt" "log/slog" + "perfspect/internal/util" "regexp" "strings" @@ -54,6 +55,12 @@ func configureMetrics(metrics []MetricDefinition, uncollectableEvents []string, return nil, fmt.Errorf("failed to initialize metric variables: %w", err) } + // initialize threshold variables + metrics, err = initializeThresholdVariables(metrics) + if err != nil { + return nil, fmt.Errorf("failed to initialize threshold variables: %w", err) + } + // remove "metric_" prefix from metric names metrics, err = removeMetricsPrefix(metrics) if err != nil { @@ -200,23 +207,37 @@ func removeIfUncollectableEvents(metrics []MetricDefinition, uncollectableEvents return filteredMetrics, nil } +func transformExpression(expression string) (string, error) { + // transform if/else to ?/: + transformed, err := perfmonToPerfspectConditional(expression) + if err != nil { + return "", fmt.Errorf("failed to transform metric expression: %w", err) + } + // replace "> =" with ">=" and "< =" with "<=" + transformed = strings.ReplaceAll(transformed, "> =", ">=") + transformed = strings.ReplaceAll(transformed, "< =", "<=") + // replace "&" with "&&" and "|" with "||" + transformed = strings.ReplaceAll(transformed, " & ", " && ") + transformed = strings.ReplaceAll(transformed, " | ", " || ") + return transformed, nil +} + // transformMetricExpressions transforms metric expressions from perfmon format to perfspect format // it replaces if/else with ternary conditional, replaces "> =" with ">=", and "< =" with "<=" func transformMetricExpressions(metrics []MetricDefinition) ([]MetricDefinition, error) { - // transform if/else to ?/: var transformedMetrics []MetricDefinition for i := range metrics { metric := &metrics[i] - transformed, err := perfmonToPerfspectConditional(metric.Expression) + var err error + metric.Expression, err = transformExpression(metric.Expression) if err != nil { return nil, fmt.Errorf("failed to transform metric expression: %w", err) } - // replace "> =" with ">=" and "< =" with "<=" - transformed = strings.ReplaceAll(transformed, "> =", ">=") - transformed = strings.ReplaceAll(transformed, "< =", "<=") - if transformed != metric.Expression { - slog.Debug("transformed metric", slog.String("name", metric.Name), slog.String("transformed", transformed)) - metric.Expression = transformed + if metric.ThresholdExpression != "" { + metric.ThresholdExpression, err = transformExpression(metric.ThresholdExpression) + if err != nil { + return nil, fmt.Errorf("failed to transform threshold expression: %w", err) + } } // add the transformed metric to the list transformedMetrics = append(transformedMetrics, *metric) @@ -235,6 +256,12 @@ func setEvaluableExpressions(metrics []MetricDefinition) ([]MetricDefinition, er slog.Error("failed to create evaluable expression for metric", slog.String("error", err.Error()), slog.String("name", metric.Name), slog.String("expression", metric.Expression)) return nil, err } + if metric.ThresholdExpression != "" { + if metric.ThresholdEvaluable, err = govaluate.NewEvaluableExpressionWithFunctions(metric.ThresholdExpression, evaluatorFunctions); err != nil { + slog.Error("failed to create threshold evaluable expression for metric", slog.String("error", err.Error()), slog.String("name", metric.Name), slog.String("threshold_expression", metric.ThresholdExpression)) + return nil, err + } + } } return metrics, nil } @@ -287,6 +314,30 @@ func initializeMetricVariables(metrics []MetricDefinition) ([]MetricDefinition, return metrics, nil } +func initializeThresholdVariables(metrics []MetricDefinition) ([]MetricDefinition, error) { + // get a list of the variables in the threshold expression + for i := range metrics { + metric := &metrics[i] + metric.ThresholdVariables = []string{} + expressionIdx := 0 + for { + startVar := strings.IndexRune(metric.ThresholdExpression[expressionIdx:], '[') + if startVar == -1 { // no more vars in this expression + break + } + endVar := strings.IndexRune(metric.ThresholdExpression[expressionIdx:], ']') + if endVar == -1 { + return nil, fmt.Errorf("didn't find end of variable indicator (]) in threshold expression: %s", metric.ThresholdExpression[expressionIdx:]) + } + // add the variable name to the list if it is not already present + varName := metric.ThresholdExpression[expressionIdx:][startVar+1 : endVar] + metric.ThresholdVariables = util.UniqueAppend(metric.ThresholdVariables, varName) + expressionIdx += endVar + 1 + } + } + return metrics, nil +} + // removeMetricsPrefix removes the "metric_" prefix from metric names // this is done to make the names more readable and consistent with other metrics // it is assumed that all metric names start with "metric_" diff --git a/cmd/metrics/resources/base.html b/cmd/metrics/resources/base.html index 3aab059..447040b 100644 --- a/cmd/metrics/resources/base.html +++ b/cmd/metrics/resources/base.html @@ -154,8 +154,6 @@ const [openlink, setOpenlink] = React.useState(true); const [maxdiff, set_maxdiff] = React.useState(0); const [mindiff, set_mindiff] = React.useState(0); - // Thresholds are provided at HTML generation time - const metric_thresholds = <<.METRIC_THRESHOLDS>>; const handleChange = (event, newSystemTabs) => { setSystemTabs(newSystemTabs); @@ -659,10 +657,8 @@ {current_metrics.map((row) => { - // Check if this metric has a threshold defined - const hasThreshold = metric_thresholds && metric_thresholds.hasOwnProperty(row[0]); - const exceedsThreshold = hasThreshold && Number(row[1]) > metric_thresholds[row[0]]; - + // Check if this metric has exceed its threshold + const exceedsThreshold = row[5] == "Yes"; return ( {Number(row[1]).toFixed(4)} {exceedsThreshold && - + warning @@ -723,7 +719,7 @@ - TMA metrics are a hierarchy where each sub-metric contains more periods "..." to designate its depth in the tree + TMA metrics are a hierarchy. More dots in the metric name indicate a deeper level in the hierarchy. For example, "TMA_..Memory_Bound" is a child of "TMA_Backend_Bound". Levels can be inferred by counting pairs of dots in the metric name. Metrics with values exceeding their specific thresholds are highlighted in yellow. Thresholds are defined based on typical performance characteristics for each metric. diff --git a/cmd/metrics/summary.go b/cmd/metrics/summary.go index aebb38d..190cca8 100644 --- a/cmd/metrics/summary.go +++ b/cmd/metrics/summary.go @@ -431,13 +431,17 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata, metricDefinit // All Metrics Tab var metricHTMLStats [][]string for _, name := range m.names { - metricHTMLStats = append(metricHTMLStats, []string{ - name, - fmt.Sprintf("%f", stats[name].mean), - fmt.Sprintf("%f", stats[name].min), - fmt.Sprintf("%f", stats[name].max), - fmt.Sprintf("%f", stats[name].stddev), - }) + metricVals := []string{ + name, // column 0 + fmt.Sprintf("%f", stats[name].mean), // column 1 + fmt.Sprintf("%f", stats[name].min), // column 2 + fmt.Sprintf("%f", stats[name].max), // column 3 + fmt.Sprintf("%f", stats[name].stddev), // column 4 + } + exceeded, thresholdDescription := getThresholdInfo(name, stats, metricDefinitions) + metricVals = append(metricVals, exceeded) // column 5 - "Yes" if threshold exceeded, else "No" + metricVals = append(metricVals, thresholdDescription) // column 6 - description of threshold, e.g., a>b>c>5 + metricHTMLStats = append(metricHTMLStats, metricVals) } var jsonMetricsBytes []byte if jsonMetricsBytes, err = json.Marshal(metricHTMLStats); err != nil { @@ -457,16 +461,6 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata, metricDefinit return } templateVals["DESCRIPTION"] = string(jsonMetricDescBytes) - // Add metric thresholds - metricThresholdMap := make(map[string]string, len(metricDefinitions)) - for _, def := range metricDefinitions { - metricThresholdMap[getMetricDisplayName(def)] = "1.0" - } - var jsonMetricThesholdBytes []byte - if jsonMetricThesholdBytes, err = json.Marshal(metricThresholdMap); err != nil { - return - } - templateVals["METRIC_THRESHOLDS"] = string(jsonMetricThesholdBytes) // Metadata tab jsonMetadata, err := metadata.JSON() @@ -490,6 +484,71 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata, metricDefinit return } +func getThresholdInfo(metricName string, stats map[string]metricStats, metricDefinitions []MetricDefinition) (exceeded string, thresholdDescription string) { + // find the metric definition by name + var def *MetricDefinition + for i, d := range metricDefinitions { + if getMetricDisplayName(d) == metricName { + def = &metricDefinitions[i] + break + } + } + if def == nil || def.ThresholdExpression == "" { + return "No", "" + } + variables := make(map[string]any) // map of variable names to values + // threshold variable names are legacy metric names, so find the corresponding metric definitions + for _, v := range def.ThresholdVariables { + var vDef *MetricDefinition + for i, d := range metricDefinitions { + if d.LegacyName == v { + vDef = &metricDefinitions[i] + break + } + } + if vDef != nil { + if stat, ok := stats[getMetricDisplayName(*vDef)]; ok { + variables[v] = stat.mean + } else { + variables[v] = 0.0 + } + } else { + variables[v] = 0.0 + } + } + // evaluate the threshold expression + result, err := evaluateThresholdExpression(*def, variables) + if err != nil { + slog.Warn("failed to evaluate threshold expression", slog.String("metric", metricName), slog.String("expression", def.ThresholdExpression), slog.String("error", err.Error())) + return "No", "" + } + boolResult, ok := result.(bool) + if !ok { + slog.Warn("threshold expression did not evaluate to a boolean", slog.String("metric", metricName), slog.String("expression", def.ThresholdExpression)) + return "No", "" + } + if boolResult { + exceeded = "Yes" + } else { + exceeded = "No" + } + thresholdDescription = def.ThresholdExpression + return +} + +// function to call evaluator so that we can catch panics that come from the evaluator +func evaluateThresholdExpression(metric MetricDefinition, variables map[string]any) (result any, err error) { + defer func() { + if errx := recover(); errx != nil { + err = errx.(error) + } + }() + if result, err = metric.ThresholdEvaluable.Evaluate(variables); err != nil { + err = fmt.Errorf("%v : %s : %s", err, metric.Name, metric.ThresholdExpression) + } + return +} + // getCSV - generate CSV string representing the summary statistics of the metrics func (m *metricsFromCSV) getCSV(includeFieldNames bool) (out string, err error) { var stats map[string]metricStats From c8c7939a44b46b4e35739a26953fbd4b32d6988e Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Tue, 26 Aug 2025 15:14:19 -0700 Subject: [PATCH 4/5] style the tooltips Signed-off-by: Harper, Jason M --- cmd/metrics/resources/base.html | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/cmd/metrics/resources/base.html b/cmd/metrics/resources/base.html index 447040b..21370f2 100644 --- a/cmd/metrics/resources/base.html +++ b/cmd/metrics/resources/base.html @@ -670,7 +670,21 @@ }} > - + {description.hasOwnProperty(row[0]) && info } @@ -690,7 +704,20 @@ > {Number(row[1]).toFixed(4)} {exceedsThreshold && - + warning From e336b721c20605e64a1aab2d7ac50144261e7d3f Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Tue, 26 Aug 2025 20:33:16 -0700 Subject: [PATCH 5/5] indent on TMA child metrics Signed-off-by: Harper, Jason M --- cmd/metrics/resources/base.html | 54 ++++++++++++++++++--- cmd/metrics/summary.go | 85 +++++++++++++++++++-------------- 2 files changed, 97 insertions(+), 42 deletions(-) diff --git a/cmd/metrics/resources/base.html b/cmd/metrics/resources/base.html index 21370f2..8f29c25 100644 --- a/cmd/metrics/resources/base.html +++ b/cmd/metrics/resources/base.html @@ -692,7 +692,38 @@ info } - {row[0]} + {(() => { + // Calculate indendation from the metric level value in column 8 (index 7) + // The lowest level is 1 + const level = row[7] ? Number(row[7]) : 1; + const indentationLevel = level > 1 ? level - 1 : 0; + + // Create indentation based on hierarchy level + const indentation = indentationLevel > 0 ? + 0 ? '1px dotted #aaa' : 'none', + marginLeft: indentationLevel > 0 ? '4px' : '0', + }}> + {indentationLevel > 0 && + subdirectory_arrow_right + } + : null; + + return ( + + {indentation} + {row[0]} + + ); + })()} - - TMA metrics are a hierarchy. More dots in the metric name indicate a deeper level in the hierarchy. For example, "TMA_..Memory_Bound" is a child of "TMA_Backend_Bound". Levels can be inferred by counting pairs of dots in the metric name. - - - Metrics with values exceeding their specific thresholds are highlighted in yellow. Thresholds are defined based on typical performance characteristics for each metric. + + + Metrics with a mean value exceeding their threshold formula are highlighted in yellow, indicating potential performance issues or anomalies that may require further investigation. + b>c>5 + metricDef := findMetricDefinitionByName(name, metricDefinitions) + if metricDef != nil { + exceeded, thresholdDescription := getThresholdInfo(*metricDef, stats, metricDefinitions) + metricVals = append(metricVals, exceeded) // column 5 - "Yes" if threshold exceeded, else "No" + metricVals = append(metricVals, thresholdDescription) // column 6 - description of threshold, e.g., a>b>c>5 + metricVals = append(metricVals, fmt.Sprintf("%d", max(metricDef.Level, 1))) // column 7 - metric level (for TMA metrics) + } else { + // this shouldn't happen, but just in case + metricVals = append(metricVals, "No") // 5 + metricVals = append(metricVals, "") // 6 + metricVals = append(metricVals, "") // 7 + slog.Error("metric definition not found for metric", slog.String("metric", name)) + } metricHTMLStats = append(metricHTMLStats, metricVals) } var jsonMetricsBytes []byte @@ -484,69 +496,70 @@ func (m *metricsFromCSV) loadHTMLTemplateValues(metadata Metadata, metricDefinit return } -func getThresholdInfo(metricName string, stats map[string]metricStats, metricDefinitions []MetricDefinition) (exceeded string, thresholdDescription string) { - // find the metric definition by name - var def *MetricDefinition +func findMetricDefinitionByName(name string, metricDefinitions []MetricDefinition) *MetricDefinition { for i, d := range metricDefinitions { - if getMetricDisplayName(d) == metricName { - def = &metricDefinitions[i] - break + if getMetricDisplayName(d) == name { + return &metricDefinitions[i] } } - if def == nil || def.ThresholdExpression == "" { - return "No", "" + return nil +} + +func findMetricDefinitionByLegacyName(legacyName string, metricDefinitions []MetricDefinition) *MetricDefinition { + for i, d := range metricDefinitions { + if d.LegacyName == legacyName { + return &metricDefinitions[i] + } } + return nil +} + +func getThresholdInfo(metricDef MetricDefinition, stats map[string]metricStats, metricDefinitions []MetricDefinition) (string, string) { variables := make(map[string]any) // map of variable names to values // threshold variable names are legacy metric names, so find the corresponding metric definitions - for _, v := range def.ThresholdVariables { - var vDef *MetricDefinition - for i, d := range metricDefinitions { - if d.LegacyName == v { - vDef = &metricDefinitions[i] - break - } - } - if vDef != nil { - if stat, ok := stats[getMetricDisplayName(*vDef)]; ok { - variables[v] = stat.mean - } else { - variables[v] = 0.0 - } + for _, v := range metricDef.ThresholdVariables { + vDef := findMetricDefinitionByLegacyName(v, metricDefinitions) + if vDef == nil { + slog.Warn("threshold variable not found in metric definitions", slog.String("metric", metricDef.Name), slog.String("variable", v)) + return "No", "" + } + if stat, ok := stats[getMetricDisplayName(*vDef)]; ok { + variables[v] = stat.mean } else { - variables[v] = 0.0 + slog.Warn("threshold variable not found in stats", slog.String("metric", metricDef.Name), slog.String("variable", v)) + return "No", "" } } // evaluate the threshold expression - result, err := evaluateThresholdExpression(*def, variables) + result, err := evaluateThresholdExpression(metricDef.ThresholdEvaluable, variables) if err != nil { - slog.Warn("failed to evaluate threshold expression", slog.String("metric", metricName), slog.String("expression", def.ThresholdExpression), slog.String("error", err.Error())) + slog.Warn("failed to evaluate threshold expression", slog.String("metric", metricDef.Name), slog.String("expression", metricDef.ThresholdExpression), slog.String("error", err.Error())) return "No", "" } boolResult, ok := result.(bool) if !ok { - slog.Warn("threshold expression did not evaluate to a boolean", slog.String("metric", metricName), slog.String("expression", def.ThresholdExpression)) + slog.Warn("threshold expression did not evaluate to a boolean", slog.String("metric", metricDef.Name), slog.String("expression", metricDef.ThresholdExpression)) return "No", "" } + var exceeded string if boolResult { exceeded = "Yes" } else { exceeded = "No" } - thresholdDescription = def.ThresholdExpression - return + return exceeded, metricDef.ThresholdExpression } // function to call evaluator so that we can catch panics that come from the evaluator -func evaluateThresholdExpression(metric MetricDefinition, variables map[string]any) (result any, err error) { +func evaluateThresholdExpression(evaluable *govaluate.EvaluableExpression, variables map[string]any) (any, error) { + var err error defer func() { if errx := recover(); errx != nil { err = errx.(error) } }() - if result, err = metric.ThresholdEvaluable.Evaluate(variables); err != nil { - err = fmt.Errorf("%v : %s : %s", err, metric.Name, metric.ThresholdExpression) - } - return + result, err := evaluable.Evaluate(variables) + return result, err } // getCSV - generate CSV string representing the summary statistics of the metrics