Profiling C++ multi-threaded applications

前端 未结 7 1463
眼角桃花
眼角桃花 2020-12-31 14:09

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

相关标签:
7条回答
  • 2020-12-31 14:20

    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.
    0 讨论(0)
  • 2020-12-31 14:20

    The Rational PurifyPlus suite includes both a well-proven leak detector and pretty good profiler. I'm not sure if it does go down to the level of cache misses, though - you might need VTune for that.

    PurifyPlus is available both on various Unices and Windows so it should cover your requirements, but unfortunately in contrast to Valgrind, it isn't free.

    0 讨论(0)
  • 2020-12-31 14:24

    I'll put in another answer for valgrind, especially the callgrind portion with the UI. It can handle multiple threads by profiling each thread for cache misses, etc. They also have a multi-thread error checker called helgrind, but I've never used it and don't know how good it is.

    0 讨论(0)
  • 2020-12-31 14:26

    VTune give you a lot of details on what the processor is doing and sometimes I find it hard to see the wood for the trees. VTune will not report on memory leaks. You'll need purify plus for that, or if you can run on a Linux box valgrind is good for memory leaks at a great price.

    VTune shows two views, one is useful the tabular one, the other I think is just for sales men to impress people with but not that useful.

    For quick and cheap option I'd go with valgrind. Valgrind also has a cache grind part to it but i've not used it, but suspect its very good also.

    cheers, Martin.

    0 讨论(0)
  • On Linux, try oprofile. It supports various performance counters.

    On Windows, AMD's CodeAnalyst (free, unlike VTune) is worth a look. It only supports event profiling on AMD hardware though (on Intel CPUs it's just a handy timer-based profiler).

    A colleague recently tried Intel Parallel Studio (beta) and rated it favourably (it found some interesting parallelism-related issues in some code).

    0 讨论(0)
  • 2020-12-31 14:29

    You can try out AMD CodeXL's CPU profiler. It is free and available for both Windows and Linux.

    AMD CodeXL's CPU profiler replaces the no longer supported CodeAnalyst tool (which was mentioned in an answer above given by timday).

    For more information and download links, visit: AMD CodeXL web page.

    0 讨论(0)
提交回复
热议问题