diff options
| author | 2015-02-05 14:53:25 -0200 | |
|---|---|---|
| committer | 2015-03-01 21:47:13 -0300 | |
| commit | cd1fbfcf1b70e365d81480ec0f56db19ed02454f (patch) | |
| tree | b220b105d1b8016bb258047683bf2d03795c8881 /src/core | |
| parent | Merge pull request #616 from archshift/5551 (diff) | |
| download | yuzu-cd1fbfcf1b70e365d81480ec0f56db19ed02454f.tar.gz yuzu-cd1fbfcf1b70e365d81480ec0f56db19ed02454f.tar.xz yuzu-cd1fbfcf1b70e365d81480ec0f56db19ed02454f.zip | |
Add profiling infrastructure and widget
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/hle.cpp | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index d8a708b9e..c3dba8882 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <unordered_map> | 9 | #include <unordered_map> |
| 10 | 10 | ||
| 11 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 12 | #include "common/profiler.h" | ||
| 12 | 13 | ||
| 13 | #include "core/mem_map.h" | 14 | #include "core/mem_map.h" |
| 14 | #include "core/hle/hle.h" | 15 | #include "core/hle/hle.h" |
| @@ -20,6 +21,9 @@ | |||
| 20 | #include "core/arm/skyeye_common/armmmu.h" | 21 | #include "core/arm/skyeye_common/armmmu.h" |
| 21 | #include "core/arm/skyeye_common/vfp/vfp.h" | 22 | #include "core/arm/skyeye_common/vfp/vfp.h" |
| 22 | 23 | ||
| 24 | Common::Profiling::TimingCategory profile_execute("DynCom::Execute"); | ||
| 25 | Common::Profiling::TimingCategory profile_decode("DynCom::Decode"); | ||
| 26 | |||
| 23 | enum { | 27 | enum { |
| 24 | COND = (1 << 0), | 28 | COND = (1 << 0), |
| 25 | NON_BRANCH = (1 << 1), | 29 | NON_BRANCH = (1 << 1), |
| @@ -3569,6 +3573,8 @@ typedef struct instruction_set_encoding_item ISEITEM; | |||
| 3569 | extern const ISEITEM arm_instruction[]; | 3573 | extern const ISEITEM arm_instruction[]; |
| 3570 | 3574 | ||
| 3571 | static int InterpreterTranslate(ARMul_State* cpu, int& bb_start, addr_t addr) { | 3575 | static int InterpreterTranslate(ARMul_State* cpu, int& bb_start, addr_t addr) { |
| 3576 | Common::Profiling::ScopeTimer timer_decode(profile_decode); | ||
| 3577 | |||
| 3572 | // Decode instruction, get index | 3578 | // Decode instruction, get index |
| 3573 | // Allocate memory and init InsCream | 3579 | // Allocate memory and init InsCream |
| 3574 | // Go on next, until terminal instruction | 3580 | // Go on next, until terminal instruction |
| @@ -3641,6 +3647,8 @@ static bool InAPrivilegedMode(ARMul_State* core) { | |||
| 3641 | } | 3647 | } |
| 3642 | 3648 | ||
| 3643 | unsigned InterpreterMainLoop(ARMul_State* state) { | 3649 | unsigned InterpreterMainLoop(ARMul_State* state) { |
| 3650 | Common::Profiling::ScopeTimer timer_execute(profile_execute); | ||
| 3651 | |||
| 3644 | #undef RM | 3652 | #undef RM |
| 3645 | #undef RS | 3653 | #undef RS |
| 3646 | 3654 | ||
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index b0066e15e..c925279da 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #include <vector> | 5 | #include <vector> |
| 6 | 6 | ||
| 7 | #include "common/profiler.h" | ||
| 8 | |||
| 7 | #include "core/arm/arm_interface.h" | 9 | #include "core/arm/arm_interface.h" |
| 8 | #include "core/mem_map.h" | 10 | #include "core/mem_map.h" |
| 9 | #include "core/hle/hle.h" | 11 | #include "core/hle/hle.h" |
| @@ -19,6 +21,8 @@ | |||
| 19 | 21 | ||
| 20 | namespace HLE { | 22 | namespace HLE { |
| 21 | 23 | ||
| 24 | Common::Profiling::TimingCategory profiler_svc("SVC Calls"); | ||
| 25 | |||
| 22 | static std::vector<ModuleDef> g_module_db; | 26 | static std::vector<ModuleDef> g_module_db; |
| 23 | 27 | ||
| 24 | bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a new thread | 28 | bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a new thread |
| @@ -33,6 +37,8 @@ static const FunctionDef* GetSVCInfo(u32 opcode) { | |||
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | void CallSVC(u32 opcode) { | 39 | void CallSVC(u32 opcode) { |
| 40 | Common::Profiling::ScopeTimer timer_svc(profiler_svc); | ||
| 41 | |||
| 36 | const FunctionDef *info = GetSVCInfo(opcode); | 42 | const FunctionDef *info = GetSVCInfo(opcode); |
| 37 | 43 | ||
| 38 | if (!info) { | 44 | if (!info) { |