Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling C++ multi-threaded applications

Have you used any profiling tool like Intel Vtune analyzer?

What are your recommendations for a C++ multi threaded application on Linux and windows? I am primarily interested in cache misses, memory usage, memory leaks and CPU usage.

I use valgrind (only on UNIX), but mainly for finding memory errors and leaks.

like image 208
amit kumar Avatar asked Mar 12 '09 10:03

amit kumar


1 Answers

Following are the good tools for multithreaded applications. You can try evaluation copy.

  1. Runtime sanity check tool
    • Thread Checker -- Intel Thread checker / VTune, here
  2. Memory consistency-check tools (memory usage, memory leaks) - Memory Validator, here
  3. Performance Analysis. (CPU usage) - AQTime , here

EDIT: Intel thread checker can be used to diagnose Data races, Deadlocks, Stalled threads, abandoned locks etc. Please have lots of patience in analyzing the results as it is easy to get confused.

Few tips:

  1. Disable the features that are not required.(In case of identifying deadlocks, data race can be disabled and vice versa.)
  2. Use Instrumentation level based on your need. Levels like "All Function" and "Full Image" are used for data races, where as "API Imports" can be used for deadlock detection)
  3. use context sensitive menu "Diagnostic Help" often.
like image 142
aJ. Avatar answered Nov 09 '22 09:11

aJ.