From 8a89108a50044bb6de39c459a0e47671192d1852 Mon Sep 17 00:00:00 2001
From: Revix <30447649+revix-0@users.noreply.github.com>
Date: Wed, 27 Apr 2022 15:22:30 +0200
Subject: [PATCH] ui: Add CPU logging in log

---
 ui/xemu-hud.cc     | 6 +++---
 ui/xemu-os-utils.h | 1 +
 ui/xemu.c          | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ui/xemu-hud.cc b/ui/xemu-hud.cc
index 6e0322f13c..50eea79712 100644
--- a/ui/xemu-hud.cc
+++ b/ui/xemu-hud.cc
@@ -811,7 +811,7 @@ static const char *get_os_platform(void)
 #endif
 #endif
 
-static const char *get_cpu_info(void)
+const char *xemu_get_cpu_info(void)
 {
     const char *cpu_info = "";
 #ifdef CONFIG_CPUID_H
@@ -865,7 +865,7 @@ public:
             snprintf(platform_info_text, sizeof(platform_info_text),
                 "CPU:          %s\nOS Platform:  %s\nOS Version:   %s\nManufacturer: %s\n"
                 "GPU Model:    %s\nDriver:       %s\nShader:       %s",
-                 get_cpu_info(), get_os_platform(), xemu_get_os_info(), gl_vendor,
+                 xemu_get_cpu_info(), get_os_platform(), xemu_get_os_info(), gl_vendor,
                  gl_renderer, gl_version, gl_shader_version);
             // FIXME: Show BIOS/BootROM hash
 
@@ -1189,7 +1189,7 @@ public:
 
         report.os_platform = get_os_platform();
         report.os_version = xemu_get_os_info();
-        report.cpu = get_cpu_info();
+        report.cpu = xemu_get_cpu_info();
         dirty = true;
         is_xbe_identified = false;
         did_send = send_result = false;
diff --git a/ui/xemu-os-utils.h b/ui/xemu-os-utils.h
index 682270deb8..e95af1f31b 100644
--- a/ui/xemu-os-utils.h
+++ b/ui/xemu-os-utils.h
@@ -25,6 +25,7 @@ extern "C" {
 #endif
 
 const char *xemu_get_os_info(void);
+const char *xemu_get_cpu_info(void);
 void xemu_open_web_browser(const char *url);
 
 #ifdef __cplusplus
diff --git a/ui/xemu.c b/ui/xemu.c
index ab57b0342e..466115d772 100644
--- a/ui/xemu.c
+++ b/ui/xemu.c
@@ -903,6 +903,7 @@ static void sdl2_display_very_early_init(DisplayOptions *o)
         // by the SDL surface.
     }
 
+    fprintf(stderr, "CPU: %s\n", xemu_get_cpu_info());
     fprintf(stderr, "OS_Version: %s\n", xemu_get_os_info());
     fprintf(stderr, "GL_VENDOR: %s\n", glGetString(GL_VENDOR));
     fprintf(stderr, "GL_RENDERER: %s\n", glGetString(GL_RENDERER));