mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-29 03:00:54 +01:00
Syscalls: Fix telemetry with exit_group
Picked up on more games exiting with exit_group that I want to ensure their telemetry data gets saved. Implement support for this.
This commit is contained in:
1 parent
ee8092bdc8
commit
aea4a88e00
3 files changed
+15
-5
No files matched your search
@@ -1540,15 +1540,11 @@ namespace FEX::HLE {
|
||||
(Handler.DefaultBehaviour == DEFAULT_COREDUMP ||
|
||||
Handler.DefaultBehaviour == DEFAULT_TERM)) {
|
||||
|
||||
#ifndef FEX_DISABLE_TELEMETRY
|
||||
// In the case of signals that cause coredump or terminate, save telemetry early.
|
||||
// FEX is hard crashing at this point and won't hit regular shutdown routines.
|
||||
// Add the signal to the crash mask.
|
||||
CrashMask |= (1ULL << Signal);
|
||||
if (!ApplicationName.empty()) {
|
||||
FEXCore::Telemetry::Shutdown(ApplicationName);
|
||||
}
|
||||
#endif
|
||||
SaveTelemetry();
|
||||
|
||||
// Reassign back to DFL and crash
|
||||
signal(Signal, SIG_DFL);
|
||||
@@ -1564,6 +1560,14 @@ namespace FEX::HLE {
|
||||
}
|
||||
}
|
||||
|
||||
void SignalDelegator::SaveTelemetry() {
|
||||
#ifndef FEX_DISABLE_TELEMETRY
|
||||
if (!ApplicationName.empty()) {
|
||||
FEXCore::Telemetry::Shutdown(ApplicationName);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool SignalDelegator::InstallHostThunk(int Signal) {
|
||||
SignalHandler &SignalHandler = HostHandlers[Signal];
|
||||
// If the host thunk is already installed for this, just return
|
||||
|
||||
@@ -104,6 +104,8 @@ namespace FEX::HLE {
|
||||
void SignalThread(FEXCore::Core::InternalThreadState *Thread, FEXCore::Core::SignalEvent Event) override;
|
||||
|
||||
FEX_CONFIG_OPT(ParanoidTSO, PARANOIDTSO);
|
||||
|
||||
void SaveTelemetry();
|
||||
protected:
|
||||
// Called from the thunk handler to handle the signal
|
||||
void HandleGuestSignal(FEXCore::Core::InternalThreadState *Thread, int Signal, void *Info, void *UContext) override;
|
||||
|
||||
@@ -574,6 +574,10 @@ namespace FEX::HLE {
|
||||
|
||||
REGISTER_SYSCALL_IMPL_PASS_FLAGS(exit_group, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY | SyscallFlags::NORETURN,
|
||||
[](FEXCore::Core::CpuStateFrame *Frame, int status) -> uint64_t {
|
||||
|
||||
// Save telemetry if we're exiting.
|
||||
FEX::HLE::_SyscallHandler->GetSignalDelegator()->SaveTelemetry();
|
||||
|
||||
syscall(SYSCALL_DEF(exit_group), status);
|
||||
// This will never be reached
|
||||
std::terminate();
|
||||
|
||||
Reference in new issue
Block a user