* Move sponsor process check inside store and use asio tasks to check, instead of launching separate thread on Linux/Mac. There was some strange interaction between standalone pthreads and asio.
* How checking is done is now platform independent, but some platform specific code is needed to trigger exit events.
#jira UE-204157
#rb ionut.matasaru
[CL 31126135 by johan berg in ue5-main branch]
* The sig_timedwait function was used to listen for signals and regularly check sponsor processes. However this function is not available on MacOS. Changed the daemon function to use the old signal listening method but add a worker thread that checks the sponsors at regular intervals instead. Send SIGUSR2 when exit is desired.
* Moved log output from Lifetime to Main to avoid spamming when sponsored mode is disabled. Note that we still need to call ShouldKeepAlive in that mode in order to poll the sponsored pid queue in instance info.
* During development there were cases where the shared memory remained despite the instance dissapearing. Added check if the reported pid is actually still alive. There are false positives here if pid was reused.
* On MacOS it's only possible to resize shared memory once. Added code to verify it's only called once.
[CL 30841356 by johan berg in ue5-main branch]
In extreme cases (for example user starting server + multiple local clients) all tracing at the exact time the number of command slots might be too small. Bump the number of sponsor command slots to 128 and add a retry in the process that adds commands.
#rb ionut.matasaru
[CL 30287932 by johan berg in ue5-main branch]
Adds new sponsor mode of running server. In this mode the server must be started with a parent pid. New pids can be added by running `unrealtraceserver fork --sponsor [pid]`. When all sponsor processes have exited and there are no active connections the server will exit. Most of the lifetime management logic is located in the new Lifetime type, but actual querying and exiting is done in the respective main functions.
Linux and Mac implementation was using a lock file to communicate running pid and version to other instances. With this change all platforms now use shared memory mapping techniques.
Command line options and command parsing has also been refactored and is now parsed and passed to all main functions. Command line help is also added.
#rb ionut.matasaru
[CL 30176867 by johan berg in ue5-main branch]
Prepare for future work by breaking out logging and instance info into separate files.
#rb ionut.matasaru
[CL 29987825 by johan berg in ue5-main branch]
Whenever settings would change we deleted the directory watches for all mounts. On Mac each watcher had a dispatch queue with running jobs. When the those lingering jobs would get callbacks, it would try to access the existing mount instance which would have been deleted.
#rb none
#jira UE-187849
[CL 27992508 by johan berg in ue5-main branch]
UTS was relying on standard library file times to get a common epoch based timestamp. However for Linux this does not seem to produce reliable results, so we fall back to the posix interface functions.
#rb martin.ridgers
#jira UE-191462
[CL 27784647 by johan berg in ue5-main branch]
On Windows keepalive options were set on the recording socket, in order to detect if a tracing process suddenly closes it's connection (it's killed or crashes). These options were missing from Mac and Linux configurations.
#rb martin.ridgers
#jira UE-188178
[CL 26343479 by johan berg in ue5-main branch]
* Parse Session guid and trace guid from metadata if available for live sessions
* Add api to fetch a session based on above guid.
#rb none
#preflight none
[CL 25505216 by Johan Berg in ue5-main branch]