DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.57k stars 550 forks source link

i#6822 unscheduled: Add unscheduled-input drmemtrace support #6826

Closed derekbruening closed 1 month ago

derekbruening commented 1 month ago

Augments the drmemtrace scheduler with a new notion of an "unscheduled" input which, if it has no timeout, is not runnable indefinitely until another input explicitly wakes it up.

Adds 3 new markers:

Adds handling for the new marker types.

Changes TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH to make the source input unscheduled, unless a timeout is passed which is honored (previously it was ignored and the syscall latency was used as the block time if it was over the thresholds).

Adds a fallback in case a state is reached with no schedulable inputs yet some number of unscheduled inputs who would otherwise hang forever.

Adds unit tests.

Also tested on a large trace with many real-world cases of these direct switches and unschedulable threads.

Issue: #6822

abhinav92003 commented 1 month ago

I started the review but I feel I need to spend more time with this PR. This review will be a bit delayed. Sorry about that.