Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 2nd level TMA metrics to chart #165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions cmd/metrics/resources/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,33 @@
borderWidth: 2,
},
data: [
{
name: "Frontend",
value: Math.round(FRONTEND * 10) / 10,
children:[
{
name: "Fetch Bandwidth",
value: Math.round(FETCHBANDWIDTH * 10) / 10,
},
{
name: "Fetch Latency",
value: Math.round(FETCHLATENCY * 10) / 10,
},
]
},
{
name: "Bad Speculation",
value: Math.round(BADSPECULATION * 10) / 10,
},
{
name: "Retiring",
value: Math.round(RETIRING * 10) / 10,
},
{
name: "Frontend",
value: Math.round(FRONTEND * 10) / 10,
children: [
{
name: "Branch Mispredicts",
value: Math.round(BRANCHMISPREDICTS * 10) / 10,
},
{
name: "Machine Clears",
value: Math.round(MACHINECLEARS * 10) / 10,
},
]
},
{
name: "Backend",
Expand All @@ -476,6 +492,20 @@
},
],
},
{
name: "Retiring",
value: Math.round(RETIRING * 10) / 10,
children: [
{
name: "Light Operations",
value: Math.round(LIGHTOPS * 10) / 10,
},
{
name: "Heavy Operations",
value: Math.round(HEAVYOPS * 10) / 10,
},
]
},
],
radius: [20, "100%"],
label: {
Expand Down
17 changes: 15 additions & 2 deletions cmd/metrics/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,17 @@ func (m *metricsFromCSV) getHTML() (html string, err error) {
// TMA Tab
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(%)"}},
{"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 (%)"}},
{"BADSPECULATION", []string{"TMA_Bad_Speculation(%), Pipeline Utilization - Bad Speculation (%)"}},
{"RETIRING", []string{"TMA_Retiring(%)", "Pipeline Utilization - Retiring (%)"}},
{"LIGHTOPS", []string{"TMA_..Light_Operations(%)"}},
{"HEAVYOPS", []string{"TMA_..Heavy_Operations(%)"}},
}
haveTMA := false
if archIndex == 0 && !math.IsNaN(stats["TMA_Frontend_Bound(%)"].mean) {
Expand All @@ -280,7 +286,14 @@ func (m *metricsFromCSV) getHTML() (html string, err error) {
}
if haveTMA {
for _, tmpl := range templateReplace {
html = strings.Replace(html, tmpl.tmplVar, fmt.Sprintf("%f", stats[tmpl.metricNames[archIndex]].mean), -1)
// confirm that the metric name exists in the stats, otherwise set it to 0
var metricVal float64
if _, ok := stats[tmpl.metricNames[archIndex]]; ok {
metricVal = stats[tmpl.metricNames[archIndex]].mean
} else {
metricVal = 0
}
html = strings.Replace(html, tmpl.tmplVar, fmt.Sprintf("%f", metricVal), -1)
}
} else {
for _, tmpl := range templateReplace {
Expand Down
Loading