kern: optimize logging for release kernel strings (saves printf space in .text)

This commit is contained in:
Michael Scire 2021-09-17 16:44:57 -07:00 committed by SciresM
parent fdf008108c
commit 8b49cea4a9
4 changed files with 53 additions and 8 deletions

View file

@ -28,6 +28,8 @@ namespace ams::kern {
static NOINLINE void Printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
static NOINLINE void VPrintf(const char *format, ::std::va_list vl);
static NOINLINE void LogException(const char *str);
static NOINLINE Result PrintUserString(ams::kern::svc::KUserPointer<const char *> user_str, size_t len);
/* Functionality for preserving across sleep. */
@ -49,6 +51,8 @@ namespace ams::kern {
#endif
#define MESOSPHERE_EXCEPTION_LOG(str) ::ams::kern::KDebugLog::LogException(str)
#define MESOSPHERE_RELEASE_LOG(fmt, ...) ::ams::kern::KDebugLog::Printf((fmt), ## __VA_ARGS__)
#define MESOSPHERE_RELEASE_VLOG(fmt, vl) ::ams::kern::KDebugLog::VPrintf((fmt), (vl))