Skip to main content

Tool to visualize profiling data -- a UI for gprof2dot

Project description

Profinspect

A local web app for visualizing profiling data. Wraps gprof2dot and Graphviz dot with an interactive browser UI featuring pan/zoom, configurable thresholds, and format selection.

Requirements

  • Python 3.12+
  • Graphviz (dot command must be available)
  • gprof2dot (defaults to running via uvx gprof2dot)

Installation

pip install -e .

Or with uv:

uv sync

Usage

profinspect [file] [--port PORT] [--no-browser]

Run with no arguments to open the UI with an empty file input:

profinspect

Pass a profile file to open the UI and immediately render the graph:

profinspect output.pstats
profinspect --port 8080 callgrind.out

The --no-browser flag starts the server without opening a browser window.

You can also run as a module:

python -m profinspect output.pstats

Supported Profile Formats

prof, pstats, callgrind, perf, collapse, axe, dtrace, hprof, json, sleepy, sysprof, xperf

The format is auto-detected from the file extension when possible (e.g. .pstats, .prof, callgrind.out.*). If it cannot be inferred, the configured default is used. You can always override the format manually in the dropdown.

These correspond to the formats supported by gprof2dot. Common examples:

Profiler Format Example
Python cProfile / profile pstats python -m cProfile -o out.pstats script.py
Linux perf perf perf record -g -- ./app && perf script
Valgrind callgrind callgrind valgrind --tool=callgrind ./app
gprof prof gprof ./app gmon.out
FlameGraph / py-spy collapse py-spy record -f raw -o out.collapse

UI Overview

The main view has a collapsible sidebar with options and a pannable/zoomable SVG display area.

Sidebar options:

  • File picker (browse button) with auto-detected format
  • Format dropdown with auto-detect or manual override
  • Node and edge threshold sliders (prune low-impact nodes/edges)
  • Colormap selection (color, bw, gray, pink, print)
  • Checkboxes: strip C++ names, wrap labels, color by self time, show samples
  • Advanced: root/leaf function filters, max depth, color skew, path filter

Zoom controls: buttons for zoom in/out, 1:1 reset, and fit-to-view. Mouse wheel zooms at cursor. Click-drag to pan. Ctrl+Enter triggers generation.

Text selection: click-drag on text within graph nodes to select and copy function names. Panning is disabled over text elements to allow selection.

Settings

Accessible from the Settings tab in the UI. Persisted to ~/.config/profinspect/settings.json.

Configurable values:

  • gprof2dot_command -- command to run gprof2dot (default: uvx gprof2dot)
  • dot_command -- command to run Graphviz dot (default: dot)
  • Default values for all generation options (format, thresholds, colormap, etc.)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

profinspect-0.1.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

profinspect-0.1.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file profinspect-0.1.0.tar.gz.

File metadata

  • Download URL: profinspect-0.1.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for profinspect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 84b90e7999ae488fd245fdb45248479f9fa054ee054c25573b3a1edbef17a0d7
MD5 050087f8539d19ba98bbf8530894bc2f
BLAKE2b-256 77c44eb17a953703ce7712f69af6a136c65c674690604e78ba55615210d02751

See more details on using hashes here.

Provenance

The following attestation bundles were made for profinspect-0.1.0.tar.gz:

Publisher: publish.yml on eliasdorneles/profinspect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file profinspect-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: profinspect-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for profinspect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70edbb5bd8d6b26bd7c6fff8bf9950153a7456e836fbb6edc68cd0a3e25fb1d6
MD5 a2bb8c921891e915c54acd4833213c7e
BLAKE2b-256 b755def96bb2ce8f50e3bdf4c3b3cab98b6d0238144181b2b78268696cea00ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for profinspect-0.1.0-py3-none-any.whl:

Publisher: publish.yml on eliasdorneles/profinspect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page