Skip to content

Commit

Permalink
Check perf_event paranoid setting early and exit for values > 2
Browse files Browse the repository at this point in the history
  • Loading branch information
TomTheBear committed Aug 10, 2022
1 parent 31250e2 commit bea08ca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/applications/likwid-perfctr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,14 @@ markerFolder = "/tmp"
markerFile = string.format("%s/likwid_%d.txt", markerFolder, likwid.getpid())
cpuClock = 1
execpid = false
if config["daemonMode"] == -1 and likwid.perf_event_paranoid() > 0 then
execpid = true
local perf_paranoid = likwid.perf_event_paranoid()
if config["daemonMode"] == -1 then
if perf_paranoid > 2 then
print_stderr(string.format("Cannot use performance monitoring with perf_event_paranoid = %d", perf_paranoid))
os.exit(1)
elseif perf_paranoid > 0 then
execpid = true
end
end
perfflags = nil
perfpid = nil
Expand Down

0 comments on commit bea08ca

Please sign in to comment.