Skip to content

Sampling binary profiles do not record the profiling mode #154090

Description

@pablogsal

Bug report

Bug description:

The sampling binary header does not record --mode. Replay and differential flamegraphs therefore cannot describe or validate how the baseline was collected.

python -m profiling.sampling run --mode cpu --binary -o baseline.bin demo.py
python -m profiling.sampling replay --flamegraph -o replay.html baseline.bin
python -m profiling.sampling run --mode wall --diff-flamegraph baseline.bin -o diff.html demo.py

The replay has no CPU-mode metadata, and the differential run silently compares a CPU baseline with a wall-time profile. These measurements are not comparable.

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