Skip to content

Commit

Permalink
Savestates: Add basic statistics in log
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Nov 28, 2023
1 parent a102e61 commit b98d005
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rpcs3/Emu/System.cpp
Expand Up @@ -2932,6 +2932,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s

// Save it first for maximum timing accuracy
const u64 timestamp = get_timebased_time();
const u64 start_time = get_system_time();

sys_log.notice("All threads have been stopped.");

Expand Down Expand Up @@ -3128,7 +3129,9 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s
ar.seek_end();
ar.m_file_handler->finalize(ar);

if (!file.commit())
fs::stat_t file_stat{};

if (!file.commit() || !fs::get_stat(path, file_stat))
{
sys_log.error("Failed to write savestate to file! (path='%s', %s)", path, fs::g_tls_error);
savestate = false;
Expand All @@ -3152,7 +3155,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s
sys_log.success("Old savestate has been removed: path='%s'", old_path2);
}

sys_log.success("Saved savestate! path='%s'", path);
sys_log.success("Saved savestate! path='%s' (file_size=0x%x, time_to_save=%gs)", path, file_stat.size, (get_system_time() - start_time) / 1000000.);

if (!g_cfg.savestate.suspend_emu)
{
Expand Down

0 comments on commit b98d005

Please sign in to comment.