JitRegister: fix VTune integration

This commit is contained in:
Tillmann Karras
2015-02-12 01:36:29 +01:00
parent 0e0a196a1c
commit 0ec48e0ec9
5 changed files with 48 additions and 11 deletions

View File

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