summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 24da4367e..d2f5f9bf2 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -13,6 +13,7 @@
13 13
14#include "common/assert.h" 14#include "common/assert.h"
15#include "common/logging/log.h" 15#include "common/logging/log.h"
16#include "common/microprofile.h"
16#include "common/thread.h" 17#include "common/thread.h"
17#include "core/arm/arm_interface.h" 18#include "core/arm/arm_interface.h"
18#include "core/arm/exclusive_monitor.h" 19#include "core/arm/exclusive_monitor.h"
@@ -41,6 +42,8 @@
41#include "core/hle/result.h" 42#include "core/hle/result.h"
42#include "core/memory.h" 43#include "core/memory.h"
43 44
45MICROPROFILE_DEFINE(Kernel_SVC, "Kernel", "SVC", MP_RGB(70, 200, 70));
46
44namespace Kernel { 47namespace Kernel {
45 48
46/** 49/**
@@ -408,6 +411,8 @@ struct KernelCore::Impl {
408 bool is_multicore{}; 411 bool is_multicore{};
409 std::thread::id single_core_thread_id{}; 412 std::thread::id single_core_thread_id{};
410 413
414 std::array<u64, Core::Hardware::NUM_CPU_CORES> svc_ticks{};
415
411 // System context 416 // System context
412 Core::System& system; 417 Core::System& system;
413}; 418};
@@ -666,4 +671,14 @@ void KernelCore::ExceptionalExit() {
666 Suspend(true); 671 Suspend(true);
667} 672}
668 673
674void KernelCore::EnterSVCProfile() {
675 std::size_t core = impl->GetCurrentHostThreadID();
676 impl->svc_ticks[core] = MicroProfileEnter(MICROPROFILE_TOKEN(Kernel_SVC));
677}
678
679void KernelCore::ExitSVCProfile() {
680 std::size_t core = impl->GetCurrentHostThreadID();
681 MicroProfileLeave(MICROPROFILE_TOKEN(Kernel_SVC), impl->svc_ticks[core]);
682}
683
669} // namespace Kernel 684} // namespace Kernel