Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
fix bug reading perf mux interval
Browse files Browse the repository at this point in the history
  • Loading branch information
harp-intel committed Feb 1, 2024
1 parent ca19eaa commit 5c361e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/pmu2metrics/perf_mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
)

// GetMuxIntervals - get a map of sysfs device file names to current mux value for the associated device
Expand All @@ -28,7 +29,7 @@ func GetMuxIntervals() (intervals map[string]int, err error) {
continue
}
var interval int
if interval, err = strconv.Atoi(string(contents)); err != nil {
if interval, err = strconv.Atoi(strings.TrimSpace(string(contents))); err != nil {
return
}
intervals[path] = interval
Expand Down

0 comments on commit 5c361e3

Please sign in to comment.