summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorFiora <fioraaeterna@gmail.com>2015-02-22 07:58:12 -0800
committerFiora <fioraaeterna@gmail.com>2015-02-22 07:58:12 -0800
commitc54a8c54fb97aab9b866f11525fffa5516cfa4e3 (patch)
tree839ab98fcc8441e1c008ba8e28aaedb0cc540e92 /Source/Core
parent8cd32e171a3a100b0f08b2b49f8864c348a4266f (diff)
parent0ec48e0ec92644d5b456d092e7634495b39d61bf (diff)
Merge pull request #1994 from Tilka/vtune
JitRegister: fix VTune integration
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/JitRegister.cpp8
-rw-r--r--Source/Core/Common/Thread.cpp9
-rw-r--r--Source/Core/Core/PowerPC/JitCommon/JitCache.h4
3 files changed, 11 insertions, 10 deletions
diff --git a/Source/Core/Common/JitRegister.cpp b/Source/Core/Common/JitRegister.cpp
index 964a88b214..c99b27e73b 100644
--- a/Source/Core/Common/JitRegister.cpp
+++ b/Source/Core/Common/JitRegister.cpp
@@ -26,7 +26,6 @@
#if defined USE_VTUNE
#include <jitprofiling.h>
-#pragma comment(lib, "libittnotify.lib")
#pragma comment(lib, "jitprofiling.lib")
#endif
@@ -89,12 +88,9 @@ void RegisterV(const void* base_address, u32 code_size,
#ifdef USE_VTUNE
iJIT_Method_Load jmethod = {0};
jmethod.method_id = iJIT_GetNewMethodID();
- jmethod.class_file_name = "";
- jmethod.source_file_name = __FILE__;
- jmethod.method_load_address = base_address;
+ jmethod.method_load_address = const_cast<void*>(base_address);
jmethod.method_size = code_size;
- jmethod.line_number_size = 0;
- jmethod.method_name = symbol_name.data();
+ jmethod.method_name = const_cast<char*>(symbol_name.data());
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&jmethod);
#endif
diff --git a/Source/Core/Common/Thread.cpp b/Source/Core/Common/Thread.cpp
index 286ed088bc..c57760039f 100644
--- a/Source/Core/Common/Thread.cpp
+++ b/Source/Core/Common/Thread.cpp
@@ -12,6 +12,11 @@
#include <pthread_np.h>
#endif
+#ifdef USE_VTUNE
+#include <ittnotify.h>
+#pragma comment(lib, "libittnotify.lib")
+#endif
+
namespace Common
{
@@ -123,6 +128,10 @@ void SetCurrentThreadName(const char* szThreadName)
#else
pthread_setname_np(pthread_self(), szThreadName);
#endif
+#ifdef USE_VTUNE
+ // VTune uses OS thread names by default but probably supports longer names when set via its own API.
+ __itt_thread_set_name(szThreadName);
+#endif
}
#endif
diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/PowerPC/JitCommon/JitCache.h
index 5b38cb6a82..046569aa41 100644
--- a/Source/Core/Core/PowerPC/JitCommon/JitCache.h
+++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.h
@@ -13,10 +13,6 @@
#include "Core/PowerPC/Gekko.h"
#include "Core/PowerPC/PPCAnalyst.h"
-// Define this in order to get VTune profile support for the Jit generated code.
-// Add the VTune include/lib directories to the project directories to get this to build.
-// #define USE_VTUNE
-
// emulate CPU with unlimited instruction cache
// the only way to invalidate a region is the "icbi" instruction
#define JIT_UNLIMITED_ICACHE