Skip to content

Commit

Permalink
Merge pull request #2689 from Creatone/creatone/improve-perf-logs
Browse files Browse the repository at this point in the history
Increase the readability of perf event logs.
  • Loading branch information
bobbypage authored Nov 9, 2020
2 parents 98226b3 + a5a48f9 commit 4f902f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
perfCgroupPath := path.Join(fs2.UnifiedMountpoint, containerName)
cont.perfCollector, err = m.perfManager.GetCollector(perfCgroupPath)
if err != nil {
klog.V(4).Infof("perf_event metrics will not be available for container %s: %s", containerName, err)
klog.Errorf("Perf event metrics will not be available for container %q: %v", containerName, err)
}
} else {
devicesCgroupPath, err := handler.GetCgroupPath("devices")
Expand All @@ -950,7 +950,7 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
} else {
cont.perfCollector, err = m.perfManager.GetCollector(perfCgroupPath)
if err != nil {
klog.V(4).Infof("perf_event metrics will not be available for container %s: %s", containerName, err)
klog.Errorf("Perf event metrics will not be available for container %q: %v", containerName, err)
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions perf/uncore_libpfm.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ func NewUncoreCollector(cgroupPath string, events PerfEvents, cpuToSocket map[in

err := collector.setup(events, systemDevicesPath)
if err != nil {
formatedError := fmt.Errorf("unable to setup uncore perf event collector: %v", err)
klog.V(5).Infof("Perf uncore metrics will not be available: %s", formatedError)
klog.Errorf("Perf uncore metrics will not be available: unable to setup uncore perf event collector: %v", err)
return &stats.NoopCollector{}
}

Expand Down

0 comments on commit 4f902f1

Please sign in to comment.