summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Thread.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-02-12 01:36:29 +0100
committerTillmann Karras <tilkax@gmail.com>2015-02-12 02:14:49 +0100
commit0ec48e0ec92644d5b456d092e7634495b39d61bf (patch)
tree590d7fe6aeeea5f0799c69db59b243b50b0e216c /Source/Core/Common/Thread.cpp
parent0e0a196a1c3aefc3cd163de8d9e5636f4353a741 (diff)
JitRegister: fix VTune integration
Diffstat (limited to 'Source/Core/Common/Thread.cpp')
-rw-r--r--Source/Core/Common/Thread.cpp9
1 files changed, 9 insertions, 0 deletions
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