Skip to content

Differential flamegraphs do not match files from different checkout paths #154087

Description

@pablogsal

Bug report

Bug report

Bug description:

Differential flamegraphs use the full filename when matching stack paths. Identical profiles look completely different when the checkout path changes.

mkdir old new
cp demo.py old/demo.py
cp demo.py new/demo.py
python -m profiling.sampling run --binary -o baseline.bin old/demo.py
python -m profiling.sampling run --diff-flamegraph baseline.bin -o diff.html new/demo.py

The current stack is reported as +100% and the identical baseline stack as elided -100%. We should match stable module or relative paths instead of checkout-specific prefixes.

CPython versions tested on:

3.16

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-profilingtype-bugAn unexpected behavior, bug, or error

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions