Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

Alternative to Intel Inspector?

AndrewC
New Contributor III
674 Views

Not directly related to C/C++ but I have always used Intel Inspector for many years on both Windows and Linux to track tricky threading and memory access issues. 

Now that it is being retired, what alternatives do people have? Particularly on Windows. Looking for a tool that does not required the code to be recompiled.

On Linux, valgrind is "OK", but it suffers from being open source, and the lack of a GUI makes it painful to use.

0 Kudos
1 Solution
Alex_Y_Intel
Moderator
559 Views

Sanitizer is able to do the thread checking too, suppose you have a source code tiny_race.cpp: 

icpx -fsanitize=thread -g tiny_race.cpp
icpx: remark: Note that use of '-g' without any optimization-level option will turn off most compiler optimizations similar to use of '-O0'; use '-Rno-debug-disables-optimization' to disable this remark [-Rdebug-disables-optimization]
sravanik@ortce-skl22:~$ ./a.out
==================
WARNING: ThreadSanitizer: data race (pid=1974537)
  Write of size 4 at 0x000001913ae8 by main thread:
    #0 main /nfs/pdx/home/tiny_race.cpp:10:10 (a.out+0x4e57de)

 

  Previous write of size 4 at 0x000001913ae8 by thread T1:
    #0 Thread1(void*) /nfs/pdx/home/tiny_race.cpp:4:10 (a.out+0x4e577b)

 

  Location is global 'Global' of size 4 at 0x000001913ae8 (a.out+0x1913ae8)

 

  Thread T1 (tid=1974557, finished) created by main thread at:
    #0 pthread_create <null> (a.out+0x436463)
    #1 main /nfs/pdx/home/tiny_race.cpp:9:3 (a.out+0x4e57d4)

 

SUMMARY: ThreadSanitizer: data race /nfs/pdx/home/tiny_race.c:10:10 in main
==================
ThreadSanitizer: reported 1 warnings

View solution in original post

0 Kudos
3 Replies
AndrewC
New Contributor III
582 Views

My comments
- it requires the code be recompiled with new options - another special build.

- I used Intel Inspector for diagnosing tricky threading issues, not just memory issues. 

0 Kudos
Alex_Y_Intel
Moderator
560 Views

Sanitizer is able to do the thread checking too, suppose you have a source code tiny_race.cpp: 

icpx -fsanitize=thread -g tiny_race.cpp
icpx: remark: Note that use of '-g' without any optimization-level option will turn off most compiler optimizations similar to use of '-O0'; use '-Rno-debug-disables-optimization' to disable this remark [-Rdebug-disables-optimization]
sravanik@ortce-skl22:~$ ./a.out
==================
WARNING: ThreadSanitizer: data race (pid=1974537)
  Write of size 4 at 0x000001913ae8 by main thread:
    #0 main /nfs/pdx/home/tiny_race.cpp:10:10 (a.out+0x4e57de)

 

  Previous write of size 4 at 0x000001913ae8 by thread T1:
    #0 Thread1(void*) /nfs/pdx/home/tiny_race.cpp:4:10 (a.out+0x4e577b)

 

  Location is global 'Global' of size 4 at 0x000001913ae8 (a.out+0x1913ae8)

 

  Thread T1 (tid=1974557, finished) created by main thread at:
    #0 pthread_create <null> (a.out+0x436463)
    #1 main /nfs/pdx/home/tiny_race.cpp:9:3 (a.out+0x4e57d4)

 

SUMMARY: ThreadSanitizer: data race /nfs/pdx/home/tiny_race.c:10:10 in main
==================
ThreadSanitizer: reported 1 warnings

0 Kudos
Reply