skillfed

gprof2dot

Generate a dot graph from the output of several profilers.

gprof2dot v2025.4.14 6.2M downloads/30d#1,950 on PyPI3,454
Copyleft license LGPL Active released

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 gprof2dot

uv

uv add gprof2dot

poetry

poetry add gprof2dot

Installing 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

Development Status :: 6 - MatureEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)Operating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development

Tags

profiler output to graphconvert profiling data visualizationperf callgrind to dotperformance profile visualizationprofiler output convertercallgraph visualizationgprof to graphviz
profilingvisualizationperformance-analysis

More Software Development packages