Intel® VTune™ Amplifier XE 2013 provides a new feature which is a set of Task APIs. These Task APIs help to highlight your interest of Task and its sub-Task(s), in VTune Amplifier XE result.
Task APIs:
void ITTAPI__itt_task_begin ( const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name)
void ITTAPI__itt_task_end ( const __itt_domain *domain)
It is easier to use(insert) APIs in your code, I gave an example to help of your understandings on using Task APIs quickly.
Steps:
1. Write your code including Task APIs, refer to my example
2. Add paths of ittnotify.h and libittnotify.lib in your environment
3. Add libittnotify.lib to additional LIB to link
4. Create a VTune Amplifier XE project, and run Concurrency Analysis (for example, and don’t forget to select “Analyze user tasks” on
5. In report, click on “Tasks and Frames” tab, your interest of Task and sub-Task(s) will be highlighted.

#include <windows.h>
__itt_string_handle* shMyTask;
__itt_string_handle* shMySubtask;
{
int myNum = *((int *)pArg);
if (myNum==2) __itt_task_begin(domain, __itt_null, __itt_null, shMySubtask);
for (unsigned long i=0; i<600000000L; i++); // Should use "/Od" to avoid "zero" workload
if (myNum==2)__itt_task_end(domain);
}
{
HANDLE threadHandles[num_threads];
int tNum[num_threads];
shMyTask = __itt_string_handle_create("My Task");
shMySubtask = __itt_string_handle_create("My SubTask");
{
tNum[i] = i;
threadHandles[i] = CreateThread( NULL, // Security attributes
0, // Stack size
foo, // Thread function
(LPVOID)&tNum[i],// Data for thread func()
0, // Thread start mode
NULL); // Returned thread ID
}
WaitForMultipleObjects(num_threads, threadHandles, TRUE, INFINITE);
__itt_task_end(domain);
}
