cygwin: pinfo: do not wait for setting ppid on a transitional procinfo
This leads to excessive lag when stracing processes if the inferior process checks the process table. The reason is that ppid isn't set in the procinfo memory of the dynamically loading strace itself. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
ffcfbf4b66
commit
5ef0399ddd
|
@ -314,12 +314,17 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
|
||||||
/* Detect situation where a transitional memory block is being retrieved.
|
/* Detect situation where a transitional memory block is being retrieved.
|
||||||
If the block has been allocated with PINFO_REDIR_SIZE but not yet
|
If the block has been allocated with PINFO_REDIR_SIZE but not yet
|
||||||
updated with a PID_EXECED state then we'll retry. */
|
updated with a PID_EXECED state then we'll retry. */
|
||||||
if (!created && !(flag & PID_NEW))
|
if (!created && !(flag & PID_NEW) && !procinfo->ppid)
|
||||||
|
{
|
||||||
|
/* Fetching process info for /proc or ps? just ignore this one. */
|
||||||
|
if (flag & PID_NOREDIR)
|
||||||
|
break;
|
||||||
/* If not populated, wait 2 seconds for procinfo to become populated.
|
/* If not populated, wait 2 seconds for procinfo to become populated.
|
||||||
Would like to wait with finer granularity but that is not easily
|
Would like to wait with finer granularity but that is not easily
|
||||||
doable. */
|
doable. */
|
||||||
for (int i = 0; i < 200 && !procinfo->ppid; i++)
|
for (int i = 0; i < 200 && !procinfo->ppid; i++)
|
||||||
Sleep (10);
|
Sleep (10);
|
||||||
|
}
|
||||||
|
|
||||||
if (!created && createit && (procinfo->process_state & PID_REAPED))
|
if (!created && createit && (procinfo->process_state & PID_REAPED))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue