func sprintCounts(counts map[mcd.CommandCode]int) string { line := "" for i := 0; i < 256; i++ { opcode := mcd.CommandCode(i) if n, ok := counts[opcode]; ok { line += fmt.Sprintf("%s:%v ", mcd.CommandNames[opcode], n) } } return strings.TrimRight(line, " ") }
func addToMap(m map[string]uint64, i int, counters [257]platform.AlignedUint64) { v := platform.LoadUint64(&counters[i]) if v > 0 { k := "unknown" if i < 256 { k = transport.CommandCode(i).String() } m[k] = v m["total"] += v } }