diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-30 22:31:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-30 22:31:29 +0100 |
| commit | c6fc1cab99ff8a3d721ae0e5937512e8d6f58a71 (patch) | |
| tree | 9a362f9ba1984fc9ba554e4e13e50dee0e861192 /src/helpers/MiscFunctions.cpp | |
| parent | 450d8a0bf703f3ec460d367f38d61b5966daf8fe (diff) | |
helpers/systemInfo: extract info fns (#14222)
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
| -rw-r--r-- | src/helpers/MiscFunctions.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 5e37f19f..5aa58a2c 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -523,54 +523,6 @@ std::string execAndGet(const char* cmd) { return proc.stdOut(); } -void logSystemInfo() { - struct utsname unameInfo; - - uname(&unameInfo); - - Log::logger->log(Log::DEBUG, "System name: {}", std::string{unameInfo.sysname}); - Log::logger->log(Log::DEBUG, "Node name: {}", std::string{unameInfo.nodename}); - Log::logger->log(Log::DEBUG, "Release: {}", std::string{unameInfo.release}); - Log::logger->log(Log::DEBUG, "Version: {}", std::string{unameInfo.version}); - - Log::logger->log(Log::DEBUG, "\n"); - -#if defined(__DragonFly__) || defined(__FreeBSD__) - const std::string GPUINFO = execAndGet("pciconf -lv | grep -F -A4 vga"); -#elif defined(__arm__) || defined(__aarch64__) - std::string GPUINFO; - const std::filesystem::path dev_tree = "/proc/device-tree"; - try { - if (std::filesystem::exists(dev_tree) && std::filesystem::is_directory(dev_tree)) { - std::for_each(std::filesystem::directory_iterator(dev_tree), std::filesystem::directory_iterator{}, [&](const std::filesystem::directory_entry& entry) { - if (std::filesystem::is_directory(entry) && entry.path().filename().string().starts_with("soc")) { - std::for_each(std::filesystem::directory_iterator(entry.path()), std::filesystem::directory_iterator{}, [&](const std::filesystem::directory_entry& sub_entry) { - if (std::filesystem::is_directory(sub_entry) && sub_entry.path().filename().string().starts_with("gpu")) { - std::filesystem::path file_path = sub_entry.path() / "compatible"; - std::ifstream file(file_path); - if (file) - GPUINFO.append(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()); - } - }); - } - }); - } - } catch (...) { GPUINFO = "error"; } -#else - const std::string GPUINFO = execAndGet("lspci -vnn | grep -E '(VGA|Display|3D)'"); -#endif - Log::logger->log(Log::DEBUG, "GPU information:\n{}\n", GPUINFO); - - if (GPUINFO.contains("NVIDIA")) { - Log::logger->log(Log::WARN, "Warning: you're using an NVIDIA GPU. Make sure you follow the instructions on the wiki if anything is amiss.\n"); - } - - // log etc - Log::logger->log(Log::DEBUG, "os-release:"); - - Log::logger->log(Log::DEBUG, "{}", NFsUtils::readFileAsString("/etc/os-release").value_or("error")); -} - int64_t getPPIDof(int64_t pid) { #if defined(KERN_PROC_PID) int mib[] = { |
