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

How to set the thread name under red hat linux?

zhihang_wang
Beginner
475 Views
I have installed the vtune and thread profile on windows. The Linux thread RDC is also installed on my Red Hat Server.
Now I want to use the windows thread profile to monitor the thread of my app. Because there are many threads in my app, I want to rename them.
This is my test to use the libittnotify.so to rename the thread.
#include
#include "/opt/intel/itt/bin/32e/libittnotify.h"
main()
{
_itt_thr_name_set("main", 4);
printf("ok\\n");
}
when I compile it with
gcc test.c /opt/intel/itt/bin/32e/libittnotify.so -o x
There are always errors.
In file included from test.c:2:
/opt/intel/itt/bin/32e/libittnotify.h:69: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:70: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:71: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:72: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:75: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:80: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:81: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:96: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:99: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:115: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:119: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:120: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:126: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:127: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:129: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:130: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:135: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:136: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:137: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:143: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:144: warning: cdecl attribute ignored
/opt/intel/itt/bin/32e/libittnotify.h:145: warning: cdecl attribute ignored
/tmp/ccQLPHIf.o: In function `main':
test.c:(.text+0x14): undefined reference to `_itt_thr_name_set
0 Kudos
1 Solution
Peter_W_Intel
Employee
475 Views

Actually you should call "__itt_thr_name_set("main", 4);" instead of "_itt_thr_name_set("main", 4);" - I verified. Ignore all warnings.

Regards, Peter

View solution in original post

0 Kudos
1 Reply
Peter_W_Intel
Employee
476 Views

Actually you should call "__itt_thr_name_set("main", 4);" instead of "_itt_thr_name_set("main", 4);" - I verified. Ignore all warnings.

Regards, Peter

0 Kudos
Reply