Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)

__itt_event_create() fails

r4dium
Beginner
546 Views
I have started a thread (Windows Vista + Win32 + VS2008), and call

__itt_event MyEvent = __itt_event_createW(L"ABCD", 4 )
__itt_event_start(MyEvent)
......
__itt_event_end(MyEvent)

within the thread.

MyEvent is "0" after the call when debugging in VS (I think thats normal because its stubbed).
Moreover I don't see the magenta userevent mark anywhere in the timelineview.
What could I have missed (maybe some compilation flag?)?

By the way:
1.) Thread naming via __itt_thr_name_set( L"SYS_to_GFX", 10 ) works fine within this thread.
2.) If I create a new Win32 MFC project, the user event facility works just fine - I can see the event marks in timeline view. Could therefore be something project specific related to my previous problem ( http://software.intel.com/en-us/forums//topic/60274 ) which I solved by compiling statically.

Regards

R4DIUM




0 Kudos
1 Solution
Mark_D_Intel
Employee
546 Views
By "normally", I mean TP ends when the app ends - not the stop button.

Using the stop button will prevent user event from showing up in the GUI.(this is a known issue).
As a potential workaround, you could try pressing the 'pause' button (which also writes out the TP data files) and then terminate the app with Escape.

To check that the app was instrumented at compile-time, run the app stand-alone (not under TP). If it was instrumented, it should produce some data files in the working directory ("tp.tp" and some others). You can then load the tp.tp file into VTune.
However, my guess is that compiler instrumentation will not help with user event and shutdown issue (but you're welcome to try it).

Mark

View solution in original post

0 Kudos
4 Replies
Mark_D_Intel
Employee
546 Views

You're correct about the debugger and the return value - the API doesn't do anything until it's run under Thread Profiler and instrumented.

Static linking could be a problem. However, since the thread name call works, this is not the problem (assuming the thread name API and the event API are called from the same the module).

How does the app terminate? Does the app finish normally, or do you use the pause or stop buttons? (It could an issue with the TP data files getting written out properly.)

Mark
0 Kudos
r4dium
Beginner
546 Views
What do you mean by "normally"?

Currently I am pressing the red "Stop Activity" Button.

If I press Escape during the runtime, the application finishes and TP then reports
that the "executable exited unexpectedly" (Escape is the executable's built-in exit mechanism),
and doesn't collect any data at all.

So currently the red stop button is my only alternative.

I tried compiling via /Qtprofile in the VS2008 property page under C/C++ Command_Line,
but when I start the executable via TP it still tries to instrument the (hopefully) already instrumented executable.
How can I verify that the executable got instrumented during compilation via the intel c++ compiler in VS?

Regards

R4DIUM


0 Kudos
Mark_D_Intel
Employee
547 Views
By "normally", I mean TP ends when the app ends - not the stop button.

Using the stop button will prevent user event from showing up in the GUI.(this is a known issue).
As a potential workaround, you could try pressing the 'pause' button (which also writes out the TP data files) and then terminate the app with Escape.

To check that the app was instrumented at compile-time, run the app stand-alone (not under TP). If it was instrumented, it should produce some data files in the working directory ("tp.tp" and some others). You can then load the tp.tp file into VTune.
However, my guess is that compiler instrumentation will not help with user event and shutdown issue (but you're welcome to try it).

Mark
0 Kudos
r4dium
Beginner
546 Views
By "normally", I mean TP ends when the app ends - not the stop button.

Using the stop button will prevent user event from showing up in the GUI.(this is a known issue).
As a potential workaround, you could try pressing the 'pause' button (which also writes out the TP data files) and then terminate the app with Escape.

To check that the app was instrumented at compile-time, run the app stand-alone (not under TP). If it was instrumented, it should produce some data files in the working directory ("tp.tp" and some others). You can then load the tp.tp file into VTune.
However, my guess is that compiler instrumentation will not help with user event and shutdown issue (but you're welcome to try it).

Mark

That helped, but the solution was somewhat different:

I found out, that if I instrumented directx lib d3d9.dll with API Imports it was not possible to shutdown

the executable gracefully at all, so I switched to Module Imports.

After doing so, pressing the Pause button also did not work -

I had to press escape or the program's close button (gracefull shutdown)

while the programm was running and beeing profiled. That did the job for me, thx.

Regards R4DIUM

0 Kudos
Reply