From 6df6d152f071589c16f26e3462af3f48c36329ec Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 17 May 2017 17:45:58 +0100 Subject: [PATCH] Increase maximum wait time to find the target control port after launch * Sometimes a process can take a while to start, this change waits up to 1+2+4+8+16+32+64 = 127 ms which is still not that much. * Also log a message if we still can't find it, so it's clear what the problem was. --- renderdoc/os/posix/linux/linux_process.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/renderdoc/os/posix/linux/linux_process.cpp b/renderdoc/os/posix/linux/linux_process.cpp index 09d52243e..2bf44b6e8 100644 --- a/renderdoc/os/posix/linux/linux_process.cpp +++ b/renderdoc/os/posix/linux/linux_process.cpp @@ -28,7 +28,7 @@ extern char **environ; #define INITIAL_WAIT_TIME 1000 -#define MAX_WAIT_TIME 63000 +#define MAX_WAIT_TIME 64000 char **GetCurrentEnvironment() { @@ -45,7 +45,7 @@ int GetIdentPort(pid_t childPid) int totalWaitTime = 0; // try for a little while for the /proc entry to appear - while(totalWaitTime < MAX_WAIT_TIME) + while(totalWaitTime <= MAX_WAIT_TIME) { // back-off for each retry usleep(waitTime); @@ -84,6 +84,13 @@ int GetIdentPort(pid_t childPid) FileIO::fclose(f); } + if(ret == 0) + { + RDCWARN("Couldn't locate renderdoc target control listening port between %u and %u in %s", + (uint32_t)RenderDoc_FirstTargetControlPort, (uint32_t)RenderDoc_LastTargetControlPort, + procfile.c_str()); + } + return ret; }