From 3175f31e3cdb4503379d790954f017082eeb18b7 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 13 Sep 2024 02:01:09 +0200 Subject: [PATCH] likwid-perfctr: check executable status before sleeping --- src/applications/likwid-perfctr.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/applications/likwid-perfctr.lua b/src/applications/likwid-perfctr.lua index 2a8a089a..686799c4 100644 --- a/src/applications/likwid-perfctr.lua +++ b/src/applications/likwid-perfctr.lua @@ -1433,7 +1433,18 @@ if use_wrapper or use_timeline then end break end - local remain = likwid.sleep(math.floor(duration - (twork * 1E6))) + exitvalue, exited = likwid.checkProgram(pid) + if exited then + io.stdout:flush() + if #execList > 0 then + break + end + end + local sleeptime = duration - (twork * 1E6) + local remain = 0 + if sleeptime > 0 then + remain = likwid.sleep(math.floor(duration - (twork * 1E6))) + end exitvalue, exited = likwid.checkProgram(pid) if exited then