profiling sysrec, diskrec fixes: restructure while loop