Browse by type
Fastgrind is a header-only memory profiler for C++ applications on Linux toolchains that support GNU ld --wrap. This release branch is trimmed for package consumption: it ships the runtime header, the installable CMake package, the Python trace viewer, and one installed-package CMake example.
include/fastgrind.h: header-only runtimeCMakeLists.txt: installable CMake package exporttools/fastgrind.py: trace inspection and UI tooldemo/cmake_installed_package: minimal consumer example using find_packagedoc/compile.md: integration details for fastgrind::manual and fastgrind::autoInstall fastgrind into any prefix before using it from another CMake project:
cmake -S . -B build
cmake --build build -j$(nproc)
cmake --install build --prefix "$HOME/.local"
This installs:
include/fastgrind.hlib/cmake/fastgrind/fastgrindConfig.cmakelib/cmake/fastgrind/fastgrindConfigVersion.cmakelib/cmake/fastgrind/fastgrindTargets.cmakebin/fastgrind.pyPoint CMake at the install prefix when configuring your own project:
cmake -S . -B build -DCMAKE_PREFIX_PATH="$HOME/.local"
cmake --build build -j$(nproc)
Minimal consumer setup:
find_package(Threads REQUIRED)
find_package(fastgrind CONFIG REQUIRED)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE fastgrind::manual Threads::Threads)
# Or use fastgrind::auto for compiler-driven instrumentation.
The repository includes a working installed-package case in demo/cmake_installed_package.
fastgrind::manual
__FASTGRIND__::FAST_GRIND; inside the functions you want to trackfastgrind::auto
fastgrind::manual-DFASTGRIND_INSTRUMENT-finstrument-functions-Wl,--export-dynamicAutomatic mode still requires including fastgrind.h in at least one translation unit.
When an instrumented program exits, fastgrind writes these files to the current working directory:
fastgrind.text: human-readable summaryfastgrind.fgb: binary trace for the viewerUse the viewer directly from the repository or from the installed prefix:
python tools/fastgrind.py ui fastgrind.fgb
python tools/fastgrind.py inspect fastgrind.fgb
python tools/fastgrind.py export-html fastgrind.fgb
If bin is on your PATH, the installed script can be invoked as:
fastgrind.py ui fastgrind.fgb
--wrap supportFor questions, bug reports, or contributions, please contact us: - Email: zfzmalloc@gmail.com - GitHub: https://github.com/adny-code/fastgrind - Issues: Report bugs and feature requests via GitHub Issues
Fastgrind is released under the MIT License. See LICENSE for details.
$ claude mcp add fastgrind \
-- python -m otcore.mcp_server <graph>