mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 11:26:56 +02:00
feat: identify build provenance in the crash log report (#196)
* feat: identify build provenance in the crash log report * cmake: reuse git version dependency target --------- Co-authored-by: nmzik <Nmzik@mail.ru>
This commit is contained in:
@@ -24,6 +24,7 @@ target_link_libraries(common
|
|||||||
Tracy::TracyClient
|
Tracy::TracyClient
|
||||||
PRIVATE
|
PRIVATE
|
||||||
cpuinfo
|
cpuinfo
|
||||||
|
kyty_git_version
|
||||||
spdlog::spdlog
|
spdlog::spdlog
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/subsystems.h"
|
#include "common/subsystems.h"
|
||||||
|
#include "kytyGitVersion.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -23,7 +24,7 @@ static std::string BuildFatalReport(const char* title, std::string_view text, co
|
|||||||
DebugStack stack;
|
DebugStack stack;
|
||||||
DebugStack::Trace(&stack);
|
DebugStack::Trace(&stack);
|
||||||
|
|
||||||
std::string report = "--- Stack Trace ---\n";
|
std::string report = "--- Build ---\n" KYTY_BUILD_LABEL "\n--- Stack Trace ---\n";
|
||||||
for (int i = PRINT_STACK_FROM; i < stack.depth; i++) {
|
for (int i = PRINT_STACK_FROM; i < stack.depth; i++) {
|
||||||
report += fmt::format("[{}] {:016x}\n", i - PRINT_STACK_FROM,
|
report += fmt::format("[{}] {:016x}\n", i - PRINT_STACK_FROM,
|
||||||
static_cast<uint64_t>(stack.GetAddr(i)));
|
static_cast<uint64_t>(stack.GetAddr(i)));
|
||||||
|
|||||||
@@ -938,13 +938,6 @@ void WindowContext::UpdateTitle() {
|
|||||||
static constexpr auto build_type = "Unknown";
|
static constexpr auto build_type = "Unknown";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(KYTY_OFFICIAL_BUILD)
|
|
||||||
static constexpr auto build_label = "Official build " KYTY_RELEASE_TAG;
|
|
||||||
#elif defined(KYTY_FORK_BUILD)
|
|
||||||
static constexpr auto build_label = "Fork build " KYTY_BUILD_REPOSITORY " " KYTY_GIT_HASH;
|
|
||||||
#else
|
|
||||||
static constexpr auto build_label = "Source build " KYTY_GIT_HASH;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const auto now = Common::Timer::QueryPerformanceCounter();
|
const auto now = Common::Timer::QueryPerformanceCounter();
|
||||||
const auto frequency = Common::Timer::QueryPerformanceFrequency();
|
const auto frequency = Common::Timer::QueryPerformanceFrequency();
|
||||||
@@ -957,7 +950,7 @@ void WindowContext::UpdateTitle() {
|
|||||||
fps_frames = 0;
|
fps_frames = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fps = fmt::format("[{} | {}] {}{}{}{}{}{}[{}] [{}], frame: {}, fps: {:f}", build_label,
|
auto fps = fmt::format("[{} | {}] {}{}{}{}{}{}[{}] [{}], frame: {}, fps: {:f}", KYTY_BUILD_LABEL,
|
||||||
build_type, (has_title ? title : ""), (has_title ? ", " : ""),
|
build_type, (has_title ? title : ""), (has_title ? ", " : ""),
|
||||||
(has_title_id ? title_id : ""), (has_title_id ? ", " : ""),
|
(has_title_id ? title_id : ""), (has_title_id ? ", " : ""),
|
||||||
(has_app_ver ? app_ver : ""), (has_app_ver ? " " : ""), device_name,
|
(has_app_ver ? app_ver : ""), (has_app_ver ? " " : ""), device_name,
|
||||||
|
|||||||
@@ -1,2 +1,13 @@
|
|||||||
|
#include "cmake_config.h"
|
||||||
|
|
||||||
#define KYTY_GIT_VERSION "@KYTY_GIT_VERSION@"
|
#define KYTY_GIT_VERSION "@KYTY_GIT_VERSION@"
|
||||||
#define KYTY_GIT_HASH "@KYTY_GIT_HASH@"
|
#define KYTY_GIT_HASH "@KYTY_GIT_HASH@"
|
||||||
|
|
||||||
|
/* Build provenance, shown in the window title and in crash reports. */
|
||||||
|
#if defined(KYTY_OFFICIAL_BUILD)
|
||||||
|
#define KYTY_BUILD_LABEL "Official build " KYTY_RELEASE_TAG
|
||||||
|
#elif defined(KYTY_FORK_BUILD)
|
||||||
|
#define KYTY_BUILD_LABEL "Fork build " KYTY_BUILD_REPOSITORY " " KYTY_GIT_HASH
|
||||||
|
#else
|
||||||
|
#define KYTY_BUILD_LABEL "Source build " KYTY_GIT_HASH
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user