Skip to content

Commit f5a5771

Browse files
committed
fix regression where power and c6 residency not reported
Signed-off-by: Harper, Jason M <[email protected]>
1 parent 879aa1d commit f5a5771

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/metrics/event_frame.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ func parseEvents(rawEvents [][]byte) ([]Event, error) {
137137
}
138138
// sometimes perf will prepend "cpu/" to the topdown event names, e.g., cpu/topdown-retiring/ to x86 events, and
139139
// sometimes perf will prepend armv8_pmuv*/ to the arm events, we clean them up here to match metric formulas
140+
// We don't want to change power/energy-pkg, power/energy-ram, cstate_core/c6-residency, cstate_pkg/c6-residency
141+
// because those are the actual event names used in the metric formulas
140142
eventNameParts := strings.SplitN(event.Event, "/", 3)
141-
if len(eventNameParts) == 3 {
143+
if len(eventNameParts) == 3 && eventNameParts[0] != "power" && eventNameParts[0] != "cstate_core" && eventNameParts[0] != "cstate_pkg" {
142144
event.Event = eventNameParts[1]
143145
}
144146
switch event.CounterValue {

0 commit comments

Comments
 (0)