General: Fix microprofile on dynarmic/svc, fix wait tree showing which threads were running.

This commit is contained in:
Fernando Sahmkow
2020-03-12 16:48:43 -04:00
parent e6f8bde74b
commit 7020d498c5
11 changed files with 87 additions and 13 deletions

View File

@ -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