Skip to content

Commit

Permalink
Add logs informing about incorrect configuration for perf events
Browse files Browse the repository at this point in the history
Simplify setup of raw perf events

Signed-off-by: Katarzyna Kujawa <[email protected]>
  • Loading branch information
katarzyna-z committed Aug 13, 2020
1 parent a6e4fcb commit 9906af8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions perf/uncore_libpfm.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,21 @@ func (c *uncoreCollector) setup(events PerfEvents, devicesPath string) error {
customEvent, ok := c.eventToCustomEvent[group[0]]
if ok {
if customEvent.Type != 0 {
pmus := obtainPMUs("uncore", readUncorePMUs)
err = c.setupRawNonGroupedUncore(customEvent, pmus)
} else {
pmus := obtainPMUs(pmuPrefix, readUncorePMUs)
err = c.setupRawNonGroupedUncore(customEvent, pmus)
pmuPrefix = uncorePMUPrefix
}

pmus := obtainPMUs(pmuPrefix, readUncorePMUs)
if len(pmus) == 0 {
klog.Warningf("Cannot obtain any PMU matching prefix, pmu_prefix: %s, eventName: %s", pmuPrefix, eventName)
continue
}
err = c.setupRawNonGroupedUncore(customEvent, pmus)
} else {
pmus := obtainPMUs(pmuPrefix, readUncorePMUs)
if len(pmus) == 0 {
klog.Warningf("Cannot obtain any PMU matching prefix, pmu_prefix: %s, eventName: %s", pmuPrefix, eventName)
continue
}
err = c.setupNonGroupedUncore(eventName, pmus)
}
if err != nil {
Expand Down

0 comments on commit 9906af8

Please sign in to comment.