Flow ยท Diagram Design
The Windows engine: one run, eight steps
One Windows recording
Eight boxes in two rows. Top row: take the lock, start the program, choose the frame source (PresentMon if installed, otherwise a DWM thread), then the one-second loop. Bottom row: stop and clean up, choose the frames from the first source that has any (drawstress log, PresentMon, DWM samples, or an error), write the frames and summary, and recording.finish.
No Instruments, no .trace: the frames come from the first source that has any.
A failure at any step deletes the run's files and frees the lock.
Lock
Program
Frame source?
1 s loop
Stop and clean up
Which frames?
Write
recording.finish
make lock folder
write our pid
dead owner: retake
else: refuse
start with Popen
DRAWSTRESS_LOG set
attach: find pid
PresentMon found?
yes: run it
no: 1 ms DWM thread
sample RSS each s
stop on cancel,
deadline or exit
kill program tree
stop PresentMon
on cancel: delete
run files
drawstress-log,
presentmon,
dwm-composition,
none: error
frames.csv.gz
summary .json
KEEP_RUNS cleanup
add layer, context
tier, disk limit
decision
the choice that sets the numbers
step 8 is shared with macOS