Skip to content

Commit

Permalink
SPU: Reduce some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Aug 17, 2024
1 parent 1bd4565 commit bd5fd66
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
27 changes: 24 additions & 3 deletions rpcs3/Emu/Cell/RawSPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,35 @@ void spu_load_exec(const spu_exec_object& elf)

const auto funcs = spu->discover_functions(0, { spu->ls , SPU_LS_SIZE }, true, umax);

for (u32 addr : funcs)
if (spu_log.notice && !funcs.empty())
{
spu_log.success("Found SPU function at: 0x%08x", addr);
std::string to_log;

for (usz i = 0; i < funcs.size(); i++)
{
if (i == 0 && funcs.size() < 4)
{
// Skip newline in this case
to_log += ' ';
}
else if (i % 4 == 0)
{
to_log += '\n';
}
else
{
to_log += ", ";
}

fmt::append(to_log, "0x%05x", funcs[i]);
}

spu_log.notice("Found SPU function(s) at:%s", to_log);
}

if (!funcs.empty())
{
spu_log.success("Found %u SPU functions", funcs.size());
spu_log.success("Found %u SPU function(s)", funcs.size());
}
}

Expand Down
27 changes: 24 additions & 3 deletions rpcs3/Emu/Cell/SPUCommonRecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,33 @@ extern void utilize_spu_data_segment(u32 vaddr, const void* ls_data_vaddr, u32 s
return;
}

for (u32 addr : obj.funcs)
if (spu_log.notice)
{
spu_log.notice("Found SPU function at: 0x%05x", addr);
std::string to_log;

for (usz i = 0; i < obj.funcs.size(); i++)
{
if (i == 0 && obj.funcs.size() < 4)
{
// Skip newline in this case
to_log += ' ';
}
else if (i % 4 == 0)
{
to_log += '\n';
}
else
{
to_log += ", ";
}

fmt::append(to_log, "0x%05x", obj.funcs[i]);
}

spu_log.notice("Found SPU function(s) at:%s", to_log);
}

spu_log.notice("Found %u SPU functions", obj.funcs.size());
spu_log.success("Found %u SPU function(s)", obj.funcs.size());

g_fxo->get<spu_cache>().precompile_funcs.push(std::move(obj));
}
Expand Down

0 comments on commit bd5fd66

Please sign in to comment.