From f4a889a14c20d8b2b71d4154c0ba7d31acb5f6a0 Mon Sep 17 00:00:00 2001 From: Takoroka <137927095+Takoroka@users.noreply.github.com> Date: Tue, 27 Oct 2026 12:52:40 -0400 Subject: kernel: optional SVC trace (EDEN_NX2_SVC_TRACE=1) --- src/core/hle/kernel/svc.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/hle/kernel/svc.cpp') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 3542d5a3b6..d2e45fabb6 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -6,6 +6,7 @@ // This file is automatically generated using svc_generator.py. // DO NOT MODIFY IT MANUALLY +#include #include #include "core/arm/arm_interface.h" @@ -2505,11 +2506,21 @@ void Call(Core::System& system, u32 imm) { LOG_TRACE(Kernel_SVC, "{} [0]={:#x} [1]={:#x} [2]={:#x} [3]={:#x} [4]={:#x} [5]={:#x} [6]={:#x}", imm, GetArg64(args, 0), GetArg64(args, 1), GetArg64(args, 2), GetArg64(args, 3), GetArg64(args, 4), GetArg64(args, 5), GetArg64(args, 6)); + // Set EDEN_NX2_SVC_TRACE=1 to log every SVC with its arguments and results. + static const bool svc_trace = std::getenv("EDEN_NX2_SVC_TRACE") != nullptr; + if (svc_trace) { + LOG_INFO(Kernel_SVC, "svc {:#04x} in [0]={:#x} [1]={:#x} [2]={:#x} [3]={:#x}", imm, + GetArg64(args, 0), GetArg64(args, 1), GetArg64(args, 2), GetArg64(args, 3)); + } if (process.Is64Bit()) { Call64(system, imm, args); } else { Call32(system, imm, args); } + if (svc_trace) { + LOG_INFO(Kernel_SVC, "svc {:#04x} out [0]={:#x} [1]={:#x} [2]={:#x}", imm, + GetArg64(args, 0), GetArg64(args, 1), GetArg64(args, 2)); + } //kernel.ExitSVCProfile(); kernel.CurrentPhysicalCore().LoadSvcArguments(process, args); } -- cgit v1.2.3