added library to print system info to be able to debug user files better

This commit is contained in:
georgemoralis 2024-07-04 14:30:34 +03:00
parent fd39c50910
commit a91c049754
6 changed files with 26 additions and 1 deletions

3
.gitmodules vendored
View File

@ -58,3 +58,6 @@
[submodule "externals/tracy"] [submodule "externals/tracy"]
path = externals/tracy path = externals/tracy
url = https://github.com/shadps4-emu/tracy.git url = https://github.com/shadps4-emu/tracy.git
[submodule "externals/hwinfo"]
path = externals/hwinfo
url = https://github.com/shadps4-emu/ext-hwinfo.git

View File

@ -541,7 +541,7 @@ endif()
create_target_directory_groups(shadps4) create_target_directory_groups(shadps4)
target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient) target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient hwinfo::HWinfo)
target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::SPIRV glslang::glslang SDL3::SDL3) target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::SPIRV glslang::glslang SDL3::SDL3)
if (NOT ENABLE_QT_GUI) if (NOT ENABLE_QT_GUI)

View File

@ -140,3 +140,6 @@ option(TRACY_ON_DEMAND "" ON)
option(TRACY_NO_FRAME_IMAGE "" ON) option(TRACY_NO_FRAME_IMAGE "" ON)
option(TRACY_FIBERS "" ON) # For AmdGpu frontend profiling option(TRACY_FIBERS "" ON) # For AmdGpu frontend profiling
add_subdirectory(tracy) add_subdirectory(tracy)
# hwinfo
add_subdirectory(hwinfo)

1
externals/hwinfo vendored Submodule

@ -0,0 +1 @@
Subproject commit 81ea6332fd4839890b1904f9668865145450f8da

View File

@ -15,12 +15,14 @@
#include "common/logging/backend.h" #include "common/logging/backend.h"
#include "common/path_util.h" #include "common/path_util.h"
#include "common/singleton.h" #include "common/singleton.h"
#include "common/version.h"
#include "core/file_sys/fs.h" #include "core/file_sys/fs.h"
#include "core/libraries/kernel/thread_management.h" #include "core/libraries/kernel/thread_management.h"
#include "core/libraries/libs.h" #include "core/libraries/libs.h"
#include "core/linker.h" #include "core/linker.h"
#include "core/memory.h" #include "core/memory.h"
#include "emulator.h" #include "emulator.h"
#include "hwinfo/hwinfo.h"
Frontend::WindowSDL* g_window = nullptr; Frontend::WindowSDL* g_window = nullptr;
@ -40,6 +42,8 @@ Emulator::Emulator()
// Start logger. // Start logger.
Common::Log::Initialize(); Common::Log::Initialize();
Common::Log::Start(); Common::Log::Start();
LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::VERSION);
PrintSystemInfo();
} }
Emulator::~Emulator() { Emulator::~Emulator() {
@ -177,4 +181,17 @@ void Emulator::LoadSystemModules(const std::filesystem::path& file) {
} }
} }
void Emulator::PrintSystemInfo() {
auto cpus = hwinfo::getAllCPUs();
for (const auto& cpu : cpus) {
LOG_INFO(Loader, "CPU #{} {}", cpu.id(), cpu.modelName());
}
hwinfo::OS os;
LOG_INFO(Loader, "{}", os.name());
auto gpus = hwinfo::getAllGPUs();
for (auto& gpu : gpus) {
LOG_INFO(Loader, "GPU #{} {}", gpu.id(), gpu.name());
}
}
} // namespace Core } // namespace Core

View File

@ -29,6 +29,7 @@ public:
private: private:
void LoadSystemModules(const std::filesystem::path& file); void LoadSystemModules(const std::filesystem::path& file);
void PrintSystemInfo();
Core::MemoryManager* memory; Core::MemoryManager* memory;
Input::GameController* controller = Common::Singleton<Input::GameController>::Instance(); Input::GameController* controller = Common::Singleton<Input::GameController>::Instance();