benfred / py-spy

Sampling profiler for Python programs
MIT License
12.16k stars 401 forks source link

sampling only in D state (uninterruptible sleep) #526

Open JohannesBuchner opened 1 year ago

JohannesBuchner commented 1 year ago

I would like to profile a python program that spends substantial time in D state (uninterruptible sleep), indicating costly disk IO operations. Would it be possible to run py-spy or modify it, so that it only records samples if it finds the application in this state?