How to ensure the consistency on the result of process_vm_readv #154
Replies: 1 comment 6 replies
-
Indeed this is a very real possibility, but I think there isn't much we can do about it to completely solve the problem. I don't think pausing would yield any substantial improvements here because there is no guarantee that we would halt a thread at a time when everything is consistent. Evidence seems to suggest that the data collected by Austin is sensible, despite this wild race condition. Besides, Austin tries to detect inconsistent stacks and report them. You would notice higher error rates if you are profiling very quick Python functions, but real-world applications generally have a mix of fast and slow functions. Recent versions of Austin have added a heap parameter that can be used to tell Austin to allocate a chunk of memory that is used to read as many frames as possible with a single system call to attempt to reduce the error rate. |
Beta Was this translation helpful? Give feedback.
-
Hi,
It looks like this tool leverages
process_vm_readv
system call to get the running state of Python interpreter. I'm not sure whether the state we get is consistent.While interpreter is running,
PyInterpreterState
is changing frome time to time. How to keep the state unchanged during the process ofprocess_vm_readv
without any program interrupt? I think it's possible thatprocess_vm_readv
is invoked in the middle ofPyInterpreterState
changing, which means the data we get is a mixture of old state and new state.Beta Was this translation helpful? Give feedback.
All reactions