Simple sampling C/C++ profiler. Requires 64-bit Windows. Profiler attaches to process as a debugger, so make sure you disable any code that does something different when running under debugger.
For more accurate results do following steps when building executable (and dll files it depends)
- enable optimizations (C/C++ -> Optimizations -> Optimization, /O2)
- generate debug information in compiler (C/C++ -> General -> Debug Information Format, /Zi)
- generate debug information in linker (Linker -> Debugging -> Generate Debug Info, /DEBUG)
- for 32-bit build, don't omit frame pointers (C/C++ -> Command Line -> put in Additional Options '/Oy-')
- for VS2013 and newer add /Zo in additional compiler options for enhanced debug information
- Allows to profile 32-bit or 64-bit executables
- Run new process or attach existing one
- Automatic download of pdb files for system dll files
- Shows flat view - who was function taking most time
- Shows call graph - which function calls which one
- Search or filter by function name
- View source code with profiling stats per line
- Navigate profile information in source code view (click on red percent numbers)
- Open files in explorer, in default editor or in Visual Studio
- Saving collected data to file for analyzing later
Get 64-bit Windows binary on releases page.
- Get Visual Studio 2013 - https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx
- Install CMake - http://www.cmake.org/
- Install or build from source Qt v5 (64-bit) - https://www.qt.io/download-open-source/
- Set QTDIR environment variable to Qt installation, or adjust path to Qt in bootstrap.cmd
- Run bootstrap.cmd it will generate Visual Studio 2013 solution in Build folder
Future plans, TODO
- Capturing/showing assembly output for functions
- Dwarf debug info support for gcc/clang compilers
- Port to other platforms (GNU/Linux, OSX, ...)
- Visualizations (charts, flame graph)
- Displaying results in real time
- Remove dependency on Qt?
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.