|
|
@ -13,6 +13,7 @@
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "common/hex_util.h"
|
|
|
|
#include "common/hex_util.h"
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
|
|
|
|
#include "common/settings.h"
|
|
|
|
#include "common/string_util.h"
|
|
|
|
#include "common/string_util.h"
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/file_sys/directory.h"
|
|
|
|
#include "core/file_sys/directory.h"
|
|
|
@ -785,6 +786,10 @@ FSP_SRV::FSP_SRV(Core::System& system_)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
// clang-format on
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Settings::values.enable_fs_access_log) {
|
|
|
|
|
|
|
|
access_log_mode = AccessLogMode::SdCard;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FSP_SRV::~FSP_SRV() = default;
|
|
|
|
FSP_SRV::~FSP_SRV() = default;
|
|
|
@ -1041,9 +1046,9 @@ void FSP_SRV::DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
|
|
void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
|
|
|
|
void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
log_mode = rp.PopEnum<LogMode>();
|
|
|
|
access_log_mode = rp.PopEnum<AccessLogMode>();
|
|
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_FS, "called, log_mode={:08X}", log_mode);
|
|
|
|
LOG_DEBUG(Service_FS, "called, access_log_mode={}", access_log_mode);
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
@ -1054,7 +1059,7 @@ void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
rb.PushEnum(log_mode);
|
|
|
|
rb.PushEnum(access_log_mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) {
|
|
|
|
void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) {
|
|
|
@ -1062,9 +1067,9 @@ void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) {
|
|
|
|
auto log = Common::StringFromFixedZeroTerminatedBuffer(
|
|
|
|
auto log = Common::StringFromFixedZeroTerminatedBuffer(
|
|
|
|
reinterpret_cast<const char*>(raw.data()), raw.size());
|
|
|
|
reinterpret_cast<const char*>(raw.data()), raw.size());
|
|
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_FS, "called, log='{}'", log);
|
|
|
|
LOG_DEBUG(Service_FS, "called");
|
|
|
|
|
|
|
|
|
|
|
|
reporter.SaveFilesystemAccessReport(log_mode, std::move(log));
|
|
|
|
reporter.SaveFSAccessLog(log);
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|