mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-04 05:45:03 -06:00
Silence sys_memory_get_user_memory_size
This commit is contained in:
parent
9e573a9ff2
commit
234f2b4648
@ -15,6 +15,18 @@ LOG_CHANNEL(sys_memory);
|
|||||||
//
|
//
|
||||||
static shared_mutex s_memstats_mtx;
|
static shared_mutex s_memstats_mtx;
|
||||||
|
|
||||||
|
// This struct is for reduced logging repetition
|
||||||
|
struct last_reported_memory_stats
|
||||||
|
{
|
||||||
|
struct inner_body
|
||||||
|
{
|
||||||
|
u32 prev_total = umax;
|
||||||
|
u32 prev_avail = umax;
|
||||||
|
};
|
||||||
|
|
||||||
|
atomic_t<inner_body> body{};
|
||||||
|
};
|
||||||
|
|
||||||
lv2_memory_container::lv2_memory_container(u32 size, bool from_idm) noexcept
|
lv2_memory_container::lv2_memory_container(u32 size, bool from_idm) noexcept
|
||||||
: size(size)
|
: size(size)
|
||||||
, id{from_idm ? idm::last_id() : SYS_MEMORY_CONTAINER_ID_INVALID}
|
, id{from_idm ? idm::last_id() : SYS_MEMORY_CONTAINER_ID_INVALID}
|
||||||
@ -313,8 +325,6 @@ error_code sys_memory_get_user_memory_size(cpu_thread& cpu, vm::ptr<sys_memory_i
|
|||||||
{
|
{
|
||||||
cpu.state += cpu_flag::wait;
|
cpu.state += cpu_flag::wait;
|
||||||
|
|
||||||
sys_memory.warning("sys_memory_get_user_memory_size(mem_info=*0x%x)", mem_info);
|
|
||||||
|
|
||||||
// Get "default" memory container
|
// Get "default" memory container
|
||||||
auto& dct = g_fxo->get<lv2_memory_container>();
|
auto& dct = g_fxo->get<lv2_memory_container>();
|
||||||
|
|
||||||
@ -332,6 +342,22 @@ error_code sys_memory_get_user_memory_size(cpu_thread& cpu, vm::ptr<sys_memory_i
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typename last_reported_memory_stats::inner_body now;
|
||||||
|
now.prev_total = out.total_user_memory;
|
||||||
|
now.prev_avail = out.available_user_memory;
|
||||||
|
|
||||||
|
now = g_fxo->get<last_reported_memory_stats>().body.exchange(now);
|
||||||
|
|
||||||
|
if (now.prev_total != out.total_user_memory || now.prev_avail != out.available_user_memory)
|
||||||
|
{
|
||||||
|
// Log on change
|
||||||
|
sys_memory.warning("sys_memory_get_user_memory_size(mem_info=*0x%x): Avail=0x%x, Total=0x%x", mem_info, out.available_user_memory, out.total_user_memory);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sys_memory.trace("sys_memory_get_user_memory_size(mem_info=*0x%x): Avail=0x%x, Total=0x%x", mem_info, out.available_user_memory, out.total_user_memory);
|
||||||
|
}
|
||||||
|
|
||||||
cpu.check_state();
|
cpu.check_state();
|
||||||
*mem_info = out;
|
*mem_info = out;
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user