Skip to content

Commit

Permalink
Merge pull request #2639 from katarzyna-z/kk_perf_helpful_logs
Browse files Browse the repository at this point in the history
Add logs and simplify setup of raw perf events
  • Loading branch information
dashpole authored Aug 13, 2020
2 parents dfe2477 + 9906af8 commit 888dc21
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 888dc21

Please sign in to comment.