gprof2dot
Generate a dot graph from the output of several profilers.
What it is and what it does
gprof2dot is a command-line tool that reads profiling output from a wide range of profilers—including Linux perf, Valgrind's callgrind, OProfile, Python's built-in profilers, gprof, and others—and converts it into Graphviz dot format for visualization. It acts as a bridge between profiling tools and graph visualization, letting you generate call graphs and flame-graph-like diagrams from raw profiler data.
The tool supports filtering (pruning nodes and edges below thresholds), coloring by hot-spots, function name stripping, and graph comparison for before-and-after performance analysis. It runs on any platform with Python and Graphviz installed, making it a portable way to turn profiler output into publication-ready diagrams. No runtime Python dependencies are required.
Use it for:
- Convert Linux perf profiling data into a visual call graph to identify performance bottlenecks.
- Generate Valgrind callgrind output as a dot graph for easier analysis of function call hierarchies.
- Compare two profiling runs side-by-side to see which functions got slower or faster.
- Strip C++ template and parameter noise from demangled function names in call graphs.
- Create publication-ready performance visualization diagrams from raw profiler output.
- Analyze Python profiler output (pstats) as a directed graph for code optimization.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts profiler output from many sources (perf, Valgrind, OProfile, Python profilers, gprof, and others) into Graphviz dot graphs for visualization.
Yes. gprof2dot is a mature, well-established tool (first released 2009, active maintenance, 3454 GitHub stars) with zero known vulnerabilities, no runtime dependencies, and low install friction. The LGPL license is permissive for most use cases. Install it if you regularly work with profiler output and need to visualize call graphs; the only real prerequisite is having Graphviz installed separately on your system.
Install
gprof2dot on PyPI
pip
pip install gprof2dotuv
uv add gprof2dotpoetry
poetry add gprof2dotInstalling gprof2dot
Before you install
Installs with no runtime dependencies and has low friction. Maintenance is active but the author notes limited capacity for new features or issue processing.
License in practice
Licensed under LGPL (copyleft), which requires derivative works to remain open-source but permits use in proprietary projects as long as the library itself is not modified and distributed.
Quickstart
pip install gprof2dot
# Convert perf output to PNG
perf record -g -- ./your_program
perf script | gprof2dot -f perf | dot -Tpng -o output.png
Requires Graphviz to be installed separately on your system (not a Python package); Python >=3.8 required.
Verify before relying
- Whether the tool handles all profiler formats equally well or if some have better support than others.
- Performance characteristics when processing very large profiling datasets.
- Whether the comparison feature (--compare) is actively maintained or a legacy option.
Package facts
| License | LGPL (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 487 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,240,383/month — #1,950 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gprof2dot-2025.4.14-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
flameprofConverts Python cProfile statistics into…
permissive · top 15,000 on PyPI
graphvizGenerates DOT language source code for graph…
permissive · top 1,000 on PyPI
pydotpydot is a Python interface to Graphviz that…
permissive · top 1,000 on PyPI
pydot-ngpydot-ng provides a Python interface to…
permissive · top 15,000 on PyPI
pydotplusPyDotPlus provides a Python interface to…
permissive · top 15,000 on PyPI
pytest-profilingPytest plugin that profiles test execution…
permissive · top 5,000 on PyPI
GvGenGvGen generates Graphviz dot files…
permissive · top 15,000 on PyPI
markdown-graphviz-inlineA Markdown extension that converts inline…
permissive · top 15,000 on PyPI
viztracerVizTracer traces Python code execution and…
permissive · top 5,000 on PyPI
objgraphObjgraph lets you visualize and explore Python…
permissive · top 5,000 on PyPI