python / python/cpython

Sampling binary profiles do not record the profiling mode

Open
#154,090 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib topic-profiling type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

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
  • gh-154105

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the profiling.sampling run and replay commands in the report, using the CPU and wall-time examples to reproduce the missing metadata and mismatched comparison. Read the binary profile header handling and the replay and differential flamegraph entry points. Done means the profiling mode is retained in the binary and available for replay or differential validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.