summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-12 21:48:43 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:48 +0200
commit7020d498c5aef7c1180bfc57031cdd7fbfecdf0f (patch)
treef2508e39a02966cdd4d9acda1e14ed93cdc150cd /src/core/hle/kernel/kernel.cpp
parentGeneral: Fix Stop function (diff)
downloadyuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.gz
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.bz2
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.lz
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.xz
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.zst
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.zip
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 @@
#include "common/assert.h"
#include "common/logging/log.h"
+#include "common/microprofile.h"
#include "common/thread.h"
#include "core/arm/arm_interface.h"
#include "core/arm/exclusive_monitor.h"
@@ -41,6 +42,8 @@
#include "core/hle/result.h"
#include "core/memory.h"
+MICROPROFILE_DEFINE(Kernel_SVC, "Kernel", "SVC", MP_RGB(70, 200, 70));
+
namespace Kernel {
/**
@@ -408,6 +411,8 @@ struct KernelCore::Impl {
bool is_multicore{};
std::thread::id single_core_thread_id{};
+ std::array<u64, Core::Hardware::NUM_CPU_CORES> svc_ticks{};
+
// System context
Core::System& system;
};
@@ -666,4 +671,14 @@ void KernelCore::ExceptionalExit() {
Suspend(true);
}
+void KernelCore::EnterSVCProfile() {
+ std::size_t core = impl->GetCurrentHostThreadID();
+ impl->svc_ticks[core] = MicroProfileEnter(MICROPROFILE_TOKEN(Kernel_SVC));
+}
+
+void KernelCore::ExitSVCProfile() {
+ std::size_t core = impl->GetCurrentHostThreadID();
+ MicroProfileLeave(MICROPROFILE_TOKEN(Kernel_SVC), impl->svc_ticks[core]);
+}
+
} // namespace Kernel