From 79465334feedd464e494ad44d1affaf44e1024f2 Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:04:36 +0200 Subject: [PATCH] Savestates: Add basic statistics in log --- rpcs3/Emu/System.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 3130b6cefe..91a81291ac 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -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."); @@ -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; @@ -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) {