1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-12-23 00:52:10 +00:00

gc_dumper: change info TXT layout.

This commit is contained in:
Pablo Curiel 2022-02-07 01:32:39 +01:00
parent 3999e48c43
commit f6d133d793
3 changed files with 10 additions and 12 deletions

View file

@ -59,6 +59,8 @@ ifneq ($(origin BUILD_TYPE),undefined)
APP_TITLE := ${BUILD_TYPE}
endif
BUILD_TIMESTAMP := $(strip $(shell date --utc '+%Y-%m-%d %T UTC'))
TARGET := ${APP_TITLE}
BUILD := build
SOURCES := source source/core source/fatfs
@ -81,7 +83,7 @@ CFLAGS := -g -gdwarf-4 -Wall -Werror -O2 -ffunction-sections $(ARCH) $(DEFINES)
CFLAGS += -DVERSION_MAJOR=${VERSION_MAJOR} -DVERSION_MINOR=${VERSION_MINOR} -DVERSION_MICRO=${VERSION_MICRO}
CFLAGS += -DAPP_TITLE=\"${APP_TITLE}\" -DAPP_AUTHOR=\"${APP_AUTHOR}\" -DAPP_VERSION=\"${APP_VERSION}\"
CFLAGS += -DGIT_BRANCH=\"${GIT_BRANCH}\" -DGIT_COMMIT=\"${GIT_COMMIT}\" -DGIT_REV=\"${GIT_REV}\"
CFLAGS += -DBOREALIS_RESOURCES="\"${BOREALIS_RESOURCES}\"" -D_GNU_SOURCE
CFLAGS += -DBUILD_TIMESTAMP="\"${BUILD_TIMESTAMP}\"" -DBOREALIS_RESOURCES="\"${BOREALIS_RESOURCES}\"" -D_GNU_SOURCE
CXXFLAGS := $(CFLAGS) -std=c++20 -Wno-volatile -Wno-unused-parameter

View file

@ -470,25 +470,21 @@ static void generateDumpTxt(void)
*txt_info = '\0';
struct tm ts = {0};
struct timespec now = {0};
/* Get current time with nanosecond precision. */
clock_gettime(CLOCK_REALTIME, &now);
time_t now = time(NULL);
/* Get UTC time. */
gmtime_r(&(now.tv_sec), &ts);
gmtime_r(&now, &ts);
ts.tm_year += 1900;
ts.tm_mon++;
/* Generate dump text. */
snprintf(txt_info, MAX_ELEMENTS(txt_info), "dump info:\r\n" \
"tool: nxdumptool\r\n" \
snprintf(txt_info, MAX_ELEMENTS(txt_info), "tool: nxdumptool\r\n" \
"version: " APP_VERSION "\r\n" \
"branch: " GIT_BRANCH "\r\n" \
"commit: " GIT_COMMIT "\r\n" \
"build date: " __DATE__ " - " __TIME__ "\r\n" \
"dump date: %d-%02d-%02d %02d:%02d:%02d.%03lu UTC+0\r\n",
ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour, ts.tm_min, ts.tm_sec, now.tv_nsec);
"build date: " BUILD_TIMESTAMP "\r\n" \
"dump date: %d-%02d-%02d %02d:%02d:%02d UTC\r\n", \
ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour, ts.tm_min, ts.tm_sec);
}
static bool saveFileData(const char *path, void *data, size_t data_size)

View file

@ -136,7 +136,7 @@ bool utilsInitializeResources(const int program_argc, const char **program_argv)
/* Create logfile. */
logWriteStringToLogFile("________________________________________________________________\r\n");
LOG_MSG(APP_TITLE " v" APP_VERSION " starting (" GIT_REV "). Built on " __DATE__ " - " __TIME__ ".");
LOG_MSG(APP_TITLE " v" APP_VERSION " starting (" GIT_REV "). Built on " BUILD_TIMESTAMP ".");
/* Log Horizon OS version. */
u32 hos_version = hosversionGet();